//
// cocos2d::CCParticleSystemQuad::allocMemory from 0x10025335c to 0x10025342c (208 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x100253300
// > cocos2d::CCParticleSystemQuad::setBatchNode @ 0x1002540c8
//
// 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 __fastcall cocos2d::CCParticleSystemQuad::allocMemory(cocos2d::CCParticleSystemQuad *a1)
{
cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // x0
GLushort *m_pIndices; // x0
__int64 m_uTotalParticles; // x20
size_t v5; // x22
cocos2d::ccV3F_C4B_T2F_Quad *v6; // x23
size_t v7; // x24
GLushort *v8; // x0
GLushort *v9; // x21
bool v10; // zf
bool v11; // w20
m_pQuads = a1->m_pQuads;
if ( m_pQuads )
{
free(m_pQuads);
a1->m_pQuads = nullptr;
}
m_pIndices = a1->m_pIndices;
if ( m_pIndices )
free(m_pIndices);
m_uTotalParticles = a1->m_uTotalParticles;
v5 = 96 * m_uTotalParticles;
v6 = (cocos2d::ccV3F_C4B_T2F_Quad *)malloc(96 * m_uTotalParticles);
a1->m_pQuads = v6;
v7 = 2LL * (unsigned int)(6 * m_uTotalParticles);
v8 = (GLushort *)malloc(v7);
v9 = v8;
a1->m_pIndices = v8;
if ( v6 )
v10 = v8 == nullptr;
else
v10 = 1;
v11 = !v10;
if ( v10 )
{
if ( v6 )
{
free(v6);
a1->m_pQuads = nullptr;
}
if ( v9 )
{
free(v9);
a1->m_pIndices = nullptr;
}
}
else
{
bzero(v6, v5);
bzero(v9, v7);
}
return v11;
}