//
// cocos2d::CCParticleSystemQuad::allocMemory from 0x18006a360 to 0x18006a45b (251 bytes)
//
// 4 xrefs:
// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x18006aa25
// > cocos2d::CCParticleSystemQuad::setBatchNode @ 0x18006ab27
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b3c9c
//
// 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
//
char __fastcall cocos2d::CCParticleSystemQuad::allocMemory(cocos2d::CCParticleSystemQuad *this)
{
cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // rcx
GLushort *m_pIndices; // rcx
GLushort *v4; // rax
cocos2d::ccV3F_C4B_T2F_Quad *v5; // rcx
GLushort *v7; // rcx
m_pQuads = this->m_pQuads;
if ( m_pQuads )
{
free(m_pQuads);
this->m_pQuads = nullptr;
}
m_pIndices = this->m_pIndices;
if ( m_pIndices )
{
free(m_pIndices);
this->m_pIndices = nullptr;
}
this->m_pQuads = (cocos2d::ccV3F_C4B_T2F_Quad *)malloc(96LL * this->m_uTotalParticles);
v4 = (GLushort *)malloc(12LL * this->m_uTotalParticles);
v5 = this->m_pQuads;
this->m_pIndices = v4;
if ( v5 )
{
if ( v4 )
{
memset(v5, 0, 96LL * this->m_uTotalParticles);
memset(this->m_pIndices, 0, 12LL * this->m_uTotalParticles);
return 1;
}
free(v5);
this->m_pQuads = nullptr;
}
v7 = this->m_pIndices;
if ( v7 )
{
free(v7);
this->m_pIndices = nullptr;
}
return 0;
}