//
// GJBaseGameLayer::orderSpawnObjects from 0x8697dc to 0x8698b4 (216 bytes)
//
// 3 xrefs:
// > PlayLayer::createObjectsFromSetupFinished @ 0x5d7d74
// > LevelEditorLayer::onPlaytest @ 0x6642fc
// > ??> @ 0x8c0d0
//
// 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; // x0
cocos2d::ccArray *data; // x2
cocos2d::CCObject **arr; // x20
cocos2d::CCObject **v5; // x22
cocos2d::CCObject *v6; // x19
float v7; // s0
float v8; // s1
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 - 1];
if ( arr <= v5 )
{
v6 = *arr;
if ( *arr )
{
do
{
++arr;
v7 = ((float (__fastcall *)(cocos2d::CCObject *))v6->__vftable[22].update)(v6);
cocos2d::CCPoint::operator=(&v6[31].m_uIndexInArray, v7, v8);
if ( v5 < arr )
break;
v6 = *arr;
}
while ( *arr );
m_spawnObjectsArray = a1->m_spawnObjectsArray;
}
}
}
}
LevelTools::sortChannelOrderObjects(m_spawnObjectsArray, a1->m_spawnObjects, 0);
}