//
// SimplePlayer::updateColors from 0x10036e870 to 0x10036eaeb (635 bytes)
//
// 19 xrefs:
// > GJBaseGameLayer::playExitDualEffect @ 0x100129ab4
// > CommentCell::loadFromComment @ 0x100247c39
// > GJScoreCell::loadFromScore @ 0x1002498c9
// > GJLevelScoreCell::loadFromScore @ 0x10024ae5b
// > GJUserCell::loadFromScore @ 0x10024bbaa
// > GJRequestCell::loadFromScore @ 0x10024c3bc
// > MapSelectLayer::init @ 0x10026827b
// > GJGarageLayer::updatePlayerColors @ 0x10036aecf
// > GJGarageLayer::updatePlayerColors @ 0x10036af3d
// > GJGarageLayer::onSelect @ 0x10036e260
// > GJGarageLayer::toggleGlow @ 0x10036ed08
// > SimplePlayer::setColors @ 0x10036ede7
// > SimplePlayer::setColor @ 0x100370942
// > sub_100370950 @ 0x100370979
// > SimplePlayer::setSecondColor @ 0x1003709a2
// > GJItemIcon::init @ 0x10037137f
// > GJItemIcon::darkenStoreItem @ 0x100371804
// > CharacterColorPage::updateIconColors @ 0x10065dafb
// > ProfilePage::loadPageFromUserInfo @ 0x1007baa39
//
// 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 SimplePlayer::updateColors(SimplePlayer *a1)
{
GLubyte *v2; // rax
GLubyte v3; // r12
GLubyte v4; // r15
GLubyte v5; // r14
GLubyte *v6; // rax
GLubyte v7; // dl
GLubyte v8; // si
GLubyte v9; // r13
bool v10; // al
char v11; // cl
bool v12; // r12
cocos2d::CCSprite *m_outlineSprite; // rdi
bool m_hasGlowOutline; // al
GJRobotSprite *m_robotSprite; // rdi
int v16; // ecx
GJSpiderSprite *m_spiderSprite; // rdi
GJRobotSprite *v18; // rdi
GJSpiderSprite *v19; // rdi
GJSpiderSprite *v20; // rdi
GLubyte v21; // [rsp+Ch] [rbp-34h]
GLubyte v22; // [rsp+13h] [rbp-2Dh]
cocos2d::ccColor3B m_glowColor; // [rsp+14h] [rbp-2Ch] BYREF
v2 = (GLubyte *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_firstLayer->getColor)(a1->m_firstLayer);
v3 = *v2;
v4 = v2[1];
v5 = v2[2];
v6 = (GLubyte *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_secondLayer->getColor)(a1->m_secondLayer);
v7 = *v6;
v8 = v6[1];
v9 = v6[2];
v21 = v3;
v10 = (v9 | (unsigned __int8)(v8 | *v6)) == 0;
v11 = v5 | v4 | v3;
v12 = v11 == 0;
v22 = v7;
if ( v11 && v9 | (unsigned __int8)(v8 | v7) || (v9 | (unsigned __int8)(v8 | v7)) != 0 && v11 == 0 )
{
m_glowColor.r = v7;
m_glowColor.g = v8;
m_glowColor.b = v9;
}
else if ( v11 == 0 || !v10 )
{
m_glowColor.b = -1;
*(_WORD *)&m_glowColor.r = -1;
}
else
{
m_glowColor.r = v21;
m_glowColor.g = v4;
m_glowColor.b = v5;
}
m_glowColor = GameToolbox::strongColor((cocos2d::ccColor3B)((m_glowColor.b << 16) | *(unsigned __int16 *)&m_glowColor.r));
if ( a1->m_hasCustomGlowColor )
m_glowColor = a1->m_glowColor;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor3B *))a1->m_outlineSprite->setColor)(
a1->m_outlineSprite,
&m_glowColor);
m_outlineSprite = a1->m_outlineSprite;
m_hasGlowOutline = 1;
if ( !v12 )
m_hasGlowOutline = a1->m_hasGlowOutline;
((void (__fastcall *)(cocos2d::CCSprite *, bool))m_outlineSprite->setVisible)(m_outlineSprite, m_hasGlowOutline);
m_robotSprite = a1->m_robotSprite;
v16 = v21;
if ( m_robotSprite )
{
GJRobotSprite::updateColor01(m_robotSprite, (cocos2d::ccColor3B)((v5 << 16) | v21 | (v4 << 8)));
GJRobotSprite::updateColor02(a1->m_robotSprite, (cocos2d::ccColor3B)((v9 << 16) | v22 | (v8 << 8)));
GJRobotSprite::updateGlowColor(
a1->m_robotSprite,
(cocos2d::ccColor3B)((m_glowColor.b << 16) | *(unsigned __int16 *)&m_glowColor.r),
1);
v16 = v21;
}
m_spiderSprite = a1->m_spiderSprite;
if ( m_spiderSprite )
{
GJRobotSprite::updateColor01(m_spiderSprite, (cocos2d::ccColor3B)((v5 << 16) | v16 | (v4 << 8)));
GJRobotSprite::updateColor02(a1->m_spiderSprite, (cocos2d::ccColor3B)((v9 << 16) | v22 | (v8 << 8)));
GJRobotSprite::updateGlowColor(
a1->m_spiderSprite,
(cocos2d::ccColor3B)((m_glowColor.b << 16) | *(unsigned __int16 *)&m_glowColor.r),
1);
}
if ( v12 )
{
v18 = a1->m_robotSprite;
LABEL_18:
if ( v18 )
GJRobotSprite::showGlow(v18);
v19 = a1->m_spiderSprite;
if ( v19 )
GJRobotSprite::showGlow(v19);
return;
}
v18 = a1->m_robotSprite;
if ( a1->m_hasGlowOutline )
goto LABEL_18;
if ( v18 )
GJRobotSprite::hideGlow(v18);
v20 = a1->m_spiderSprite;
if ( v20 )
GJRobotSprite::hideGlow(v20);
}