//
// GJBaseGameLayer::spawnObjectsInOrder from 0x14021ae00 to 0x14021b024 (548 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::spawnGroup @ 0x14021ad8a
// > ??> @ 0x1406cd3a4
//
// 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
//
// Hidden C++ exception states: #wind=1
void GJBaseGameLayer::spawnObjectsInOrder(
GJBaseGameLayer *a1,
cocos2d::CCArray *a2,
double a3,
std::vector *const a4,
int a5,
int a6)
{
float v8; // xmm6_4
char v9; // r15
cocos2d::ccArray *data; // rsi
__int64 num; // rax
GameObject **arr; // rsi
GameObject **i; // r12
GameObject *v14; // rbx
bool v15; // zf
float *v16; // rax
__int64 v17; // r8
float v18; // xmm0_4
GJEffectManager *m_effectManager; // rbp
std::_Vector_val>::pointer Mylast; // rdi
int v21; // [rsp+40h] [rbp-88h] BYREF
float v22; // [rsp+48h] [rbp-80h] BYREF
GameObject *v23; // [rsp+50h] [rbp-78h] BYREF
std::_Vector_val>::pointer v24; // [rsp+D8h] [rbp+10h] BYREF
if ( a2 )
{
v8 = 0.0;
v9 = 0;
data = a2->data;
num = data->num;
if ( (_DWORD)num )
{
arr = (GameObject **)data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
v14 = *arr;
if ( !*arr )
return;
if ( v14->m_classType == Effect )
{
v15 = !GameObject::isSpawnableTrigger(*arr);
}
else
{
if ( v14->m_objectID != 2065 )
continue;
v15 = BYTE1(v14[1].m_fVertexZ) == 0;
}
if ( !v15 )
{
v16 = (float *)v14->getPosition_0(v14);
if ( v9 )
{
v18 = (float)(*v16 - v8) / 311.5801086425781 - a3;
if ( v18 > 0.0 )
{
LODWORD(v24) = a6;
v21 = a5;
v22 = v18;
v23 = v14;
m_effectManager = a1->m_effectManager;
Mylast = m_effectManager->m_spawnTriggerActions._Mypair._Myval2._Mylast;
if ( Mylast == m_effectManager->m_spawnTriggerActions._Mypair._Myval2._Myend )
{
sub_14026C0C0(
(_DWORD)m_effectManager + 1448,
(_DWORD)Mylast,
(unsigned int)&v23,
(unsigned int)&v22,
(__int64)a4,
(__int64)&v21,
(__int64)&v24);
}
else
{
v24 = m_effectManager->m_spawnTriggerActions._Mypair._Myval2._Mylast;
*(_WORD *)&Mylast->m_finished = 0;
Mylast->m_deltaTime = 0.0;
*(_QWORD *)&Mylast->m_targetGroupID = 0;
Mylast->m_controlID = 0;
Mylast->m_spawnOrdered = 0;
Mylast->m_remapKeys._Mypair._Myval2._Myfirst = nullptr;
Mylast->m_remapKeys._Mypair._Myval2._Mylast = nullptr;
Mylast->m_remapKeys._Mypair._Myval2._Myend = nullptr;
Mylast->m_gameObject = v14;
Mylast->m_duration = v18;
sub_1400846D0((void **)&Mylast->m_remapKeys._Mypair._Myval2._Myfirst, (char **)a4);
Mylast->m_triggerUniqueID = a5;
Mylast->m_controlID = a6;
++m_effectManager->m_spawnTriggerActions._Mypair._Myval2._Mylast;
}
continue;
}
}
else
{
v8 = *v16;
v9 = 1;
}
((void (__fastcall *)(TriggerEffectDelegate *, GameObject *, __int64, std::vector *const))a1->spawnObject)(
&a1->TriggerEffectDelegate,
v14,
v17,
a4);
}
}
}
}
}