//
// cocos2d::CCParticleSystemQuad::allocMemory from 0x1006023f0 to 0x1006024dd (237 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x1006020a9
// > cocos2d::CCParticleSystemQuad::setBatchNode @ 0x100603baa
//
// 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; // rdi
GLushort *m_pIndices; // rdi
unsigned int m_uTotalParticles; // r14d
cocos2d::ccV3F_C4B_T2F_Quad *v5; // r12
GLushort *v6; // r15
size_t v8; // [rsp+0h] [rbp-30h]
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;
v8 = 96LL * m_uTotalParticles;
v5 = (cocos2d::ccV3F_C4B_T2F_Quad *)malloc(v8);
a1->m_pQuads = v5;
v6 = (GLushort *)malloc(12LL * m_uTotalParticles);
a1->m_pIndices = v6;
if ( v5 != nullptr && v6 != nullptr )
{
__bzero(v5, v8);
__bzero(v6, 12LL * m_uTotalParticles);
}
else
{
if ( v5 )
{
free(v5);
a1->m_pQuads = nullptr;
}
if ( v6 )
{
free(v6);
a1->m_pIndices = nullptr;
}
}
return v5 != nullptr && v6 != nullptr;
}