//
// cocos2d::CCParticleSun::initWithTotalParticles from 0x1004855f0 to 0x10048579e (430 bytes)
//
// 3 xrefs:
// > cocos2d::CCParticleSun::create @ 0x10048552c
// > cocos2d::CCParticleSun::createWithTotalParticles @ 0x1004855ad
// > ??> @ 0x10093e7a8
//
// 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::CCParticleSun::initWithTotalParticles(cocos2d::CCParticleSun *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;
((void (__fastcall *)(cocos2d::CCParticleSun *, __int64))a1->setBlendAdditive)(a1, 1);
a1->m_fDuration = -1.0;
((void (__fastcall *)(cocos2d::CCParticleSun *, _QWORD))a1->setEmitterMode)(a1, 0);
sub_10028CBE0(v6, 0.0, 0.0);
((void (__fastcall *)(cocos2d::CCParticleSun *, float *))a1->setGravity)(a1, v6);
((void (__fastcall *)(cocos2d::CCParticleSun *, double))a1->setRadialAccel)(a1, 0.0);
((void (__fastcall *)(cocos2d::CCParticleSun *, double))a1->setRadialAccelVar)(a1, 0.0);
((void (__fastcall *)(cocos2d::CCParticleSun *, float))a1->setSpeed)(a1, 20.0);
((void (__fastcall *)(cocos2d::CCParticleSun *, float))a1->setSpeedVar)(a1, 5.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::CCParticleSun *, float *))a1->setPosition)(a1, &v5);
((void (__fastcall *)(cocos2d::CCParticleSun *, void *))a1->setPosVar)(a1, &unk_1009A1AE0);
*(_QWORD *)&a1->m_fLife = 0x3F0000003F800000LL;
*(_QWORD *)&a1->m_fStartSize = 0x4120000041F00000LL;
a1->m_fEndSize = -1.0;
a1->m_fEmissionRate = (float)(int)a1->m_uTotalParticles;
a1->m_tStartColor = (cocos2d::ccColor4F)xmmword_10081CB90;
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::CCParticleSun *, cocos2d::CCTexture2D *))a1->setTexture)(a1, v4);
return v3;
}
return result;
}