//
// LevelEditorLayer::spawnGroupPreview from 0x1403fc9d0 to 0x1403fcdca (1018 bytes)
//
// 6 xrefs:
// > LevelEditorLayer::updateGameObjects @ 0x1403fb448
// > LevelEditorLayer::activateTriggerEffect @ 0x1403fbdf9
// > ??> @ 0x1408c6518
// > ??> @ 0x1408c65b4
// > ??> @ 0x1408c65e4
// > ??> @ 0x140925748
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:31:53 +0000
//
void __fastcall LevelEditorLayer::spawnGroupPreview(
_QWORD *a1,
int a2,
__int64 a3,
float a4,
float a5,
float a6,
float a7,
char a8,
char a9)
{
unsigned __int64 v9; // r9
int v10; // eax
__int64 v12; // rdx
unsigned int v13; // ecx
int v14; // eax
__int64 v15; // rax
unsigned __int64 v16; // rdi
cocos2d::CCArray *TriggerGroup; // rax
int v18; // r9d
unsigned __int64 v19; // rsi
char v20; // di
unsigned __int64 v21; // rsi
cocos2d::CCArray *v22; // r14
char v23; // r15
float v24; // xmm7_4
unsigned int *v25; // rdi
__int64 v26; // rax
__int64 *v27; // rdi
__int64 *i; // r14
__int64 v29; // rbx
float *v30; // rax
int v31; // r9d
double v32; // xmm2_8
char v33; // al
double v34; // xmm1_8
int v35; // esi
unsigned int *v36; // rdi
__int64 v37; // rax
__int64 *v38; // rdi
__int64 *j; // r14
__int64 v40; // rbx
char v41; // al
if ( a2 > 0 )
{
v9 = a2;
v10 = 9999;
if ( a2 <= 9999 )
v10 = a2;
v12 = *(_QWORD *)(a1[301] + 1280LL);
v13 = v10 & 0x1F;
v14 = *(_DWORD *)(v12 + 4 * ((unsigned __int64)v10 >> 5));
if ( _bittest(&v14, v13) )
{
if ( a4 <= a6 )
{
v15 = a1[1921];
v16 = v9;
if ( *(float *)(v15 + 4 * v9) < a4 )
{
*(float *)(v15 + 4 * v9) = a4;
TriggerGroup = (cocos2d::CCArray *)LevelEditorLayer::getTriggerGroup(a1, (unsigned int)v9);
v19 = v16;
v20 = v16 & 0x1F;
v21 = v19 >> 5;
v22 = TriggerGroup;
if ( ((1 << v20) & *(_DWORD *)(a1[1893] + 4 * v21)) == 0 )
{
if ( cocos2d::CCArray::count(TriggerGroup) > 1 )
qsort(
*(void **)(*((_QWORD *)v22 + 7) + 16LL),
**((unsigned int **)v22 + 7),
8u,
(_CoreCrtNonSecureSearchSortCompareFunction)sub_14030B1E0);
*(_DWORD *)(a1[1893] + 4 * v21) |= 1 << v20;
}
if ( a8 )
{
v23 = 0;
v24 = 0.0;
if ( v22 )
{
v25 = *((unsigned int **)v22 + 7);
v26 = *v25;
if ( (_DWORD)v26 )
{
v27 = *((__int64 **)v25 + 2);
for ( i = &v27[v26 - 1]; v27 <= i; ++v27 )
{
v29 = *v27;
if ( !*v27 )
return;
if ( *(_BYTE *)(v29 + 1260)
&& *(_BYTE *)(v29 + 1489)
&& (*(_BYTE *)(v29 + 1680) || !*(_BYTE *)(v29 + 1460)) )
{
v30 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v29 + 200LL))(*v27);
if ( v23 )
{
v32 = (float)((float)(*v30 - v24) / 311.58011);
if ( v32 != 0.0 )
{
v34 = a4 + v32;
if ( a6 >= v34 )
LevelEditorLayer::addDelayedSpawn((__int64)a1, v29, v34);
continue;
}
}
else
{
v24 = *v30;
v23 = 1;
}
*(float *)(v29 + 1824) = a4;
*(_DWORD *)(v29 + 1676) = 0;
v33 = a9 && a4 > *(float *)(a1[1868] + 504LL);
LevelEditorLayer::activateTriggerEffect((__int64)a1, v29, a5, v31, a7, v33);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v29 + 1336LL))(v29);
}
}
}
}
}
else
{
v35 = 0;
if ( v22 )
{
v36 = *((unsigned int **)v22 + 7);
v37 = *v36;
if ( (_DWORD)v37 )
{
v38 = *((__int64 **)v36 + 2);
for ( j = &v38[v37 - 1]; v38 <= j; ++v38 )
{
v40 = *v38;
if ( !*v38 )
break;
if ( *(_BYTE *)(v40 + 1260)
&& *(_BYTE *)(v40 + 1489)
&& (*(_BYTE *)(v40 + 1680) || !*(_BYTE *)(v40 + 1460)) )
{
*(_DWORD *)(v40 + 1676) = v35++;
*(float *)(v40 + 1824) = a4;
v41 = a9 && a4 > *(float *)(a1[1868] + 504LL);
LevelEditorLayer::activateTriggerEffect((__int64)a1, v40, a5, v18, a7, v41);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v40 + 1336LL))(v40);
}
}
}
}
}
}
}
}
}
}