//
// SimplePlayer::updateColors from 0x402eb0 to 0x403094 (484 bytes)
//
// 16 xrefs:
// > CommentCell::loadFromComment @ 0x335faa
// > GJScoreCell::loadFromScore @ 0x3373c0
// > GJLevelScoreCell::loadFromScore @ 0x33842a
// > GJUserCell::loadFromScore @ 0x338b76
// > GJRequestCell::loadFromScore @ 0x33925c
// > GJGarageLayer::toggleGlow @ 0x4030ca
// > SimplePlayer::setColors @ 0x40310a
// > GJGarageLayer::updatePlayerColors @ 0x4031f6
// > SimplePlayer::setColor @ 0x40324c
// > SimplePlayer::setSecondColor @ 0x40326e
// > GJGarageLayer::onSelect @ 0x403a22
// > GJItemIcon::darkenStoreItem @ 0x403c44
// > GJBaseGameLayer::playExitDualEffect @ 0x46f818
// > ProfilePage::loadPageFromUserInfo @ 0x4c5778
// > MapSelectLayer::init @ 0x50f8e0
// > CharacterColorPage::updateIconColors @ 0x565508
//
// 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 SimplePlayer::updateColors(SimplePlayer *a1)
{
const cocos2d::ccColor3B *v2; // r0
int b; // r9
int r; // r11
int g; // r10
const cocos2d::ccColor3B *v6; // r0
GLubyte v7; // r6
GLubyte v8; // r8
GLubyte v9; // r7
_BOOL4 v10; // r5
int v11; // r0
_BOOL4 m_hasCustomGlowColor; // r3
GLubyte v13; // r3
int v14; // r1
GJRobotSprite *m_robotSprite; // r0
GJSpiderSprite *m_spiderSprite; // r0
GJRobotSprite *v17; // r0
GJSpiderSprite *v18; // r0
GJSpiderSprite *v19; // r0
cocos2d::ccColor3B v20; // [sp+8h] [bp-14h]
cocos2d::ccColor3B v21; // [sp+8h] [bp-14h]
cocos2d::ccColor3B v22; // [sp+Ch] [bp-10h]
cocos2d::ccColor3B v23; // [sp+Ch] [bp-10h]
int v24; // [sp+10h] [bp-Ch] BYREF
v2 = a1->m_firstLayer->getColor(a1->m_firstLayer);
b = v2->b;
r = v2->r;
g = v2->g;
v6 = a1->m_secondLayer->getColor(a1->m_secondLayer);
v7 = v6->b;
v8 = v6->r;
v9 = v6->g;
if ( r || g )
{
if ( !v6->r && !v6->g && !v6->b )
goto LABEL_7;
goto LABEL_29;
}
v10 = b == 0;
if ( v6->r || v6->g || v6->b )
{
if ( !b )
{
LOBYTE(v24) = v6->r;
BYTE1(v24) = v9;
BYTE2(v24) = v7;
goto LABEL_9;
}
LABEL_29:
LOBYTE(v24) = v6->r;
BYTE1(v24) = v9;
BYTE2(v24) = v7;
goto LABEL_8;
}
if ( b )
{
LABEL_7:
LOBYTE(v24) = r;
BYTE1(v24) = g;
BYTE2(v24) = b;
LABEL_8:
v10 = 0;
goto LABEL_9;
}
LOWORD(v24) = -1;
BYTE2(v24) = -1;
LABEL_9:
*(cocos2d::ccColor3B *)&v11 = GameToolbox::strongColor((cocos2d::ccColor3B)v24);
m_hasCustomGlowColor = a1->m_hasCustomGlowColor;
LOWORD(v24) = v11;
BYTE2(v24) = BYTE2(v11);
if ( m_hasCustomGlowColor )
{
v13 = a1->m_glowColor.b;
LOWORD(v24) = *(_WORD *)&a1->m_glowColor.r;
BYTE2(v24) = v13;
}
a1->m_outlineSprite->setColor(a1->m_outlineSprite, (const cocos2d::ccColor3B *)&v24);
v14 = v10 || a1->m_hasGlowOutline;
a1->m_outlineSprite->setVisible(a1->m_outlineSprite, v14);
m_robotSprite = a1->m_robotSprite;
if ( m_robotSprite )
{
v20.r = r;
v20.g = g;
v20.b = b;
GJRobotSprite::updateColor01(m_robotSprite, v20);
v22.r = v8;
v22.g = v9;
v22.b = v7;
GJRobotSprite::updateColor02(a1->m_robotSprite, v22);
GJRobotSprite::updateGlowColor(a1->m_robotSprite, (cocos2d::ccColor3B)v24, 1);
}
m_spiderSprite = a1->m_spiderSprite;
if ( m_spiderSprite )
{
v21.r = r;
v21.g = g;
v21.b = b;
GJRobotSprite::updateColor01(m_spiderSprite, v21);
v23.r = v8;
v23.g = v9;
v23.b = v7;
GJRobotSprite::updateColor02(a1->m_spiderSprite, v23);
GJRobotSprite::updateGlowColor(a1->m_spiderSprite, (cocos2d::ccColor3B)v24, 1);
}
v17 = a1->m_robotSprite;
if ( v10 || a1->m_hasGlowOutline )
{
if ( v17 )
GJRobotSprite::showGlow(v17);
v18 = a1->m_spiderSprite;
if ( v18 )
GJRobotSprite::showGlow(v18);
}
else
{
if ( v17 )
GJRobotSprite::hideGlow(v17);
v19 = a1->m_spiderSprite;
if ( v19 )
GJRobotSprite::hideGlow(v19);
}
}