//
// GameObject::colorForMode from 0x14029ef40 to 0x14029f06c (300 bytes)
//
// 7 xrefs:
// > PlayLayer::updateVisibility @ 0x14050e34d
// > PlayLayer::updateVisibility @ 0x14050e4a1
// > PlayLayer::updateVisibility @ 0x14050e64e
// > PlayLayer::updateVisibility @ 0x14050e6dd
// > PlayLayer::manualUpdateObjectColors @ 0x14050ee14
// > PlayLayer::manualUpdateObjectColors @ 0x14050ee34
// > ??> @ 0x14091d948
//
// 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 11:29:15 +0000
//
__int64 __fastcall GameObject::colorForMode(__int64 a1, int a2, char a3)
{
__int64 v3; // rdi
__int64 ActiveColorForMode; // rax
char v7; // al
bool v8; // cc
char v9; // r15
__int64 v10; // rsi
int v11; // ebp
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
char v15; // dl
float v17[10]; // [rsp+30h] [rbp-28h] BYREF
char v18; // [rsp+70h] [rbp+18h] BYREF
v3 = a1 + 641;
if ( a2 <= 0 )
{
*(_WORD *)v3 = -1;
v7 = -1;
}
else
{
ActiveColorForMode = GameObject::getActiveColorForMode();
*(_WORD *)v3 = *(_WORD *)ActiveColorForMode;
v7 = *(_BYTE *)(ActiveColorForMode + 2);
}
v8 = *(_WORD *)(a1 + 1192) <= 0;
*(_BYTE *)(v3 + 2) = v7;
if ( !v8 )
{
if ( a3 )
{
if ( !*(_BYTE *)(a1 + 1046) )
{
v9 = 1;
LABEL_8:
v10 = 0;
v11 = 0;
do
{
v12 = GJEffectManager::colorForGroupID(
*(_QWORD *)(a1 + 1288),
(unsigned int)&v18,
*(__int16 *)(v10 + *(_QWORD *)(a1 + 1184)),
v3,
v9);
++v11;
v10 += 2;
*(_WORD *)v3 = *(_WORD *)v12;
*(_BYTE *)(v3 + 2) = *(_BYTE *)(v12 + 2);
}
while ( v11 < *(__int16 *)(a1 + 1192) );
goto LABEL_10;
}
}
else if ( *(_DWORD *)(a1 + 664) == 1012 )
{
goto LABEL_15;
}
v9 = 0;
goto LABEL_8;
}
LABEL_10:
if ( a3 )
{
if ( *(_BYTE *)(a1 + 668) )
{
v13 = *(_QWORD *)(a1 + 1104);
LABEL_17:
*(_OWORD *)v17 = *(_OWORD *)(v13 + 16);
v14 = GameToolbox::transformColor((__int64)&v18, (unsigned __int16 *)v3, v17);
v15 = *(_BYTE *)(v14 + 2);
*(_WORD *)v3 = *(_WORD *)v14;
*(_BYTE *)(v3 + 2) = v15;
return v3;
}
return v3;
}
LABEL_15:
if ( *(_BYTE *)(a1 + 669) )
{
v13 = *(_QWORD *)(a1 + 1112);
goto LABEL_17;
}
return v3;
}