//
// SetGroupIDLayer::onZLayer from 0x1002ffc70 to 0x1002ffd8e (286 bytes)
//
// 1 xrefs:
// > SetGroupIDLayer::init @ 0x1002fddd3
//
// 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:28:32 +0000
//
__int64 __fastcall SetGroupIDLayer::onZLayer(__int64 a1, __int64 a2)
{
unsigned int v3; // eax
__int64 v4; // rdi
unsigned int v5; // r14d
__int64 v6; // r15
__int64 result; // rax
unsigned int v8; // r14d
__int64 v9; // r15
int v10; // r12d
const char *v11; // rsi
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
*(_DWORD *)(a1 + 788) = v3;
v4 = *(_QWORD *)(a1 + 672);
if ( v4 )
{
GameObject::setCustomZLayer(v4, v3);
*(_BYTE *)(*(_QWORD *)(a1 + 672) + 1148LL) = 1;
}
else if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 680)) )
{
v5 = 0;
do
{
v6 = sub_1007FEFE0(*(_QWORD *)(a1 + 680), v5);
GameObject::setCustomZLayer(v6, *(unsigned int *)(a1 + 788));
*(_BYTE *)(v6 + 1148) = 1;
++v5;
}
while ( v5 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 680)) );
}
result = sub_1007FEF90(*(_QWORD *)(a1 + 688));
if ( (_DWORD)result )
{
v8 = 0;
do
{
v9 = sub_1007FEFE0(*(_QWORD *)(a1 + 688), v8);
v10 = *(_DWORD *)(a1 + 788);
v11 = "GJ_button_04.png";
if ( v10 == (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v9 + 64LL))(v9) )
v11 = "GJ_button_02.png";
ButtonSprite::updateBGImage(v9, (__int64)v11);
++v8;
result = sub_1007FEF90(*(_QWORD *)(a1 + 688));
}
while ( v8 < (unsigned int)result );
}
return result;
}