//
// ShaderLayer::preColorChangeShader from 0xb2d934 to 0xb2daa4 (368 bytes)
//
// 2 xrefs:
// > ShaderLayer::performCalculations @ 0xb2e684
// > ??> @ 0xd38e8
//
// 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::preColorChangeShader(ShaderLayer *this)
{
cocos2d::CCGLProgram *v2; // x0
__int64 result; // x0
__int64 v4; // x1
cocos2d::CCGLProgram *v5; // x0
float v6; // s0
cocos2d::CCGLProgram *v7; // x0
if ( *((float *)this + 256) == 1.0
&& *((float *)this + 257) == 1.0
&& *((float *)this + 258) == 1.0
&& *((float *)this + 259) == 0.0
&& *((float *)this + 260) == 0.0
&& *((float *)this + 261) == 0.0 )
{
v2 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
cocos2d::CCGLProgram::setUniformLocationWith3f(v2, *((_DWORD *)this + 388), 0.0, 0.0, 0.0);
if ( cocos2d::CCNode::getActionByTag(this, 42)
|| cocos2d::CCNode::getActionByTag(this, 43)
|| cocos2d::CCNode::getActionByTag(this, 44)
|| cocos2d::CCNode::getActionByTag(this, 39)
|| cocos2d::CCNode::getActionByTag(this, 40)
|| (result = cocos2d::CCNode::getActionByTag(this, 41)) != 0 )
{
*((_BYTE *)this + 1078) = 1;
return 1;
}
}
else
{
v4 = *((_QWORD *)this + 138);
*((_BYTE *)this + 1078) = 1;
v5 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 656LL))(v4);
v6 = *((float *)this + 256);
if ( v6 <= 0.001 )
v6 = 0.001;
cocos2d::CCGLProgram::setUniformLocationWith3f(
v5,
*((_DWORD *)this + 388),
v6,
*((float *)this + 257),
*((float *)this + 258));
v7 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 138) + 656LL))(*((_QWORD *)this + 138));
return cocos2d::CCGLProgram::setUniformLocationWith3f(
v7,
*((_DWORD *)this + 389),
*((float *)this + 259),
*((float *)this + 260),
*((float *)this + 261));
}
return result;
}