//
// cocos2d::CCParticleSystem::initWithTotalParticles from 0x5dab1a to 0x5daba8 (142 bytes)
//
// 1 xrefs:
// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x5de0b4
//
// 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
//
bool cocos2d::CCParticleSystem::initWithTotalParticles(cocos2d::CCParticleSystem *a1, unsigned int a2, bool a3)
{
cocos2d::tCCParticle *m_pParticles; // r0
_BOOL4 v6; // r8
size_t m_uTotalParticles; // r6
cocos2d::tCCParticle *v8; // r0
bool v9; // r5
cocos2d::CCParticleBatchNode *m_pBatchNode; // r3
int i; // r3
m_pParticles = a1->m_pParticles;
v6 = a3;
a1->m_uTotalParticles = a2;
if ( m_pParticles )
free(m_pParticles);
m_uTotalParticles = a1->m_uTotalParticles;
v8 = (cocos2d::tCCParticle *)calloc(m_uTotalParticles, 0x94u);
v9 = (char)v8;
a1->m_pParticles = v8;
if ( v8 )
{
m_pBatchNode = a1->m_pBatchNode;
a1->m_uAllocatedParticles = a2;
if ( m_pBatchNode )
{
for ( i = 0; i != m_uTotalParticles; ++i )
*((_DWORD *)&v8->modeA.dir.x + 37 * i) = i;
}
v9 = 1;
a1->m_bIsActive = 1;
a1->m_tBlendFunc.dst = 771;
a1->m_tBlendFunc.src = 1;
a1->m_ePositionType = kCCPositionTypeFree;
a1->m_nEmitterMode = 0;
a1->m_bIsAutoRemoveOnFinish = 0;
a1->m_bTransformSystemDirty = 0;
if ( !v6 )
{
cocos2d::CCNode::scheduleUpdateWithPriority(a1, 1);
a1->m_bUsingSchedule = 1;
}
}
else
{
cocos2d::CCObject::release(a1);
}
return v9;
}