//
// GJBaseGameLayer::orderSpawnObjects from 0x478fd8 to 0x47905c (132 bytes)
//
// 2 xrefs:
// > PlayLayer::createObjectsFromSetupFinished @ 0x31ad18
// > LevelEditorLayer::onPlaytest @ 0x36eb72
//
// 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 GJBaseGameLayer::orderSpawnObjects(GJBaseGameLayer *a1)
{
cocos2d::CCArray *m_spawnObjectsArray; // r3
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r5
cocos2d::CCObject **v5; // r4
int v6; // r6
int v7; // t1
int v8; // r2
bool v9; // r3
_BYTE v10[8]; // [sp+4h] [bp-10h] BYREF
cocos2d::CCDictionary::removeAllObjects(a1->m_spawnObjects);
m_spawnObjectsArray = a1->m_spawnObjectsArray;
if ( m_spawnObjectsArray )
{
data = m_spawnObjectsArray->data;
if ( data->num )
{
arr = data->arr;
v5 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v5 )
{
v7 = (int)*arr++;
v6 = v7;
if ( !v7 )
break;
(*(void (__fastcall **)(_BYTE *, int))(*(_DWORD *)v6 + 900))(v10, v6);
cocos2d::CCPoint::operator=((PlayerObject *)(v6 + 1592), COERCE_FLOAT(v10), v8, v9);
}
}
}
LevelTools::sortChannelOrderObjects(a1->m_spawnObjectsArray, a1->m_spawnObjects, 0);
}