//
// ParticleGameObject::addMainSpriteToParent from 0x4e65f4 to 0x4e6678 (132 bytes)
//
// 0 xrefs:
//
// 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:51:05 +0000
//
int __fastcall ParticleGameObject::addMainSpriteToParent(GJSpriteColor **this, int a2)
{
int result; // r0
int ObjectZLayer; // r0
int v6; // r6
int v7; // r5
int v8; // r7
int (__fastcall *v9)(int, int, int); // r5
int v10; // r0
int v11; // r7
int (__fastcall *v12)(int, int, int); // r6
int ObjectZOrder; // r2
result = GameObject::addMainSpriteToParent(this, a2);
if ( *(this + 165) )
{
ObjectZLayer = GameObject::getObjectZLayer((GameObject *)this);
v6 = GameObject::parentForZLayer((GameObject *)this, ObjectZLayer, 0, 4);
result = (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 165) + 256))(*(this + 165));
v7 = result;
if ( result == v6 )
{
if ( a2 )
{
v11 = (int)*(this + 165);
v12 = *(int (__fastcall **)(int, int, int))(*(_DWORD *)result + 296);
ObjectZOrder = GameObject::getObjectZOrder((GameObject *)this);
return v12(v7, v11, ObjectZOrder);
}
}
else
{
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 165) + 264))(*(this + 165), 0);
v8 = (int)*(this + 165);
v9 = *(int (__fastcall **)(int, int, int))(*(_DWORD *)v6 + 232);
v10 = GameObject::getObjectZOrder((GameObject *)this);
return v9(v6, v8, v10);
}
}
return result;
}