//
// cocos2d::CCLayerGradient::updateColor from 0xd5c20c to 0xd5c444 (568 bytes)
//
// 3 xrefs:
// > ??> @ 0x43d20
// > ??> @ 0x14762a0
// > ??> @ 0x151a8f0
//
// 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:07:47 +0000
//
__int64 __fastcall cocos2d::CCLayerGradient::updateColor(cocos2d::CCLayerGradient *this)
{
float v2; // s0
float v4; // s4
float v5; // s3
float v6; // s2
float v7; // s1
float v8; // s0
float v9; // s17
float v10; // s16
float v11; // s7
float v12; // s4
float v13; // s3
float v14; // s18
float v15; // s2
float v16; // s1
float v17; // s0
float v18; // s8
float v19; // s5
float v20; // s6
float v21; // [xsp+48h] [xbp+48h] BYREF
float v22; // [xsp+4Ch] [xbp+4Ch]
float v23; // [xsp+50h] [xbp+50h] BYREF
cocos2d::ccpLength((cocos2d::CCLayerGradient *)((char *)this + 552), _stack_chk_guard);
if ( v2 != 0.0 )
{
cocos2d::CCPoint::CCPoint(&v21, *((float *)this + 138) / v2, *((float *)this + 139) / v2);
if ( *((_BYTE *)this + 560) )
{
cocos2d::CCPoint::operator*(&v21, &v23, (float)(1.0 / (float)(fabsf(v21) + fabsf(v22))) * 1.4142);
cocos2d::CCPoint::operator=(&v21, &v23);
}
v4 = (float)*((unsigned __int8 *)this + 416) / 255.0;
v5 = (float)*((unsigned __int8 *)this + 418) / 255.0;
v6 = (float)*((unsigned __int8 *)this + 419) / 255.0;
v7 = (float)*((unsigned __int8 *)this + 420) / 255.0;
v8 = (float)((float)*((unsigned __int8 *)this + 550) * v4) / 255.0;
v9 = (float)*((unsigned __int8 *)this + 547) / 255.0;
v10 = (float)*((unsigned __int8 *)this + 548) / 255.0;
v11 = (float)*((unsigned __int8 *)this + 549) / 255.0;
v12 = (float)((float)*((unsigned __int8 *)this + 551) * v4) / 255.0;
if ( *((_BYTE *)this + 561) )
{
v5 = v5 * v8;
v6 = v6 * v8;
v7 = v7 * v8;
v9 = v9 * v12;
v10 = v10 * v12;
v11 = v11 * v12;
}
v13 = v5 - v9;
v14 = (float)((float)(v21 + 1.4142) + v22) / 2.8284;
v15 = v6 - v10;
v16 = v7 - v11;
v17 = v8 - v12;
v18 = (float)(v22 + (float)(1.4142 - v21)) / 2.8284;
v19 = (float)((float)(1.4142 - v21) - v22) / 2.8284;
v20 = (float)((float)(v21 + 1.4142) - v22) / 2.8284;
*((float *)this + 118) = v9 + (float)(v13 * v14);
*((float *)this + 119) = v10 + (float)(v14 * v15);
*((float *)this + 120) = v11 + (float)(v14 * v16);
*((float *)this + 121) = v12 + (float)(v14 * v17);
*((float *)this + 122) = v9 + (float)(v13 * v18);
*((float *)this + 123) = v10 + (float)(v15 * v18);
*((float *)this + 124) = v11 + (float)(v16 * v18);
*((float *)this + 125) = v12 + (float)(v17 * v18);
*((float *)this + 126) = v9 + (float)(v13 * v20);
*((float *)this + 127) = v10 + (float)(v15 * v20);
*((float *)this + 128) = v11 + (float)(v16 * v20);
*((float *)this + 129) = v12 + (float)(v17 * v20);
*((float *)this + 130) = v9 + (float)(v13 * v19);
*((float *)this + 131) = v10 + (float)(v15 * v19);
*((float *)this + 132) = v11 + (float)(v16 * v19);
*((float *)this + 133) = v12 + (float)(v17 * v19);
}
return _stack_chk_guard;
}