//
// GJRobotSprite::updateColors from 0x1005dcc60 to 0x1005dcf6f (783 bytes)
//
// 4 xrefs:
// > PlayerObject::createRobot @ 0x1003fc18e
// > PlayerObject::createSpider @ 0x1003fc529
// > GJRobotSprite::updateColor01 @ 0x1005dcc56
// > GJRobotSprite::updateColor02 @ 0x1005dcf86
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJRobotSprite::updateColors(GJRobotSprite *a1)
{
float v1; // xmm1_4
int v2; // eax
int v3; // ecx
int v4; // eax
int v5; // ecx
unsigned int v6; // r15d
__int64 v7; // rax
CCSpritePart *SpriteForKey; // r12
CCSpritePart *v9; // r15
CCSpritePart *v10; // r14
int v11; // eax
int v12; // ecx
int v13; // eax
int v14; // ecx
__int64 v15; // rax
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int16 v21; // [rsp+10h] [rbp-30h] BYREF
char v22; // [rsp+12h] [rbp-2Eh]
__int16 v23; // [rsp+14h] [rbp-2Ch] BYREF
char v24; // [rsp+16h] [rbp-2Ah]
__int16 v25; // [rsp+18h] [rbp-28h] BYREF
char v26; // [rsp+1Ah] [rbp-26h]
__int16 v27; // [rsp+1Ch] [rbp-24h] BYREF
char v28; // [rsp+1Eh] [rbp-22h]
v1 = *(float *)&a333_0[4 * (a1->m_iconType == Spider)];
v2 = (int)(float)((float)a1->m_color.r * v1);
v3 = (int)(float)((float)a1->m_color.g * v1);
v26 = (int)(float)((float)a1->m_color.b * v1);
v25 = ((unsigned __int8)v3 << 8) | (unsigned __int8)v2;
v4 = (int)(float)((float)a1->m_secondColor.r * v1);
v5 = (int)(float)((float)a1->m_secondColor.g * v1);
v28 = (int)(float)((float)a1->m_secondColor.b * v1);
v27 = ((unsigned __int8)v5 << 8) | (unsigned __int8)v4;
CCPartAnimSprite::setColor(
a1->m_paSprite,
(cocos2d::ccColor3B)(*(unsigned __int16 *)&a1->m_color.r | (a1->m_color.b << 16)));
if ( (unsigned int)sub_100720070(a1->m_secondArray) )
{
v6 = 0;
do
{
v7 = sub_1007200C0(a1->m_secondArray, v6);
(*(void (__fastcall **)(__int64, cocos2d::ccColor3B *))(*(_QWORD *)v7 + 944LL))(v7, &a1->m_secondColor);
++v6;
}
while ( v6 < (unsigned int)sub_100720070(a1->m_secondArray) );
}
SpriteForKey = CCPartAnimSprite::getSpriteForKey(a1->m_paSprite, "back01");
v9 = CCPartAnimSprite::getSpriteForKey(a1->m_paSprite, "back02");
v10 = CCPartAnimSprite::getSpriteForKey(a1->m_paSprite, "back03");
if ( SpriteForKey )
{
v11 = (int)(float)((float)a1->m_color.r * v1);
v12 = (int)(float)((float)a1->m_color.g * v1);
v22 = (int)(float)((float)a1->m_color.b * v1);
v21 = ((unsigned __int8)v12 << 8) | (unsigned __int8)v11;
v13 = (int)(float)((float)a1->m_secondColor.r * v1);
v14 = (int)(float)((float)a1->m_secondColor.g * v1);
v24 = (int)(float)((float)a1->m_secondColor.b * v1);
v23 = ((unsigned __int8)v14 << 8) | (unsigned __int8)v13;
((void (__fastcall *)(CCSpritePart *, __int16 *))SpriteForKey->setColor)(SpriteForKey, &v21);
v15 = ((__int64 (__fastcall *)(CCSpritePart *))SpriteForKey->getChildren)(SpriteForKey);
v16 = sub_1007200C0(v15, 0);
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v16 + 944LL))(v16, &v23);
}
if ( v9 )
{
((void (__fastcall *)(CCSpritePart *, __int16 *))v9->setColor)(v9, &v25);
v17 = ((__int64 (__fastcall *)(CCSpritePart *))v9->getChildren)(v9);
v18 = sub_1007200C0(v17, 0);
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v18 + 944LL))(v18, &v27);
}
if ( v10 )
{
((void (__fastcall *)(CCSpritePart *, __int16 *))v10->setColor)(v10, &v25);
v19 = ((__int64 (__fastcall *)(CCSpritePart *))v10->getChildren)(v10);
v20 = sub_1007200C0(v19, 0);
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v20 + 944LL))(v20, &v27);
}
}