//
// GJBaseGameLayer::updateLevelColors from 0x46d970 to 0x46dbde (622 bytes)
//
// 10 xrefs:
// > PlayLayer::postUpdate @ 0x31baf6
// > PlayLayer::setupHasCompleted @ 0x31c1c4
// > PlayLayer::setupHasCompleted @ 0x31c3ce
// > PlayLayer::resetLevel @ 0x31fd06
// > LevelEditorLayer::onPlaytest @ 0x36ecf4
// > LevelEditorLayer::postUpdate @ 0x375168
// > LevelEditorLayer::updateGameObjects @ 0x376000
// > GJBaseGameLayer::asyncBGLoaded @ 0x46dbf6
// > GJBaseGameLayer::asyncGLoaded @ 0x46dc42
// > GJBaseGameLayer::asyncMGLoaded @ 0x46dc54
//
// 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 GJBaseGameLayer::updateLevelColors(GJBaseGameLayer *a1)
{
int v2; // r0
char v3; // r3
cocos2d::CCSprite *m_background; // r0
int v5; // r0
int v6; // r0
int v7; // r0
char v8; // r3
GJEffectManager *m_effectManager; // r0
float v10; // s16
GJGroundLayer *m_groundLayer; // r5
bool shouldBlend; // r0
GJGroundLayer *m_groundLayer2; // r5
bool v14; // r0
GJMGLayer *m_middleground; // r5
int v16; // r0
GJMGLayer *v17; // r5
int v18; // r0
GJMGLayer *v19; // r5
float v20; // r0
GJMGLayer *v21; // r5
GJMGLayer *v22; // r5
bool v23; // r0
GJMGLayer *v24; // r5
bool v25; // r0
unsigned __int8 v26[4]; // [sp+4h] [bp-1Ch]
unsigned __int8 v27[4]; // [sp+4h] [bp-1Ch]
_BYTE v28[4]; // [sp+8h] [bp-18h] BYREF
int v29; // [sp+Ch] [bp-14h]
_BYTE v30[4]; // [sp+10h] [bp-10h] BYREF
int v31; // [sp+14h] [bp-Ch]
int v32; // [sp+18h] [bp-8h]
*(cocos2d::ccColor3B *)&v2 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1000);
v3 = BYTE1(v2);
v28[0] = v2;
v28[2] = BYTE2(v2);
m_background = a1->m_background;
v28[1] = v3;
m_background->setColor(m_background, (const cocos2d::ccColor3B *)v28);
*(cocos2d::ccColor3B *)&v5 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1001);
LOWORD(v29) = v5;
BYTE2(v29) = BYTE2(v5);
GJGroundLayer::updateGround01Color(a1->m_groundLayer, (cocos2d::ccColor3B)v29);
GJGroundLayer::updateGround01Color(a1->m_groundLayer2, (cocos2d::ccColor3B)v29);
if ( a1->m_groundLayer->m_ground2Sprite )
{
*(cocos2d::ccColor3B *)&v6 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1009);
LOWORD(v32) = v6;
BYTE2(v32) = BYTE2(v6);
GJGroundLayer::updateGround02Color(a1->m_groundLayer, (cocos2d::ccColor3B)v32);
GJGroundLayer::updateGround02Color(a1->m_groundLayer2, (cocos2d::ccColor3B)v32);
}
*(cocos2d::ccColor3B *)&v7 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1002);
v8 = BYTE1(v7);
v30[0] = v7;
v30[2] = BYTE2(v7);
m_effectManager = a1->m_effectManager;
v30[1] = v8;
v10 = GJEffectManager::activeOpacityForIndex(m_effectManager, 1002);
a1->m_groundLayer->m_lineSprite->setColor(a1->m_groundLayer->m_lineSprite, (const cocos2d::ccColor3B *)v30);
a1->m_groundLayer2->m_lineSprite->setColor(a1->m_groundLayer2->m_lineSprite, (const cocos2d::ccColor3B *)v30);
*(_DWORD *)v26 = (unsigned int)(float)(v10 * 255.0);
a1->m_groundLayer->m_lineSprite->setOpacity(a1->m_groundLayer->m_lineSprite, v26[0]);
a1->m_groundLayer2->m_lineSprite->setOpacity(a1->m_groundLayer2->m_lineSprite, v26[0]);
m_groundLayer = a1->m_groundLayer;
shouldBlend = GJEffectManager::shouldBlend(a1->m_effectManager, 1002);
GJGroundLayer::updateLineBlend(m_groundLayer, shouldBlend);
m_groundLayer2 = a1->m_groundLayer2;
v14 = GJEffectManager::shouldBlend(a1->m_effectManager, 1002);
GJGroundLayer::updateLineBlend(m_groundLayer2, v14);
m_middleground = a1->m_middleground;
if ( m_middleground )
{
*(cocos2d::ccColor3B *)&v16 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1013);
LOWORD(v31) = v16;
BYTE2(v31) = BYTE2(v16);
GJMGLayer::updateGroundColor(m_middleground, (cocos2d::ccColor3B)v31, 1);
v17 = a1->m_middleground;
*(cocos2d::ccColor3B *)&v18 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1014);
LOWORD(v32) = v18;
BYTE2(v32) = BYTE2(v18);
GJMGLayer::updateGroundColor(v17, (cocos2d::ccColor3B)v32, 0);
v19 = a1->m_middleground;
v20 = GJEffectManager::activeOpacityForIndex(a1->m_effectManager, 1013);
GJMGLayer::updateGroundOpacity(v19, (unsigned int)(float)(v20 * 255.0), 1);
v21 = a1->m_middleground;
*(_DWORD *)v27 = (unsigned int)(float)(GJEffectManager::activeOpacityForIndex(a1->m_effectManager, 1014) * 255.0);
GJMGLayer::updateGroundOpacity(v21, v27[0], 0);
v22 = a1->m_middleground;
v23 = GJEffectManager::shouldBlend(a1->m_effectManager, 1013);
GJMGLayer::updateMG01Blend(v22, v23);
v24 = a1->m_middleground;
v25 = GJEffectManager::shouldBlend(a1->m_effectManager, 1014);
GJMGLayer::updateMG02Blend(v24, v25);
}
}