//
// cocos2d::CCParticleFireworks::initWithTotalParticles from 0x180064020 to 0x180064218 (504 bytes)
//
// 7 xrefs:
// > cocos2d::CCParticleFireworks::createWithTotalParticles @ 0x1800633d7
// > cocos2d::CCParticleFireworks::createWithTotalParticles @ 0x1800633c6
// > ??> @ 0x1800fb3a8
// > ??> @ 0x180139b60
// > ??> @ 0x180139b70
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b39e4
//
// 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::CCParticleFireworks::initWithTotalParticles(
cocos2d::CCParticleFireworks *this,
unsigned int a2)
{
float *v3; // rax
cocos2d::CCDirector *v4; // rax
cocos2d::CCParticleFireworks_vtbl *v5; // rbx
float *v6; // rax
signed int m_uTotalParticles; // eax
struct cocos2d::CCTexture2D *v8; // rax
float v10; // [rsp+40h] [rbp+18h]
float v11; // [rsp+44h] [rbp+1Ch]
float v12; // [rsp+48h] [rbp+20h] BYREF
if ( !cocos2d::CCParticleSystemQuad::initWithTotalParticles(this, a2, 0) )
return 0;
this->m_fDuration = -1.0;
this->m_nEmitterMode = 0;
v3 = kmVec2Fill(&v12, 0.0, -90.0);
cocos2d::CCSize::operator=(&this->modeA.gravity, v3);
*(_QWORD *)&this->modeA.radialAccel = 0;
this->modeA.speed = 180.0;
this->modeA.speedVar = 50.0;
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v4);
v5 = this->cocos2d::CCParticleSystemQuad::cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v6 = kmVec2Fill(&v12, v10 * 0.5, v11 * 0.5);
((void (__fastcall *)(cocos2d::CCParticleFireworks *, float *))v5->setPosition_0)(this, v6);
m_uTotalParticles = this->m_uTotalParticles;
this->m_fAngle = 90.0;
this->m_fAngleVar = 20.0;
this->m_fLife = 3.5;
this->m_fLifeVar = 1.0;
this->m_tStartColor.r = 0.5;
this->m_tStartColor.g = 0.5;
this->m_tStartColor.b = 0.5;
this->m_tStartColor.a = 1.0;
this->m_tStartColorVar.r = 0.5;
this->m_tStartColorVar.g = 0.5;
this->m_tStartColorVar.b = 0.5;
this->m_tStartColorVar.a = 0.1;
this->m_tEndColor.r = 0.1;
this->m_tEndColor.g = 0.1;
this->m_tEndColor.b = 0.1;
this->m_tEndColor.a = 0.2;
this->m_tEndColorVar.r = 0.1;
this->m_tEndColorVar.g = 0.1;
this->m_tEndColorVar.b = 0.1;
this->m_tEndColorVar.a = 0.2;
this->m_fStartSize = 8.0;
this->m_fStartSizeVar = 2.0;
this->m_fEndSize = -1.0;
this->m_fEmissionRate = (float)m_uTotalParticles / 3.5;
v8 = sub_180063AC0();
if ( v8 )
((void (__fastcall *)(cocos2d::CCTextureProtocol *, struct cocos2d::CCTexture2D *))this->setTexture)(
&this->cocos2d::CCTextureProtocol,
v8);
((void (__fastcall *)(cocos2d::CCParticleFireworks *, _QWORD))this->setBlendAdditive)(this, 0);
return 1;
}