//
// SetGroupIDLayer::onZLayerShift from 0x1403fcdc0 to 0x1403fce81 (193 bytes)
//
// 5 xrefs:
// > SetGroupIDLayer::init @ 0x1403f99be
// > ??> @ 0x14069e4e4
// > ??> @ 0x14069e518
// > ??> @ 0x1406d84f8
// > ??> @ 0x1406d8504
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void SetGroupIDLayer::onZLayerShift(SetGroupIDLayer *a1, cocos2d::CCObject *a2)
{
int v3; // eax
cocos2d::CCArray *m_targetObjects; // rcx
int v5; // ebp
unsigned int v6; // ebx
int v7; // esi
struct cocos2d::CCObject *v8; // rax
int m_nLuaID; // ecx
int v10; // ecx
v3 = a2->getTag(a2);
m_targetObjects = a1->m_targetObjects;
v5 = v3;
if ( m_targetObjects )
{
v6 = 0;
if ( cocos2d::CCArray::count(m_targetObjects) )
{
v7 = -2;
if ( v5 == 1 )
v7 = 2;
do
{
v8 = cocos2d::CCArray::objectAtIndex(a1->m_targetObjects, v6);
m_nLuaID = v8[20].m_nLuaID;
if ( !m_nLuaID )
m_nLuaID = HIDWORD(v8[20].__vftable);
v10 = v7 + m_nLuaID;
if ( v10 >= -5 )
{
if ( v10 > 11 )
v10 = 11;
}
else
{
v10 = -5;
}
if ( !LOBYTE(v8[20].m_uID) )
v8[20].m_nLuaID = v10;
LOBYTE(v8[20].m_uUnknown) = 1;
++v6;
}
while ( v6 < cocos2d::CCArray::count(a1->m_targetObjects) );
}
}
}