//
// GJBaseGameLayer::updateParticles from 0x10015e3d0 to 0x10015e59d (461 bytes)
//
// 2 xrefs:
// > PlayLayer::updateVisibility @ 0x1000b7d76
// > LevelEditorLayer::updateVisibility @ 0x1000eb698
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall GJBaseGameLayer::updateParticles(GJBaseGameLayer *a1, float a2)
{
unsigned int v2; // r15d
__int64 v3; // rax
__int64 v4; // r13
unsigned int v5; // r15d
__int64 v6; // r12
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // [rsp+8h] [rbp-58h] BYREF
__int128 v11; // [rsp+10h] [rbp-50h] BYREF
void *__p; // [rsp+20h] [rbp-40h]
float v13; // [rsp+30h] [rbp-30h]
_BYTE v14[41]; // [rsp+37h] [rbp-29h] BYREF
v13 = a2;
a1->m_particleCount = 0;
if ( (unsigned int)sub_100720070(a1->m_temporaryParticles) )
{
v2 = 0;
do
{
v3 = sub_1007200C0(a1->m_temporaryParticles, v2);
if ( *(_BYTE *)(v3 + 551) == 1 )
{
LODWORD(v11) = *(_DWORD *)(v3 + 8);
sub_1000569A0(&a1->m_customParticlesUIDs.__table_.__bucket_list_.__ptr_.__value_, (int *)&v11);
sub_100720280(a1->m_temporaryParticles, v2);
}
else
{
v4 = v3;
a1->m_particleCount += (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 1480LL))(v3);
*(_QWORD *)&a2 = LODWORD(v13);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v4 + 40LL))(v4, v13);
++v2;
}
}
while ( v2 < (unsigned int)sub_100720070(a1->m_temporaryParticles) );
}
if ( (unsigned int)sub_100720070(a1->m_unclaimedParticles) )
{
v5 = 0;
do
{
v6 = sub_1007200C0(a1->m_unclaimedParticles, v5);
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v6 + 896LL))(v6) )
{
++v5;
}
else
{
v10 = v6 + 780;
v7 = sub_100172F30(&a1->m_particleCountToParticleString, v6 + 780, &unk_100816AE0, &v10, v14);
if ( (*(_BYTE *)(v7 + 24) & 1) != 0 )
{
sub_100006B70(&v11, *(const void **)(v7 + 40), *(_QWORD *)(v7 + 32), *(double *)&a2);
}
else
{
v8 = v7 + 24;
__p = *(void **)(v8 + 16);
*(_OWORD *)&a2 = *(_OWORD *)v8;
v11 = *(_OWORD *)v8;
}
v9 = cocos2d::CCDictionary::objectForKey_1(a1->m_customParticles, &v11);
if ( v9 )
sub_10071FCD0(v9, v6);
sub_100720280(a1->m_unclaimedParticles, v5);
if ( (v11 & 1) != 0 )
operator delete(__p);
}
}
while ( v5 < (unsigned int)sub_100720070(a1->m_unclaimedParticles) );
}
}