//
// GJBaseGameLayer::updateLevelColors from 0x1000f08a0 to 0x1000f0b4c (684 bytes)
//
// 12 xrefs:
// > PlayLayer::setupHasCompleted @ 0x10007bb97
// > PlayLayer::setupHasCompleted @ 0x10007becd
// > PlayLayer::postUpdate @ 0x100088b91
// > PlayLayer::resetLevel @ 0x10008d061
// > LevelEditorLayer::updateGameObjects @ 0x1000ad874
// > LevelEditorLayer::onPlaytest @ 0x1000c6136
// > LevelEditorLayer::postUpdate @ 0x1000c7446
// > GJBaseGameLayer::swapBackground @ 0x1000f085e
// > GJBaseGameLayer::asyncBGLoaded @ 0x1000f0897
// > GJBaseGameLayer::asyncGLoaded @ 0x1000f0ba9
// > GJBaseGameLayer::swapMiddleground @ 0x1000f0d77
// > GJBaseGameLayer::asyncMGLoaded @ 0x1000f0ee7
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:21:11 +0000
//
__int64 __fastcall GJBaseGameLayer::updateLevelColors(__int64 a1, double a2)
{
int active; // eax
unsigned int v3; // r14d
unsigned int v4; // r14d
__int64 v5; // rax
__int64 v6; // r14
unsigned __int8 shouldBlend; // al
__int64 v8; // r14
unsigned __int8 v9; // al
__int64 result; // rax
__int64 v11; // r14
unsigned int v12; // eax
__int64 v13; // r14
unsigned int v14; // eax
__int64 v15; // r14
float v16; // xmm0_4
double updated; // xmm0_8
__int64 v18; // r14
double v19; // xmm0_8
__int64 v20; // r14
unsigned __int8 v21; // al
__int64 v22; // r14
unsigned __int8 v23; // al
__int16 v24; // [rsp+8h] [rbp-18h] BYREF
char v25; // [rsp+Ah] [rbp-16h]
__int16 v26; // [rsp+Ch] [rbp-14h] BYREF
char v27; // [rsp+Eh] [rbp-12h]
active = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), 1000);
v24 = active;
v25 = BYTE2(active);
(*(void (__fastcall **)(_QWORD, __int16 *))(**(_QWORD **)(a1 + 3944) + 960LL))(*(_QWORD *)(a1 + 3944), &v24);
v3 = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), 1001);
GJGroundLayer::updateGround01Color(*(_QWORD *)(a1 + 3960), v3);
GJGroundLayer::updateGround01Color(*(_QWORD *)(a1 + 3968), v3);
if ( *(_QWORD *)(*(_QWORD *)(a1 + 3960) + 416LL) )
{
v4 = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), 1009);
GJGroundLayer::updateGround02Color(*(_QWORD *)(a1 + 3960), v4);
GJGroundLayer::updateGround02Color(*(_QWORD *)(a1 + 3968), v4);
}
v5 = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), 1002);
v26 = v5;
v27 = BYTE2(v5);
*(float *)&a2 = GJEffectManager::activeOpacityForIndex(*(_QWORD *)(a1 + 2152), 1002, a2) * 255.0;
(*(void (__fastcall **)(_QWORD, __int16 *))(**(_QWORD **)(*(_QWORD *)(a1 + 3960) + 432LL) + 960LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 3960) + 432LL),
&v26);
(*(void (__fastcall **)(_QWORD, __int16 *))(**(_QWORD **)(*(_QWORD *)(a1 + 3968) + 432LL) + 960LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 3968) + 432LL),
&v26);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 3960) + 432LL) + 912LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 3960) + 432LL),
(unsigned __int8)(int)*(float *)&a2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 3968) + 432LL) + 912LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 3968) + 432LL),
(unsigned __int8)(int)*(float *)&a2);
v6 = *(_QWORD *)(a1 + 3960);
shouldBlend = GJEffectManager::shouldBlend(*(_QWORD *)(a1 + 2152));
GJGroundLayer::updateLineBlend(v6, shouldBlend);
v8 = *(_QWORD *)(a1 + 3968);
v9 = GJEffectManager::shouldBlend(*(_QWORD *)(a1 + 2152));
result = GJGroundLayer::updateLineBlend(v8, v9);
v11 = *(_QWORD *)(a1 + 3976);
if ( v11 )
{
v12 = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), 1013);
GJMGLayer::updateGroundColor(v11, v12, 1);
v13 = *(_QWORD *)(a1 + 3976);
v14 = GJEffectManager::activeColorForIndex(*(_QWORD *)(a1 + 2152), 1014);
GJMGLayer::updateGroundColor(v13, v14, 0);
v15 = *(_QWORD *)(a1 + 3976);
v16 = GJEffectManager::activeOpacityForIndex(*(_QWORD *)(a1 + 2152), 1013, a2);
updated = GJMGLayer::updateGroundOpacity(v15, (unsigned __int8)(int)(float)(v16 * 255.0), 1);
v18 = *(_QWORD *)(a1 + 3976);
*(float *)&updated = GJEffectManager::activeOpacityForIndex(*(_QWORD *)(a1 + 2152), 1014, updated);
v19 = GJMGLayer::updateGroundOpacity(v18, (unsigned __int8)(int)(float)(*(float *)&updated * 255.0), 0);
v20 = *(_QWORD *)(a1 + 3976);
v21 = GJEffectManager::shouldBlend(*(_QWORD *)(a1 + 2152));
GJMGLayer::updateMG01Blend(v20, v21, v19);
v22 = *(_QWORD *)(a1 + 3976);
v23 = GJEffectManager::shouldBlend(*(_QWORD *)(a1 + 2152));
return GJMGLayer::updateMG02Blend(v22, v23);
}
return result;
}