//
// MenuGameLayer::updateColor from 0x1004fa180 to 0x1004fa360 (480 bytes)
//
// 2 xrefs:
// > MenuGameLayer::init @ 0x1004f9e2a
// > MenuGameLayer::init @ 0x1004f9e0e
//
// 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 MenuGameLayer::updateColor(MenuGameLayer *a1, float a2)
{
unsigned int m_initCount; // eax
int v4; // ecx
__int64 v5; // kr00_8
int v6; // edx
int v7; // r15d
int v8; // r14d
GameManager *v9; // rax
int v10; // eax
signed int v11; // r14d
cocos2d::CCTintTo *v12; // rax
GJGroundLayer *m_groundLayer; // rax
cocos2d::CCTintTo *v14; // rax
cocos2d::CCSprite *m_ground2Sprite; // rdi
cocos2d::CCTintTo *v16; // rax
float v17; // [rsp+Ch] [rbp-24h]
m_initCount = a1->m_initCount;
v4 = m_initCount;
v5 = m_initCount;
if ( m_initCount > 7 )
{
LABEL_2:
v6 = v4 + 7;
if ( v4 >= 0 )
v6 = v4;
v4 -= v6 & 0xFFFFFFF8;
v5 = (unsigned int)v4;
}
switch ( v5 )
{
case 0LL:
v7 = 16737792;
goto LABEL_15;
case 1LL:
v8 = 7;
goto LABEL_14;
case 2LL:
v8 = 8;
goto LABEL_14;
case 3LL:
v8 = 9;
goto LABEL_14;
case 4LL:
v8 = 10;
goto LABEL_14;
case 5LL:
v8 = 11;
goto LABEL_14;
case 6LL:
v8 = 1;
goto LABEL_14;
case 7LL:
v8 = 3;
LABEL_14:
v9 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&v10 = GameManager::colorForIdx(v9, v8);
v7 = v10;
m_initCount = a1->m_initCount;
LABEL_15:
v11 = (v7 & 0xFFFFFFu) >> 16;
a1->m_initCount = m_initCount + 1;
cocos2d::CCNode::stopAllActions(a1->m_backgroundSprite);
v12 = cocos2d::CCTintTo::create(4.0, v7, BYTE1(v7), v11);
cocos2d::CCNode::runAction(a1->m_backgroundSprite, v12);
m_groundLayer = a1->m_groundLayer;
v17 = flt_10081DEC0[m_groundLayer->m_ground2Sprite == nullptr];
cocos2d::CCNode::stopAllActions(m_groundLayer->m_ground1Sprite);
v14 = cocos2d::CCTintTo::create(
4.0,
(int)(float)((float)(unsigned __int8)v7 * v17),
(int)(float)((float)BYTE1(v7) * v17),
(int)(float)((float)v11 * v17));
cocos2d::CCNode::runAction(a1->m_groundLayer->m_ground1Sprite, v14);
m_ground2Sprite = a1->m_groundLayer->m_ground2Sprite;
if ( m_ground2Sprite )
{
cocos2d::CCNode::stopAllActions(m_ground2Sprite);
v16 = cocos2d::CCTintTo::create(4.0, v7, BYTE1(v7), v11);
cocos2d::CCNode::runAction(a1->m_groundLayer->m_ground2Sprite, v16);
}
return;
default:
goto LABEL_2;
}
}