//
// cocos2d::CCParticleExplosion::createWithTotalParticles from 0x1800631d0 to 0x18006329a (202 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b390c
//
// 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
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCParticleExplosion *__fastcall cocos2d::CCParticleExplosion::createWithTotalParticles(unsigned int a1)
{
cocos2d::CCParticleSystemQuad *v2; // rax
cocos2d::CCParticleExplosion *v3; // rbx
bool (__stdcall *initWithTotalParticles_0)(cocos2d::CCParticleExplosion *__hidden, unsigned int); // r8
char v5; // al
cocos2d::CCParticleSystemQuad *(__fastcall *v7)(cocos2d::CCParticleSystemQuad *, char); // r8
v2 = (cocos2d::CCParticleSystemQuad *)operator new(0x348u);
v3 = (cocos2d::CCParticleExplosion *)v2;
if ( v2 )
{
cocos2d::CCParticleSystemQuad::CCParticleSystemQuad(v2);
v3->cocos2d::CCParticleSystemQuad::cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (cocos2d::CCParticleExplosion_vtbl *)&cocos2d::CCParticleExplosion::`vftable'{for `cocos2d::CCNode'};
v3->cocos2d::CCParticleSystemQuad::cocos2d::CCParticleSystem::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCTextureProtocol_vtbl *)&cocos2d::CCParticleExplosion::`vftable'{for `cocos2d::CCTextureProtocol'};
}
else
{
v3 = nullptr;
}
if ( v3 )
{
initWithTotalParticles_0 = v3->initWithTotalParticles_0;
if ( (char *)initWithTotalParticles_0 == (char *)cocos2d::CCParticleExplosion::initWithTotalParticles )
v5 = cocos2d::CCParticleExplosion::initWithTotalParticles(v3, a1);
else
v5 = ((__int64 (__fastcall *)(cocos2d::CCParticleExplosion *, _QWORD))initWithTotalParticles_0)(v3, a1);
if ( v5 )
{
cocos2d::CCObject::autorelease(v3);
return v3;
}
v7 = (cocos2d::CCParticleSystemQuad *(__fastcall *)(cocos2d::CCParticleSystemQuad *, char))v3->~CCParticleExplosion;
if ( v7 == sub_1800622B0 )
{
sub_1800622B0(v3, 1);
return nullptr;
}
v7(v3, 1);
return nullptr;
}
return v3;
}