//
// cocos2d::CCParticleSystem::initWithTotalParticles from 0x18006ad50 to 0x18006ae66 (278 bytes)
//
// 4 xrefs:
// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x18006cbc9
// > ??> @ 0x180105a20
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bdf30
//
// 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:21:54 +0000
//
char __fastcall cocos2d::CCParticleSystem::initWithTotalParticles(cocos2d::CCParticleSystem *this, int a2, char a3)
{
void *v4; // rcx
void *v7; // rax
bool v9; // zf
unsigned int i; // edx
*((_DWORD *)this + 167) = a2;
v4 = *((void **)this + 53);
if ( v4 )
{
free(v4);
*((_QWORD *)this + 53) = 0;
}
v7 = calloc(*((unsigned int *)this + 167), 0x94u);
*((_QWORD *)this + 53) = v7;
if ( v7 )
{
v9 = *((_QWORD *)this + 55) == 0;
*((_DWORD *)this + 114) = a2;
if ( !v9 )
{
for ( i = 0; i < *((_DWORD *)this + 167); ++i )
*(_DWORD *)(148LL * i + *((_QWORD *)this + 53) + 72) = i;
}
*((_BYTE *)this + 460) = 1;
*((_DWORD *)this + 170) = 1;
*((_DWORD *)this + 171) = 771;
*((_DWORD *)this + 173) = 0;
*((_DWORD *)this + 175) = 0;
*((_BYTE *)this + 696) = 0;
*((_BYTE *)this + 452) = 0;
if ( !a3 )
{
cocos2d::CCNode::scheduleUpdateWithPriority((cocos2d::CCScheduler **)this, 1);
*((_BYTE *)this + 565) = 1;
}
return 1;
}
else
{
cocos2d::CCObject::release(this);
return 0;
}
}