//
// cocos2d::CCParticleSpiral::initWithTotalParticles from 0x180064f20 to 0x180065157 (567 bytes)
//
// 7 xrefs:
// > cocos2d::CCParticleSpiral::createWithTotalParticles @ 0x180063987
// > cocos2d::CCParticleSpiral::createWithTotalParticles @ 0x180063976
// > ??> @ 0x1800fd3d8
// > ??> @ 0x180139c18
// > ??> @ 0x180139c28
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b3ae0
//
// 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
//
char __fastcall cocos2d::CCParticleSpiral::initWithTotalParticles(cocos2d::CCParticleSpiral *this, unsigned int a2)
{
cocos2d::CCParticleSpiral_vtbl *v3; // rax
cocos2d::CCParticleSpiral_vtbl *v4; // rbx
float *v5; // rax
cocos2d::CCDirector *v6; // rax
cocos2d::CCParticleSpiral_vtbl *v7; // rbx
float *v8; // rax
signed int m_uTotalParticles; // eax
struct cocos2d::CCTexture2D *v10; // rax
float v12; // [rsp+40h] [rbp+18h]
float v13; // [rsp+44h] [rbp+1Ch]
float v14; // [rsp+48h] [rbp+20h] BYREF
if ( !cocos2d::CCParticleSystemQuad::initWithTotalParticles(this, a2, 0) )
return 0;
v3 = this->cocos2d::CCParticleSystemQuad::cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
this->m_fDuration = -1.0;
((void (__fastcall *)(cocos2d::CCParticleSpiral *, _QWORD))v3->setEmitterMode)(this, 0);
v4 = this->cocos2d::CCParticleSystemQuad::cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v5 = kmVec2Fill(&v14, 0.0, 0.0);
((void (__fastcall *)(cocos2d::CCParticleSpiral *, float *))v4->setGravity)(this, v5);
((void (__fastcall *)(cocos2d::CCParticleSpiral *))this->setSpeed)(this);
((void (__fastcall *)(cocos2d::CCParticleSpiral *))this->setSpeedVar)(this);
((void (__fastcall *)(cocos2d::CCParticleSpiral *))this->setRadialAccel)(this);
((void (__fastcall *)(cocos2d::CCParticleSpiral *))this->setRadialAccelVar)(this);
((void (__fastcall *)(cocos2d::CCParticleSpiral *))this->setTangentialAccel)(this);
((void (__fastcall *)(cocos2d::CCParticleSpiral *))this->setTangentialAccelVar)(this);
*(_QWORD *)&this->m_fAngle = 1119092736;
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v6);
v7 = this->cocos2d::CCParticleSystemQuad::cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v8 = kmVec2Fill(&v14, v12 * 0.5, v13 * 0.5);
((void (__fastcall *)(cocos2d::CCParticleSpiral *, float *))v7->setPosition_0)(this, v8);
((void (__fastcall *)(cocos2d::CCParticleSpiral *, void *))this->setPosVar)(this, &unk_1801A8408);
m_uTotalParticles = this->m_uTotalParticles;
*(_QWORD *)&this->m_fLife = 1094713344;
*(_QWORD *)&this->m_fStartSize = 1101004800;
this->m_fEndSize = -1.0;
this->m_tStartColor.r = 0.5;
this->m_tStartColor.g = 0.5;
this->m_tStartColor.b = 0.5;
this->m_tStartColor.a = 1.0;
this->m_tStartColorVar.r = 0.5;
this->m_tStartColorVar.g = 0.5;
*(_QWORD *)&this->m_tStartColorVar.b = 1056964608;
this->m_tEndColor.r = 0.5;
this->m_tEndColor.g = 0.5;
this->m_tEndColor.b = 0.5;
this->m_tEndColor.a = 1.0;
this->m_tEndColorVar.r = 0.5;
this->m_tEndColorVar.g = 0.5;
*(_QWORD *)&this->m_tEndColorVar.b = 1056964608;
this->m_fEmissionRate = (float)m_uTotalParticles / 12.0;
v10 = sub_180063AC0();
if ( v10 )
((void (__fastcall *)(cocos2d::CCTextureProtocol *, struct cocos2d::CCTexture2D *))this->setTexture)(
&this->cocos2d::CCTextureProtocol,
v10);
((void (__fastcall *)(cocos2d::CCParticleSpiral *, _QWORD))this->setBlendAdditive)(this, 0);
return 1;
}