//
// GameObject::addToColorGroup from 0x10068fe10 to 0x10068fea7 (151 bytes)
//
// 2 xrefs:
// > sub_10007BFE0 @ 0x10007c15e
// > GJBaseGameLayer::calculateColorGroups @ 0x1000fa21e
//
// 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:35:07 +0000
//
char __fastcall GameObject::addToColorGroup(__int64 a1, int a2)
{
__int64 v2; // r14
_DWORD *v3; // rax
__int64 v4; // rcx
v2 = *(__int16 *)(a1 + 1184);
LOBYTE(v3) = v2 >= 10;
if ( v2 < 10 && (unsigned int)(a2 - 10000) >= 0xFFFFD8F1 )
{
v3 = *(_DWORD **)(a1 + 1176);
if ( v3 )
{
if ( (__int16)v2 <= 0 )
goto LABEL_9;
}
else
{
v3 = operator new[](0x14u);
*(_QWORD *)(a1 + 1176) = v3;
*(_OWORD *)v3 = 0;
v3[4] = 0;
if ( (__int16)v2 <= 0 )
{
LABEL_9:
*((_WORD *)v3 + v2) = a2;
++*(_WORD *)(a1 + 1184);
return (char)v3;
}
}
v4 = 0;
while ( *((__int16 *)v3 + v4) != a2 )
{
if ( v2 == ++v4 )
goto LABEL_9;
}
}
return (char)v3;
}