//
// GJBaseGameLayer::updateLevelColors from 0x1001dde68 to 0x1001de0b4 (588 bytes)
//
// 13 xrefs:
// > PlayLayer::setupHasCompleted @ 0x100117084
// > PlayLayer::setupHasCompleted @ 0x100117338
// > PlayLayer::postUpdate @ 0x10011f694
// > PlayLayer::resetLevel @ 0x1001221bc
// > PlayLayer::resetLevel @ 0x10012221c
// > GJBaseGameLayer::swapBackground @ 0x1001dde2c
// > GJBaseGameLayer::asyncBGLoaded @ 0x1001dde64
// > GJBaseGameLayer::asyncGLoaded @ 0x1001de128
// > GJBaseGameLayer::swapMiddleground @ 0x1001de280
// > GJBaseGameLayer::asyncMGLoaded @ 0x1001de35c
// > LevelEditorLayer::updateGameObjects @ 0x100358dec
// > LevelEditorLayer::onPlaytest @ 0x100362f8c
// > LevelEditorLayer::postUpdate @ 0x1003636dc
//
// 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 GJBaseGameLayer::updateLevelColors(GJBaseGameLayer *a1)
{
int v2; // w0
int v3; // w20
int v4; // w0
int v5; // w20
float v6; // s8
GJGroundLayer *m_groundLayer; // x20
bool shouldBlend; // w0
GJGroundLayer *m_groundLayer2; // x20
bool v10; // w0
GJMGLayer *m_middleground; // x20
GJMGLayer *v12; // x20
GJMGLayer *v13; // x20
float v14; // s0
GJMGLayer *v15; // x20
float v16; // s0
GJMGLayer *v17; // x20
bool v18; // w0
GJMGLayer *v19; // x20
bool v20; // w0
cocos2d::ccColor3B v21; // [xsp+8h] [xbp-28h] BYREF
cocos2d::ccColor3B v22; // [xsp+Ch] [xbp-24h] BYREF
cocos2d::ccColor3B v23; // 0:w0.3
cocos2d::ccColor3B v24; // 0:w0.3
v22 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1000);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor3B *))a1->m_background->setColor)(a1->m_background, &v22);
*(cocos2d::ccColor3B *)&v2 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1001);
v3 = v2;
GJGroundLayer::updateGround01Color(a1->m_groundLayer, (cocos2d::ccColor3B)(v2 & 0xFFFFFF));
GJGroundLayer::updateGround01Color(a1->m_groundLayer2, (cocos2d::ccColor3B)(v3 & 0xFFFFFF));
if ( a1->m_groundLayer->m_ground2Sprite )
{
*(cocos2d::ccColor3B *)&v4 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1009);
v5 = v4;
GJGroundLayer::updateGround02Color(a1->m_groundLayer, (cocos2d::ccColor3B)(v4 & 0xFFFFFF));
GJGroundLayer::updateGround02Color(a1->m_groundLayer2, (cocos2d::ccColor3B)(v5 & 0xFFFFFF));
}
v21 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1002);
v6 = GJEffectManager::activeOpacityForIndex(a1->m_effectManager, 1002) * 255.0;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor3B *))a1->m_groundLayer->m_lineSprite->setColor)(
a1->m_groundLayer->m_lineSprite,
&v21);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::ccColor3B *))a1->m_groundLayer2->m_lineSprite->setColor)(
a1->m_groundLayer2->m_lineSprite,
&v21);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_groundLayer->m_lineSprite->setOpacity)(
a1->m_groundLayer->m_lineSprite,
(unsigned int)(int)v6);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_groundLayer2->m_lineSprite->setOpacity)(
a1->m_groundLayer2->m_lineSprite,
(unsigned int)(int)v6);
m_groundLayer = a1->m_groundLayer;
shouldBlend = GJEffectManager::shouldBlend(a1->m_effectManager, 1002);
GJGroundLayer::updateLineBlend(m_groundLayer, shouldBlend);
m_groundLayer2 = a1->m_groundLayer2;
v10 = GJEffectManager::shouldBlend(a1->m_effectManager, 1002);
GJGroundLayer::updateLineBlend(m_groundLayer2, v10);
m_middleground = a1->m_middleground;
if ( m_middleground )
{
v23 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1013);
GJMGLayer::updateGroundColor(m_middleground, (cocos2d::ccColor3B)(*(_DWORD *)&v23.r & 0xFFFFFF), 1);
v12 = a1->m_middleground;
v24 = GJEffectManager::activeColorForIndex(a1->m_effectManager, 1014);
GJMGLayer::updateGroundColor(v12, (cocos2d::ccColor3B)(*(_DWORD *)&v24.r & 0xFFFFFF), 0);
v13 = a1->m_middleground;
v14 = GJEffectManager::activeOpacityForIndex(a1->m_effectManager, 1013);
GJMGLayer::updateGroundOpacity(v13, (int)(float)(v14 * 255.0), 1);
v15 = a1->m_middleground;
v16 = GJEffectManager::activeOpacityForIndex(a1->m_effectManager, 1014);
GJMGLayer::updateGroundOpacity(v15, (int)(float)(v16 * 255.0), 0);
v17 = a1->m_middleground;
v18 = GJEffectManager::shouldBlend(a1->m_effectManager, 1013);
GJMGLayer::updateMG01Blend(v17, v18);
v19 = a1->m_middleground;
v20 = GJEffectManager::shouldBlend(a1->m_effectManager, 1014);
GJMGLayer::updateMG02Blend(v19, v20);
}
}