//
// GameObject::saveActiveColors from 0x771ea8 to 0x771fcc (292 bytes)
//
// 7 xrefs:
// > EnhancedGameObject::saveActiveColors @ 0x771fdc
// > ??> @ 0xdc9c0
// > ??> @ 0x14338f0
// > ??> @ 0x14346e0
// > ??> @ 0x14356d0
// > ??> @ 0x14472a0
// > ??> @ 0x1459520
//
// 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:53:13 +0000
//
__int64 __fastcall GameObject::saveActiveColors(GameObject *this)
{
int SecondaryColorMode; // w0
int v3; // w1
int v4; // w2
int v5; // w1
__int64 v6; // x2
__int64 v7; // x0
GameManager *v8; // x0
int v9; // w1
__int64 result; // x0
*((_DWORD *)this + 231) = *((_DWORD *)this + 230);
*((_DWORD *)this + 164) = GameObject::getMainColorMode(this);
SecondaryColorMode = GameObject::getSecondaryColorMode(this);
v3 = *((_DWORD *)this + 164);
v4 = 1101;
if ( v3 <= 1100 )
{
if ( v3 < 0 )
v4 = 0;
else
v4 = *((_DWORD *)this + 164);
}
*((_DWORD *)this + 164) = v4;
v5 = 1101;
if ( SecondaryColorMode <= 1100 )
{
if ( SecondaryColorMode < 0 )
v5 = 0;
else
v5 = SecondaryColorMode;
}
v6 = *((_QWORD *)this + 137);
*((_DWORD *)this + 165) = v5;
v7 = *((_QWORD *)this + 138);
*((_BYTE *)this + 664) = *(_BYTE *)(v6 + 32);
if ( v7 )
v8 = (GameManager *)*(unsigned __int8 *)(v7 + 32);
else
v8 = nullptr;
*((_BYTE *)this + 665) = (_BYTE)v8;
if ( !*(_BYTE *)(GameManager::sharedState(v8) + 706) )
{
GameObject::setupColorSprite(this, *((_DWORD *)this + 164), 1);
GameObject::setupColorSprite(this, *((_DWORD *)this + 165), 0);
}
if ( *((_BYTE *)this + 1042) )
*((_BYTE *)this + 1034) = 1;
if ( *((_BYTE *)this + 1043) )
*((_BYTE *)this + 1035) = 1;
if ( *((_BYTE *)this + 1214) )
*((_DWORD *)this + 230) = 7;
*((_BYTE *)this + 868) = GameObject::canRotateFree(this);
v9 = *((unsigned __int8 *)this + 1294);
result = *((_DWORD *)this + 230) == 7;
*((_BYTE *)this + 1289) = result;
*((_BYTE *)this + 1290) = result;
if ( v9 )
{
result = *((unsigned __int8 *)this + 649);
if ( !*((_BYTE *)this + 649) )
{
result = 1;
*((_BYTE *)this + 999) = 1;
}
}
return result;
}