//
// GameObject::addColorSpriteToParent from 0x44d974 to 0x44daba (326 bytes)
//
// 3 xrefs:
// > PlayLayer::updateVisibility @ 0x406f80
// > GameObject::activateObject @ 0x44db22
// > LevelEditorLayer::updateVisibility @ 0x462f8c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:48:35 +0000
//
GameObject *__fastcall GameObject::addColorSpriteToParent(GameObject *this, int a2)
{
GameObject *v2; // r4
int v4; // r7
int ObjectZLayer; // r0
int v6; // r5
_DWORD *v7; // r6
void (__fastcall *v8)(_DWORD *, int); // r9
int v9; // r0
_DWORD *v10; // r6
void (__fastcall *v11)(_DWORD *, int); // r9
int v12; // r0
_DWORD *v13; // r6
void (__fastcall *v14)(_DWORD *, int); // r9
int v15; // r0
_DWORD *v16; // r6
void (__fastcall *v17)(_DWORD *, int); // r9
int v18; // r0
int ParentMode; // r0
int v20; // r6
GameObject *v21; // r5
_DWORD *v22; // r8
int (__fastcall *v23)(int, _DWORD *, int); // r5
int v24; // r0
_DWORD *v25; // r5
int (__fastcall *v26)(_DWORD *, int); // r6
int v27; // r0
_DWORD *v28; // r7
int (__fastcall *v29)(GameObject *, _DWORD *, int); // r6
int ObjectZOrder; // r0
v2 = this;
if ( *((_DWORD *)this + 189) && !*((_BYTE *)this + 552) )
{
if ( *((unsigned __int8 *)this + 752) == *((unsigned __int8 *)this + 753) )
{
return GameObject::addColorSpriteToSelf(this);
}
else
{
v4 = *((unsigned __int8 *)this + 734);
*((_BYTE *)this + 734) = 0;
ObjectZLayer = GameObject::getObjectZLayer(this);
v6 = ObjectZLayer;
if ( *((_BYTE *)v2 + 753) && *((_BYTE *)v2 + 917) )
v6 = ObjectZLayer + 1;
v7 = *((_DWORD **)v2 + 189);
v8 = *(void (__fastcall **)(_DWORD *, int))(*v7 + 64);
v9 = (*(int (__fastcall **)(GameObject *))(*(_DWORD *)v2 + 68))(v2);
v8(v7, v9);
v10 = *((_DWORD **)v2 + 189);
v11 = *(void (__fastcall **)(_DWORD *, int))(*v10 + 72);
v12 = (*(int (__fastcall **)(GameObject *))(*(_DWORD *)v2 + 76))(v2);
v11(v10, v12);
v13 = *((_DWORD **)v2 + 189);
v14 = *(void (__fastcall **)(_DWORD *, int))(*v13 + 188);
v15 = (*(int (__fastcall **)(GameObject *))(*(_DWORD *)v2 + 192))(v2);
v14(v13, v15);
v16 = *((_DWORD **)v2 + 189);
v17 = *(void (__fastcall **)(_DWORD *, int))(*v16 + 196);
v18 = (*(int (__fastcall **)(GameObject *))(*(_DWORD *)v2 + 200))(v2);
v17(v16, v18);
LOBYTE(v16) = *((_BYTE *)v2 + 753);
ParentMode = GameObject::getParentMode(v2);
v20 = GameObject::parentForZLayer(v2, v6, (bool)v16, ParentMode);
this = (GameObject *)(*(int (__fastcall **)(_DWORD *))(**((_DWORD **)v2 + 189) + 256))(*((_DWORD **)v2 + 189));
v21 = this;
if ( this == (GameObject *)v20 )
{
if ( a2 )
{
v28 = *((_DWORD **)v2 + 189);
v29 = *(int (__fastcall **)(GameObject *, _DWORD *, int))(*(_DWORD *)this + 296);
ObjectZOrder = GameObject::getObjectZOrder(v2);
return (GameObject *)v29(v21, v28, ObjectZOrder);
}
}
else
{
(*(void (__fastcall **)(_DWORD *, _DWORD))(**((_DWORD **)v2 + 189) + 264))(*((_DWORD **)v2 + 189), 0);
v22 = *((_DWORD **)v2 + 189);
v23 = *(int (__fastcall **)(int, _DWORD *, int))(*(_DWORD *)v20 + 232);
v24 = GameObject::getObjectZOrder(v2);
this = (GameObject *)v23(v20, v22, v24);
if ( v4 )
{
v25 = *((_DWORD **)v2 + 189);
v26 = *(int (__fastcall **)(_DWORD *, int))(*v25 + 92);
v27 = (*(int (__fastcall **)(GameObject *))(*(_DWORD *)v2 + 96))(v2);
return (GameObject *)v26(v25, v27);
}
}
}
}
return this;
}