//
// cocos2d::CCParticleExplosion::initWithTotalParticles from 0x100486430 to 0x1004865fb (459 bytes)
//
// 3 xrefs:
// > cocos2d::CCParticleExplosion::create @ 0x10048636c
// > cocos2d::CCParticleExplosion::createWithTotalParticles @ 0x1004863ed
// > ??> @ 0x100940968
//
// 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 __fastcall cocos2d::CCParticleExplosion::initWithTotalParticles(cocos2d::CCParticleExplosion *a1, unsigned int a2)
{
bool result; // al
bool v3; // r15
cocos2d::CCTexture2D *v4; // rax
float v5; // [rsp+8h] [rbp-28h] BYREF
float v6[8]; // [rsp+10h] [rbp-20h] BYREF
result = cocos2d::CCParticleSystemQuad::initWithTotalParticles(a1, a2, 0);
if ( result )
{
v3 = result;
a1->m_fDuration = 0.1;
((void (__fastcall *)(cocos2d::CCParticleExplosion *, _QWORD))a1->setEmitterMode)(a1, 0);
sub_10028CBE0(v6, 0.0, 0.0);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, float *))a1->setGravity)(a1, v6);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, float))a1->setSpeed)(a1, 70.0);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, float))a1->setSpeedVar)(a1, 40.0);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, double))a1->setRadialAccel)(a1, 0.0);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, double))a1->setRadialAccelVar)(a1, 0.0);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, double))a1->setTangentialAccel)(a1, 0.0);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, double))a1->setTangentialAccelVar)(a1, 0.0);
*(_QWORD *)&a1->m_fAngle = 0x43B4000042B40000LL;
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v6);
sub_10028CBE0(&v5, v6[0] * 0.5, 0.5 * v6[1]);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, float *))a1->setPosition)(a1, &v5);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, void *))a1->setPosVar)(a1, &unk_1009A1AE0);
*(_QWORD *)&a1->m_fLife = 0x4000000040A00000LL;
*(_QWORD *)&a1->m_fStartSize = 0x4120000041700000LL;
a1->m_fEndSize = -1.0;
a1->m_fEmissionRate = (float)(int)a1->m_uTotalParticles / a1->m_fDuration;
a1->m_tStartColor = (cocos2d::ccColor4F)xmmword_10081CCD0;
a1->m_tStartColorVar = (cocos2d::ccColor4F)xmmword_10081CCA0;
a1->m_tEndColor = (cocos2d::ccColor4F)xmmword_10081CCA0;
a1->m_tEndColorVar = (cocos2d::ccColor4F)xmmword_10081CCA0;
v4 = sub_1004851D0();
if ( v4 )
((void (__fastcall *)(cocos2d::CCParticleExplosion *, cocos2d::CCTexture2D *))a1->setTexture)(a1, v4);
((void (__fastcall *)(cocos2d::CCParticleExplosion *, _QWORD))a1->setBlendAdditive)(a1, 0);
return v3;
}
return result;
}