//
// cocos2d::CCParticleGalaxy::initWithTotalParticles from 0x1004858a0 to 0x100485a7e (478 bytes)
//
// 3 xrefs:
// > cocos2d::CCParticleGalaxy::create @ 0x1004857dc
// > cocos2d::CCParticleGalaxy::createWithTotalParticles @ 0x10048585d
// > ??> @ 0x10093ee68
//
// 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::CCParticleGalaxy::initWithTotalParticles(cocos2d::CCParticleGalaxy *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 = -1.0;
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, _QWORD))a1->setEmitterMode)(a1, 0);
sub_10028CBE0(v6, 0.0, 0.0);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, float *))a1->setGravity)(a1, v6);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, float))a1->setSpeed)(a1, 60.0);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, float))a1->setSpeedVar)(a1, 10.0);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, float))a1->setRadialAccel)(a1, -80.0);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, double))a1->setRadialAccelVar)(a1, 0.0);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, float))a1->setTangentialAccel)(a1, 80.0);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, 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::CCParticleGalaxy *, float *))a1->setPosition)(a1, &v5);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, void *))a1->setPosVar)(a1, &unk_1009A1AE0);
*(_QWORD *)&a1->m_fLife = 0x3F80000040800000LL;
*(_QWORD *)&a1->m_fStartSize = 0x4120000042140000LL;
a1->m_fEndSize = -1.0;
a1->m_fEmissionRate = (float)(int)a1->m_uTotalParticles * 0.25;
a1->m_tStartColor = (cocos2d::ccColor4F)xmmword_10081CC40;
a1->m_tStartColorVar = 0;
*(_OWORD *)&a1->m_tStartColorVar.a = 0;
a1->m_tEndColor.a = 1.0;
a1->m_tEndColorVar = 0;
v4 = sub_1004851D0();
if ( v4 )
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, cocos2d::CCTexture2D *))a1->setTexture)(a1, v4);
((void (__fastcall *)(cocos2d::CCParticleGalaxy *, __int64))a1->setBlendAdditive)(a1, 1);
return v3;
}
return result;
}