//
// GJEffectManager::updateColorEffects from 0x1002ca230 to 0x1002ca402 (466 bytes)
//
// 1 xrefs:
// > GJEffectManager::updateEffects @ 0x1002ca125
//
// 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:28:09 +0000
//
__int64 __fastcall GJEffectManager::updateColorEffects(__int64 a1, float a2)
{
__int64 result; // rax
__int64 v3; // rbx
int v4; // xmm1_4
__int64 v5; // r14
float v6; // xmm6_4
float v7; // xmm6_4
float v8; // xmm7_4
unsigned int v9; // eax
float v10; // [rsp-1Ch] [rbp-1Ch]
result = *(_QWORD *)(a1 + 328);
if ( result )
{
v3 = *(_QWORD *)(result + 56);
if ( v3 )
{
while ( 1 )
{
v5 = *(_QWORD *)(v3 + 264);
v3 = *(_QWORD *)(v3 + 288);
if ( *(_BYTE *)(v5 + 56) || *(_BYTE *)(v5 + 57) )
goto LABEL_7;
v6 = *(float *)(v5 + 68) + a2;
*(float *)(v5 + 68) = v6;
v7 = v6 + *(float *)(v5 + 164);
v8 = *(float *)(v5 + 80);
if ( v7 < v8 )
{
if ( v7 <= 0.0 )
goto LABEL_18;
if ( (float)(v7 / v8) < 1.0 )
break;
}
*(_BYTE *)(v5 + 60) = *(_BYTE *)(v5 + 77);
result = *(unsigned __int16 *)(v5 + 75);
*(_WORD *)(v5 + 58) = result;
v4 = *(_DWORD *)(v5 + 100);
LABEL_5:
*(_DWORD *)(v5 + 64) = v4;
LABEL_6:
*(_BYTE *)(v5 + 56) = v7 >= v8;
LABEL_7:
if ( *(_DWORD *)(v5 + 120) )
{
if ( !v3 )
return result;
}
else
{
result = *(_QWORD *)(v5 + 144);
*(_BYTE *)(result + 322) = *(_BYTE *)(v5 + 60);
*(_WORD *)(result + 320) = *(_WORD *)(v5 + 58);
*(float *)(result + 316) = *(float *)(v5 + 64) * 255.0;
if ( !v3 )
return result;
}
}
if ( (float)(v7 / v8) > 0.0 )
{
v10 = v7 / v8;
v9 = GameToolbox::multipliedColorValue(
*(unsigned __int16 *)(v5 + 72) | (*(unsigned __int8 *)(v5 + 74) << 16),
*(unsigned __int16 *)(v5 + 75) | (*(unsigned __int8 *)(v5 + 77) << 16));
*(_WORD *)(v5 + 58) = v9;
result = HIWORD(v9);
*(_BYTE *)(v5 + 60) = result;
v8 = *(float *)(v5 + 80);
*(float *)(v5 + 64) = (float)((float)(*(float *)(v5 + 100) - *(float *)(v5 + 96)) * v10) + *(float *)(v5 + 96);
goto LABEL_6;
}
LABEL_18:
*(_BYTE *)(v5 + 60) = *(_BYTE *)(v5 + 74);
result = *(unsigned __int16 *)(v5 + 72);
*(_WORD *)(v5 + 58) = result;
v4 = *(_DWORD *)(v5 + 96);
goto LABEL_5;
}
}
return result;
}