//
// cocos2d::CCParticleGalaxy::createWithTotalParticles from 0x180065930 to 0x1800659fa (202 bytes)
//
// 2 xrefs:
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bdc90
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:21:52 +0000
//
struct cocos2d::CCParticleGalaxy *__fastcall cocos2d::CCParticleGalaxy::createWithTotalParticles(unsigned int a1)
{
cocos2d::CCParticleSystemQuad *v2; // rax
cocos2d::CCParticleGalaxy *v3; // rbx
bool (__fastcall *v4)(cocos2d::CCParticleGalaxy *__hidden, unsigned int); // r8
bool v5; // al
cocos2d::CCParticleSystemQuad *(__fastcall *v7)(cocos2d::CCParticleSystemQuad *, char); // r8
v2 = (cocos2d::CCParticleSystemQuad *)sub_1800E4AC0(0x348u);
v3 = v2;
if ( v2 )
{
cocos2d::CCParticleSystemQuad::CCParticleSystemQuad(v2);
*(_QWORD *)v3 = &cocos2d::CCParticleGalaxy::`vftable'{for `cocos2d::CCNode'};
*((_QWORD *)v3 + 40) = &cocos2d::CCParticleGalaxy::`vftable'{for `cocos2d::CCTextureProtocol'};
}
else
{
v3 = nullptr;
}
if ( v3 )
{
v4 = *(bool (__fastcall **)(cocos2d::CCParticleGalaxy *__hidden, unsigned int))(*(_QWORD *)v3 + 1608LL);
if ( v4 == cocos2d::CCParticleGalaxy::initWithTotalParticles )
v5 = cocos2d::CCParticleGalaxy::initWithTotalParticles(v3, a1);
else
v5 = v4(v3, a1);
if ( v5 )
{
cocos2d::CCObject::autorelease(v3);
return v3;
}
v7 = *(cocos2d::CCParticleSystemQuad *(__fastcall **)(cocos2d::CCParticleSystemQuad *, char))(*(_QWORD *)v3 + 8LL);
if ( v7 == sub_180064950 )
{
sub_180064950(v3, 1);
return nullptr;
}
v7(v3, 1);
return nullptr;
}
return v3;
}