//
// ShaderLayer::preSplitScreenShader from 0xb2e0d0 to 0xb2e36c (668 bytes)
//
// 3 xrefs:
// > ShaderLayer::visit @ 0xb2e494
// > ShaderLayer::performCalculations @ 0xb2e694
// > ??> @ 0xe6980
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:01:42 +0000
//
__int64 __fastcall ShaderLayer::preSplitScreenShader(ShaderLayer *this)
{
double v2; // d1
double v3; // d9
char v4; // w0
__int64 v5; // x1
float v6; // s8
float v7; // s9
cocos2d::CCGLProgram *v8; // x0
cocos2d::CCGLProgram *v9; // x0
cocos2d::CCGLProgram *v10; // x0
float v11; // s0
cocos2d::CCGLProgram *v12; // x0
float v13; // s0
__int64 result; // x0
__int64 v15; // x0
float v16; // s9
float v17; // s8
cocos2d::CCGLProgram *v18; // x0
cocos2d::CCGLProgram *v19; // x0
cocos2d::CCGLProgram *v20; // x0
cocos2d::CCGLProgram *v21; // x0
cocos2d::CCGLProgram *v22; // x0
cocos2d::CCGLProgram *v23; // x0
__int64 ActionByTag; // x0
v2 = *((double *)this + 131);
v3 = *((double *)this + 132);
if ( v2 != 0.0 || v3 != 0.0 )
goto LABEL_3;
if ( cocos2d::CCNode::getActionByTag(this, 45) )
{
v2 = *((double *)this + 131);
v3 = *((double *)this + 132);
LABEL_3:
v4 = 1;
*((_BYTE *)this + 1078) = 1;
goto LABEL_4;
}
ActionByTag = cocos2d::CCNode::getActionByTag(this, 46);
v2 = *((double *)this + 131);
if ( ActionByTag )
{
v3 = *((double *)this + 132);
goto LABEL_3;
}
v4 = 0;
v3 = *((double *)this + 132);
LABEL_4:
v5 = *((_QWORD *)this + 138);
*((_BYTE *)this + 1064) = v4;
v6 = v2 + 1.0;
v7 = v3 + 1.0;
v8 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 656LL))(v5);
cocos2d::CCGLProgram::setUniformLocationWith1f(v8, *((_DWORD *)this + 390), v6);
v9 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v9, *((_DWORD *)this + 391), v7);
v10 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
v11 = ((float)-v6 + 1.0) * *((float *)this + 129);
cocos2d::CCGLProgram::setUniformLocationWith1f(v10, *((_DWORD *)this + 392), v11);
v12 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
v13 = ((float)-v7 + 1.0) * *((float *)this + 128);
cocos2d::CCGLProgram::setUniformLocationWith1f(v12, *((_DWORD *)this + 393), v13);
result = *((unsigned __int8 *)this + 1064);
if ( *((_BYTE *)this + 1064) )
{
v15 = *((_QWORD *)this + 141);
if ( v15 )
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(v15 + 3920) + 168LL))(*(_QWORD *)(v15 + 3920));
v16 = (float)(*(float *)&pixelOffset / *((float *)this + 292)) * *((float *)this + 128);
v17 = (float)(*(float *)&dword_155E264 / *((float *)this + 293)) * *((float *)this + 129);
v18 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v18, *((_DWORD *)this + 394), -v16);
v19 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v19, *((_DWORD *)this + 395), v16 + (float)(1.0 - v16));
v20 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(
v20,
*((_DWORD *)this + 396),
1.0 / (float)(v16 + (float)(1.0 - v16)));
v21 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v21, *((_DWORD *)this + 397), -v17);
v22 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith1f(v22, *((_DWORD *)this + 398), v17 + (float)(1.0 - v17));
v23 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
return cocos2d::CCGLProgram::setUniformLocationWith1f(
v23,
*((_DWORD *)this + 399),
1.0 / (float)(v17 + (float)(1.0 - v17)));
}
return result;
}