//
// GJBaseGameLayer::spawnObjectsInOrder from 0x85b7c8 to 0x85b93c (372 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::spawnGroup @ 0x874b38
// > ??> @ 0x4bdc8
//
// 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::spawnObjectsInOrder(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
double a3,
std::vector *const a4,
int a5,
int a6)
{
float *v6; // x23
cocos2d::ccArray *data; // x1
cocos2d::CCObject **arr; // x20
__int64 v9; // x24
char *v10; // x21
cocos2d::CCObject *v11; // x19
float v15; // s8
int v18; // w27
int isSpawnableTrigger; // w0
void (__fastcall *acceptVisitor)(cocos2d::CCObject *__hidden, cocos2d::CCDataVisitor *); // x1
float v21; // s0
v6 = &a1->m_varianceValues.__elems_[1975];
if ( a1->m_spawnAbuse < (unsigned int)(a2 != nullptr) )
{
data = a2->data;
if ( data->num )
{
arr = data->arr;
v9 = 8LL * data->num - 8;
v10 = (char *)arr + v9;
if ( arr <= (cocos2d::CCObject **)((char *)arr + v9) )
{
v11 = *arr;
if ( *arr )
{
v15 = 0.0;
v18 = 0;
while ( 1 )
{
if ( LODWORD(v11[22].__vftable) == 1 )
{
isSpawnableTrigger = GameObject::isSpawnableTrigger((GameObject *)v11);
}
else
{
if ( HIDWORD(v11[18].__vftable) != 2065 )
goto LABEL_8;
isSpawnableTrigger = BYTE1(v11[25].__vftable);
}
if ( isSpawnableTrigger )
{
acceptVisitor = v11->__vftable[2].acceptVisitor;
if ( !v18 )
{
v15 = *(float *)((__int64 (__fastcall *)(cocos2d::CCObject *))acceptVisitor)(v11);
goto LABEL_15;
}
v21 = (float)(*(float *)((__int64 (__fastcall *)(cocos2d::CCObject *))acceptVisitor)(v11) - v15)
/ 311.580109
- a3;
if ( v21 <= 0.0 )
LABEL_15:
((void (__fastcall *)(GJBaseGameLayer *, cocos2d::CCObject *, std::vector *const, double))a1->spawnObject)(
a1,
v11,
a4,
0.0);
else
GJEffectManager::spawnObject(a1->m_effectManager, (GameObject *)v11, v21, a4, a5, a6);
if ( *((_BYTE *)v6 + 1112) )
return;
v18 = 1;
}
LABEL_8:
if ( v10 >= (char *)++arr )
{
v11 = *arr;
if ( *arr )
continue;
}
return;
}
}
}
}
}
}