//
// cocos2d::CCParticleSystemQuad::setTotalParticles from 0x5ddf1c to 0x5ddff4 (216 bytes)
//
// 0 xrefs:
//
// 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
//
void cocos2d::CCParticleSystemQuad::setTotalParticles(cocos2d::CCParticleSystemQuad *a1, unsigned int a2)
{
size_t v4; // r11
size_t v5; // r10
size_t v6; // r9
cocos2d::tCCParticle *v7; // r8
cocos2d::ccV3F_C4B_T2F_Quad *v8; // r7
GLushort *v9; // r0
cocos2d::CCParticleBatchNode *m_pBatchNode; // r3
int i; // r3
if ( a2 <= a1->m_uAllocatedParticles )
{
a1->m_uTotalParticles = a2;
LABEL_15:
cocos2d::CCParticleSystem::resetSystem(a1);
return;
}
v4 = 148 * a2;
v5 = 96 * a2;
v6 = 12 * a2;
v7 = (cocos2d::tCCParticle *)realloc(a1->m_pParticles, 148 * a2);
v8 = (cocos2d::ccV3F_C4B_T2F_Quad *)realloc(a1->m_pQuads, v5);
v9 = (GLushort *)realloc(a1->m_pIndices, v6);
if ( v7 )
{
a1->m_pParticles = v7;
if ( v8 )
{
if ( v9 )
{
a1->m_pIndices = v9;
a1->m_pQuads = v8;
memset(v7, 0, v4);
memset(a1->m_pQuads, 0, v5);
memset(a1->m_pIndices, 0, v6);
m_pBatchNode = a1->m_pBatchNode;
a1->m_uAllocatedParticles = a2;
a1->m_uTotalParticles = a2;
if ( m_pBatchNode )
{
for ( i = 0; i != a2; ++i )
*((_DWORD *)&a1->m_pParticles->cocos2d::CCParticleSystem::modeA.dir.x + 37 * i) = i;
}
cocos2d::CCParticleSystemQuad::initIndices(a1);
cocos2d::CCParticleSystemQuad::setupVBO(a1);
cocos2d::CCParticleSystemQuad::updateTexCoords(a1);
goto LABEL_15;
}
}
}
if ( v8 )
a1->m_pQuads = v8;
if ( v9 )
a1->m_pIndices = v9;
}