//
// GJRobotSprite::updateColors from 0x8e2c6c to 0x8e2f18 (684 bytes)
//
// 5 xrefs:
// > PlayerObject::createRobot @ 0x6222a8
// > PlayerObject::createSpider @ 0x622640
// > GJRobotSprite::updateColor01 @ 0x8e2f34
// > GJRobotSprite::updateColor02 @ 0x8e2f4c
// > ??> @ 0xbf0a0
//
// 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 GJRobotSprite::updateColors(GJRobotSprite *a1)
{
float v2; // s8
unsigned int v3; // w19
CCPartAnimSprite *m_paSprite; // x0
__int64 v5; // x1
float v6; // s0
unsigned int v7; // w6
unsigned int v8; // w5
unsigned int v9; // w4
unsigned int v10; // w3
unsigned int v11; // w1
__int64 v12; // x0
CCSpritePart *SpriteForKey; // x23
CCSpritePart *v14; // x21
CCSpritePart *v15; // x19
int r; // w7
void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x8
float v18; // s3
float v19; // s2
float v20; // s1
float v21; // s0
cocos2d::CCArray *v22; // x0
__int64 v23; // x0
cocos2d::CCArray *v24; // x0
__int64 v25; // x0
cocos2d::CCArray *v26; // x0
__int64 v27; // x0
_BYTE v28[8]; // [xsp+48h] [xbp+48h] BYREF
_BYTE v29[8]; // [xsp+50h] [xbp+50h] BYREF
_BYTE v30[8]; // [xsp+58h] [xbp+58h] BYREF
_BYTE v31[8]; // [xsp+60h] [xbp+60h] BYREF
if ( a1->m_iconType == Spider )
v2 = 0.5;
else
v2 = 0.7;
v3 = 0;
m_paSprite = a1->m_paSprite;
v5 = *(_QWORD *)&a1->m_color.r;
v6 = (float)a1->m_secondColor.r * v2;
v7 = (unsigned int)(float)((float)a1->m_color.b * v2);
v8 = (unsigned int)(float)((float)a1->m_color.r * v2);
v9 = (unsigned int)(float)((float)a1->m_secondColor.g * v2);
v10 = (unsigned int)(float)((float)a1->m_secondColor.b * v2);
v28[1] = (unsigned int)(float)((float)a1->m_color.g * v2);
v28[2] = v7;
v28[0] = v8;
v29[1] = v9;
v29[2] = v10;
v29[0] = (unsigned int)v6;
CCPartAnimSprite::setColor(m_paSprite, (cocos2d::ccColor3B)v5);
while ( v3 < (unsigned int)cocos2d::CCArray::count(a1->m_secondArray) )
{
v11 = v3++;
v12 = cocos2d::CCArray::objectAtIndex(a1->m_secondArray, v11);
(*(void (__fastcall **)(__int64, cocos2d::ccColor3B *))(*(_QWORD *)v12 + 944LL))(v12, &a1->m_secondColor);
}
SpriteForKey = CCPartAnimSprite::getSpriteForKey(a1->m_paSprite, "back01");
v14 = CCPartAnimSprite::getSpriteForKey(a1->m_paSprite, "back02");
v15 = CCPartAnimSprite::getSpriteForKey(a1->m_paSprite, "back03");
if ( SpriteForKey )
{
r = a1->m_secondColor.r;
setColor = SpriteForKey->setColor;
v18 = v2 * (float)a1->m_color.b;
v19 = v2 * (float)a1->m_color.r;
v20 = v2 * (float)a1->m_secondColor.g;
v21 = v2 * (float)a1->m_secondColor.b;
v30[1] = (unsigned int)(float)(v2 * (float)a1->m_color.g);
v30[2] = (unsigned int)v18;
v31[2] = (unsigned int)v21;
v30[0] = (unsigned int)v19;
v31[1] = (unsigned int)v20;
v31[0] = (unsigned int)(float)(v2 * (float)r);
setColor(SpriteForKey, (const cocos2d::ccColor3B *)v30);
v22 = SpriteForKey->getChildren(SpriteForKey);
v23 = cocos2d::CCArray::objectAtIndex(v22, 0);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v23 + 944LL))(v23, v31);
}
if ( v14 )
{
v14->setColor(v14, (const cocos2d::ccColor3B *)v28);
v24 = v14->getChildren(v14);
v25 = cocos2d::CCArray::objectAtIndex(v24, 0);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v25 + 944LL))(v25, v29);
}
if ( v15 )
{
v15->setColor(v15, (const cocos2d::ccColor3B *)v28);
v26 = v15->getChildren(v15);
v27 = cocos2d::CCArray::objectAtIndex(v26, 0);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v27 + 944LL))(v27, v29);
}
}