//
// CharacterColorPage::activeColorForMode from 0x1400a1d20 to 0x1400a1e2f (271 bytes)
//
// 2 xrefs:
// > CharacterColorPage::onPlayerColor @ 0x1400a2702
// > ??> @ 0x1409130c4
//
// 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:26:07 +0000
//
// Hidden C++ exception states: #wind=3
__int64 __fastcall CharacterColorPage::activeColorForMode(__int64 a1, int a2)
{
int v2; // edx
__int64 v4; // rcx
__int64 v5; // rcx
__int64 v6; // rcx
void *v7; // [rsp+30h] [rbp+8h]
void *v8; // [rsp+30h] [rbp+8h]
void *v9; // [rsp+30h] [rbp+8h]
if ( a2 )
{
v2 = a2 - 1;
if ( v2 )
{
if ( v2 == 1 )
{
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v7 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
return (unsigned int)(*(_DWORD *)(v4 + 868) - *(_DWORD *)(v4 + 872));
}
else
{
return 0;
}
}
else
{
v5 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v8 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v5 = qword_14090BFD0;
}
return (unsigned int)(*(_DWORD *)(v5 + 856) - *(_DWORD *)(v5 + 860));
}
}
else
{
v6 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v9 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v6 = qword_14090BFD0;
}
return (unsigned int)(*(_DWORD *)(v6 + 844) - *(_DWORD *)(v6 + 848));
}
}