//
// cocos2d::CCParticleFireworks::initWithTotalParticles from 0xafaa68 to 0xafac20 (440 bytes)
//
// 4 xrefs:
// > cocos2d::CCParticleFireworks::create @ 0xafc670
// > cocos2d::CCParticleFireworks::createWithTotalParticles @ 0xafc6fc
// > ??> @ 0x36060
// > ??> @ 0x1212ad0
//
// 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 cocos2d::CCParticleFireworks::initWithTotalParticles(cocos2d::CCParticleFireworks *a1, unsigned int a2)
{
bool v3; // w21
float v5; // s0
float v6; // s1
cocos2d::CCDirector *v7; // x0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
float v9; // s0
cocos2d::CCTexture2D *v10; // x1
float v11; // [xsp+58h] [xbp+58h]
float v12; // [xsp+5Ch] [xbp+5Ch]
cocos2d::CCPoint v13; // [xsp+60h] [xbp+60h] BYREF
v3 = cocos2d::CCParticleSystemQuad::initWithTotalParticles(a1, a2, 0);
if ( v3 )
{
a1->m_nEmitterMode = 0;
a1->m_fDuration = -1.0;
cocos2d::CCPoint::CCPoint(&v13, 0.0, -90.0);
cocos2d::CCPoint::operator=(&a1->modeA.gravity, v5, v6, (float *)&v13);
a1->modeA.speed = 180.0;
a1->modeA.radialAccel = 0.0;
a1->modeA.radialAccelVar = 0.0;
a1->modeA.speedVar = 50.0;
v7 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v7);
setPosition = a1->setPosition;
cocos2d::CCPoint::CCPoint(&v13, v11 * 0.5, v12 * 0.5);
setPosition(a1, &v13);
v9 = (float)a1->m_uTotalParticles / 3.5;
a1->m_tEndColor.a = 0.2;
a1->m_tEndColorVar.a = 0.2;
a1->m_fAngle = 90.0;
a1->m_fAngleVar = 20.0;
a1->m_fLife = 3.5;
a1->m_fLifeVar = 1.0;
a1->m_tStartColor.r = 0.5;
a1->m_tStartColor.g = 0.5;
a1->m_tStartColor.b = 0.5;
a1->m_tStartColor.a = 1.0;
a1->m_tStartColorVar.r = 0.5;
a1->m_tStartColorVar.g = 0.5;
a1->m_fEmissionRate = v9;
a1->m_tStartColorVar.b = 0.5;
a1->m_fStartSize = 8.0;
a1->m_tStartColorVar.a = 0.1;
a1->m_tEndColor.r = 0.1;
a1->m_tEndColor.g = 0.1;
a1->m_tEndColor.b = 0.1;
a1->m_tEndColorVar.r = 0.1;
a1->m_tEndColorVar.g = 0.1;
a1->m_tEndColorVar.b = 0.1;
a1->m_fStartSizeVar = 2.0;
a1->m_fEndSize = -1.0;
v10 = sub_AFA7C0();
if ( v10 )
a1->setTexture(a1, v10);
a1->setBlendAdditive(a1, 0);
}
return v3;
}