//
// GJEffectManager::calculateLightBGColor from 0xa19b88 to 0xa19ca8 (288 bytes)
//
// 6 xrefs:
// > PlayLayer::updateVisibility @ 0x700d7c
// > LevelEditorLayer::transferDefaultColors @ 0x78c570
// > LevelEditorLayer::updateVisibility @ 0x78e2c8
// > LevelEditorLayer::postUpdate @ 0x79afe4
// > LevelEditorLayer::updateGameObjects @ 0x79ea1c
// > ??> @ 0xe64d0
//
// This function is hookable on this platform (idp: arm, 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:59:36 +0000
//
__int64 __fastcall GJEffectManager::calculateLightBGColor(GJEffectManager *a1, int a2)
{
unsigned __int64 active; // x0
int v4; // w0
float v5; // s0
int MixedColor; // w0
cocos2d::CCObject *ColorSprite; // x0
char *v8; // x0
__int16 v11; // [xsp+38h] [xbp+38h] BYREF
unsigned __int8 v12; // [xsp+3Ah] [xbp+3Ah]
__int64 v13; // [xsp+40h] [xbp+40h]
active = GJEffectManager::activeColorForIndex(a1, 1000);
v11 = active;
v12 = BYTE2(active);
v4 = GameToolbox::transformColor((unsigned __int8 *)&v11, 0.0, -0.2, 0.2);
LOWORD(v13) = v4;
v5 = (float)((unsigned __int8)v11 + HIBYTE(v11) + v12);
BYTE2(v13) = BYTE2(v4);
if ( v5 < 150.0 )
{
MixedColor = GJEffectManager::getMixedColor(v13, a2, v5 / 150.0);
LOWORD(v13) = MixedColor;
BYTE2(v13) = BYTE2(MixedColor);
}
ColorSprite = GJEffectManager::getColorSprite(a1, 1007);
*((_WORD *)ColorSprite + 160) = v13;
*((_BYTE *)ColorSprite + 322) = BYTE2(v13);
v8 = (char *)GJEffectManager::getColorSprite(a1, 1007) + 323;
*(_WORD *)v8 = v13;
v8[2] = BYTE2(v13);
return _stack_chk_guard;
}