//
// GJRobotSprite::updateColors from 0x5e6464 to 0x5e66d8 (628 bytes)
//
// 4 xrefs:
// > PlayerObject::createRobot @ 0x44062c
// > PlayerObject::createSpider @ 0x440812
// > GJRobotSprite::updateColor01 @ 0x5e6702
// > GJRobotSprite::updateColor02 @ 0x5e6714
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:54:20 +0000
//
int __fastcall GJRobotSprite::updateColors(GJRobotSprite *this)
{
float v2; // s16
int v3; // r7
int v4; // r1
int v5; // r6
char v6; // r3
int v7; // r1
float v8; // s15
unsigned int v9; // r6
int v10; // r3
float v11; // s14
int v12; // r0
int v13; // r3
int v14; // r0
int SpriteForKey; // r8
int v16; // r7
int result; // r0
int v18; // r6
int v19; // r1
float v20; // s15
int v21; // r3
float v22; // s14
int v23; // r1
cocos2d::CCArray *v24; // r0
int v25; // r0
cocos2d::CCArray *v26; // r0
int v27; // r0
cocos2d::CCArray *v28; // r0
int v29; // r0
_BYTE v30[4]; // [sp+4h] [bp-14h] BYREF
_BYTE v31[4]; // [sp+8h] [bp-10h] BYREF
_BYTE v32[4]; // [sp+Ch] [bp-Ch] BYREF
_BYTE v33[4]; // [sp+10h] [bp-8h] BYREF
v2 = 0.7;
v3 = *((unsigned __int8 *)this + 574);
v4 = *((unsigned __int8 *)this + 575);
v5 = *((unsigned __int8 *)this + 573);
if ( *((_DWORD *)this + 148) == 6 )
v2 = 0.5;
v30[1] = (unsigned int)(float)((float)v3 * v2);
v6 = (unsigned int)(float)((float)v4 * v2);
v7 = v5 | (v3 << 8) | (v4 << 16);
v8 = (float)v5;
v9 = 0;
v30[2] = v6;
v10 = *((unsigned __int8 *)this + 578);
v11 = (float)*((unsigned __int8 *)this + 577) * v2;
v30[0] = (unsigned int)(float)(v8 * v2);
v12 = *((unsigned __int8 *)this + 576);
v31[1] = (unsigned int)v11;
v13 = (unsigned int)(float)((float)v10 * v2);
v31[2] = v13;
v31[0] = (unsigned int)(float)((float)v12 * v2);
CCPartAnimSprite::setColor(*((_DWORD *)this + 136), v7, (unsigned int)v11, v13);
while ( v9 < cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 145)) )
{
v14 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 145), v9++);
(*(void (__fastcall **)(int, char *))(*(_DWORD *)v14 + 480))(v14, (char *)this + 576);
}
SpriteForKey = CCPartAnimSprite::getSpriteForKey(*((CCPartAnimSprite **)this + 136), "back01");
v16 = CCPartAnimSprite::getSpriteForKey(*((CCPartAnimSprite **)this + 136), "back02");
result = CCPartAnimSprite::getSpriteForKey(*((CCPartAnimSprite **)this + 136), "back03");
v18 = result;
if ( SpriteForKey )
{
v19 = *((unsigned __int8 *)this + 573);
v20 = (float)*((unsigned __int8 *)this + 575) * v2;
v32[1] = (unsigned int)(float)((float)*((unsigned __int8 *)this + 574) * v2);
v32[2] = (unsigned int)v20;
v21 = *((unsigned __int8 *)this + 578);
v22 = (float)*((unsigned __int8 *)this + 577) * v2;
v32[0] = (unsigned int)(float)((float)v19 * v2);
v23 = *((unsigned __int8 *)this + 576);
v33[1] = (unsigned int)v22;
v33[2] = (unsigned int)(float)((float)v21 * v2);
v33[0] = (unsigned int)(float)((float)v23 * v2);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)SpriteForKey + 480))(SpriteForKey, v32);
v24 = (cocos2d::CCArray *)(*(int (__fastcall **)(int))(*(_DWORD *)SpriteForKey + 244))(SpriteForKey);
v25 = cocos2d::CCArray::objectAtIndex(v24, 0);
result = (*(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v25 + 480))(v25, v33);
}
if ( v16 )
{
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v16 + 480))(v16, v30);
v26 = (cocos2d::CCArray *)(*(int (__fastcall **)(int))(*(_DWORD *)v16 + 244))(v16);
v27 = cocos2d::CCArray::objectAtIndex(v26, 0);
result = (*(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v27 + 480))(v27, v31);
}
if ( v18 )
{
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v18 + 480))(v18, v30);
v28 = (cocos2d::CCArray *)(*(int (__fastcall **)(int))(*(_DWORD *)v18 + 244))(v18);
v29 = cocos2d::CCArray::objectAtIndex(v28, 0);
return (*(int (__fastcall **)(int, _BYTE *))(*(_DWORD *)v29 + 480))(v29, v31);
}
return result;
}