//
// cocos2d::CCParticleSystemQuad::allocMemory from 0xb03784 to 0xb03888 (260 bytes)
//
// 3 xrefs:
// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0xb0392c
// > cocos2d::CCParticleSystemQuad::setBatchNode @ 0xb03bd8
// > ??> @ 0xac200
//
// 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::CCParticleSystemQuad::allocMemory(cocos2d::CCParticleSystemQuad *a1)
{
cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // x0
GLushort *m_pIndices; // x0
unsigned int m_uTotalParticles; // w19
size_t v5; // x21
cocos2d::ccV3F_C4B_T2F_Quad *v6; // x22
size_t v7; // x19
GLushort *v8; // x0
GLushort *v9; // x23
size_t v10; // x2
bool v11; // w21
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 = 96LL * m_uTotalParticles;
v6 = (cocos2d::ccV3F_C4B_T2F_Quad *)malloc(v5);
a1->m_pQuads = v6;
v7 = 12LL * m_uTotalParticles;
v8 = (GLushort *)malloc(v7);
a1->m_pIndices = v8;
v9 = v8;
if ( v6 )
{
if ( v8 )
{
v10 = v5;
v11 = 1;
memset(v6, 0, v10);
memset(v9, 0, v7);
return v11;
}
free(v6);
a1->m_pQuads = nullptr;
return 0;
}
else
{
v11 = 0;
if ( !v8 )
return v11;
free(v8);
a1->m_pIndices = nullptr;
return 0;
}
}