//
// cocos2d::CCParticleFireworks::createWithTotalParticles from 0x180063370 to 0x18006343a (202 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b3924
//
// 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
//
struct cocos2d::CCParticleFireworks *__fastcall cocos2d::CCParticleFireworks::createWithTotalParticles(unsigned int a1)
{
cocos2d::CCParticleSystemQuad *v2; // rax
cocos2d::CCParticleFireworks *v3; // rbx
bool (__stdcall *initWithTotalParticles_0)(cocos2d::CCParticleFireworks *__hidden, unsigned int); // r8
char v5; // al
cocos2d::CCParticleSystemQuad *(__fastcall *v7)(cocos2d::CCParticleSystemQuad *, char); // r8
v2 = (cocos2d::CCParticleSystemQuad *)operator new(0x348u);
v3 = (cocos2d::CCParticleFireworks *)v2;
if ( v2 )
{
cocos2d::CCParticleSystemQuad::CCParticleSystemQuad(v2);
v3->cocos2d::CCParticleSystemQuad::cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (cocos2d::CCParticleFireworks_vtbl *)&cocos2d::CCParticleFireworks::`vftable'{for `cocos2d::CCNode'};
v3->cocos2d::CCParticleSystemQuad::cocos2d::CCParticleSystem::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCTextureProtocol_vtbl *)&cocos2d::CCParticleFireworks::`vftable'{for `cocos2d::CCTextureProtocol'};
}
else
{
v3 = nullptr;
}
if ( v3 )
{
initWithTotalParticles_0 = v3->initWithTotalParticles_0;
if ( (char *)initWithTotalParticles_0 == (char *)cocos2d::CCParticleFireworks::initWithTotalParticles )
v5 = cocos2d::CCParticleFireworks::initWithTotalParticles(v3, a1);
else
v5 = ((__int64 (__fastcall *)(cocos2d::CCParticleFireworks *, _QWORD))initWithTotalParticles_0)(v3, a1);
if ( v5 )
{
cocos2d::CCObject::autorelease(v3);
return v3;
}
v7 = (cocos2d::CCParticleSystemQuad *(__fastcall *)(cocos2d::CCParticleSystemQuad *, char))v3->~CCParticleFireworks;
if ( v7 == sub_1800623F0 )
{
sub_1800623F0(v3, 1);
return nullptr;
}
v7(v3, 1);
return nullptr;
}
return v3;
}