//
// cocos2d::CCParticleFire::initWithTotalParticles from 0xafa874 to 0xafaa50 (476 bytes)
//
// 4 xrefs:
// > cocos2d::CCParticleFire::create @ 0xafc560
// > cocos2d::CCParticleFire::createWithTotalParticles @ 0xafc5ec
// > ??> @ 0xa4820
// > ??> @ 0x1212420
//
// 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::CCParticleFire::initWithTotalParticles(cocos2d::CCParticleFire *a1, unsigned int a2)
{
bool v3; // w22
float v5; // s0
float v6; // s1
cocos2d::CCDirector *v7; // x0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
float v9; // s0
float v10; // s1
float m_uTotalParticles; // s0
cocos2d::CCTexture2D *v12; // x1
float v13; // [xsp+78h] [xbp+78h]
cocos2d::CCPoint v14; // [xsp+80h] [xbp+80h] BYREF
v3 = cocos2d::CCParticleSystemQuad::initWithTotalParticles(a1, a2, 0);
if ( v3 )
{
a1->m_nEmitterMode = 0;
a1->m_fDuration = -1.0;
cocos2d::CCPoint::CCPoint(&v14, 0.0, 0.0);
cocos2d::CCPoint::operator=(&a1->modeA.gravity, v5, v6, (float *)&v14);
a1->modeA.radialAccel = 0.0;
a1->modeA.radialAccelVar = 0.0;
a1->modeA.speedVar = 20.0;
a1->m_fAngleVar = 10.0;
a1->modeA.speed = 60.0;
a1->m_fAngle = 90.0;
v7 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v7);
setPosition = a1->setPosition;
cocos2d::CCPoint::CCPoint(&v14, v13 * 0.5, 60.0);
setPosition(a1, &v14);
cocos2d::CCPoint::CCPoint(&v14, 40.0, 20.0);
cocos2d::CCPoint::operator=(&a1->m_tPosVar, v9, v10, (float *)&v14);
m_uTotalParticles = (float)a1->m_uTotalParticles;
a1->m_fLife = 3.0;
a1->m_fStartSize = 54.0;
a1->m_fLifeVar = 0.25;
a1->m_fStartSizeVar = 10.0;
a1->m_fEndSize = -1.0;
a1->m_tStartColor.r = 0.76;
a1->m_tStartColor.g = 0.25;
a1->m_tStartColor.a = 1.0;
a1->m_tStartColorVar.r = 0.0;
a1->m_tStartColor.b = 0.12;
a1->m_tStartColorVar.g = 0.0;
a1->m_tStartColorVar.b = 0.0;
a1->m_fEmissionRate = m_uTotalParticles / 3.0;
a1->m_tStartColorVar.a = 0.0;
a1->m_tEndColor.r = 0.0;
a1->m_tEndColor.g = 0.0;
a1->m_tEndColor.b = 0.0;
a1->m_tEndColor.a = 1.0;
a1->m_tEndColorVar.r = 0.0;
a1->m_tEndColorVar.g = 0.0;
a1->m_tEndColorVar.b = 0.0;
a1->m_tEndColorVar.a = 0.0;
v12 = sub_AFA7C0();
if ( v12 )
a1->setTexture(a1, v12);
a1->setBlendAdditive(a1, 1);
}
return v3;
}