//
// LevelSelectLayer::colorForPage from 0x409180 to 0x409244 (196 bytes)
//
// 3 xrefs:
// > LevelSelectLayer::colorForPage @ 0x40920e
// > LevelSelectLayer::getColorValue @ 0x40928e
// > LevelSelectLayer::getColorValue @ 0x4092aa
//
// 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
//
cocos2d::ccColor3B LevelSelectLayer::colorForPage(LevelSelectLayer *a1, int a2)
{
GameManager *v2; // r0
int v3; // r1
int v4; // r0
__int16 v7; // [sp+4h] [bp-8h]
unsigned __int8 v8; // [sp+6h] [bp-6h]
if ( !a2 )
{
v2 = GameManager::sharedState();
v3 = 5;
LABEL_14:
*(cocos2d::ccColor3B *)&v4 = GameManager::colorForIdx(v2, v3);
LABEL_16:
v7 = v4;
v8 = BYTE2(v4);
return (cocos2d::ccColor3B)((unsigned __int8)v7 | (unsigned __int16)(HIBYTE(v7) << 8) | (v8 << 16));
}
if ( a2 % 22 )
{
switch ( a2 )
{
case 1:
v2 = GameManager::sharedState();
v3 = 7;
goto LABEL_14;
case 2:
v2 = GameManager::sharedState();
v3 = 8;
goto LABEL_14;
case 3:
v2 = GameManager::sharedState();
v3 = 9;
goto LABEL_14;
case 4:
v2 = GameManager::sharedState();
v3 = 10;
goto LABEL_14;
case 5:
v2 = GameManager::sharedState();
v3 = 11;
goto LABEL_14;
case 6:
v2 = GameManager::sharedState();
v3 = 1;
goto LABEL_14;
case 7:
v2 = GameManager::sharedState();
v3 = 3;
goto LABEL_14;
case 8:
v2 = GameManager::sharedState();
v3 = 4;
goto LABEL_14;
default:
*(cocos2d::ccColor3B *)&v4 = LevelSelectLayer::colorForPage(a1, a2 % 9);
break;
}
goto LABEL_16;
}
v7 = 11301;
v8 = 52;
return (cocos2d::ccColor3B)((unsigned __int8)v7 | (unsigned __int16)(HIBYTE(v7) << 8) | (v8 << 16));
}