//
// cocos2d::CCParticleSystem::resetSystem from 0x180068e90 to 0x180068f9a (266 bytes)
//
// 5 xrefs:
// > cocos2d::CCParticleSystemQuad::setTotalParticles @ 0x18006aec3
// > ??> @ 0x180139f5c
// > ??> @ 0x180139f6c
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b3c0c
//
// 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
//
void __fastcall cocos2d::CCParticleSystem::resetSystem(cocos2d::CCParticleSystem *this)
{
unsigned int m_uParticleCount; // eax
unsigned int v3; // ecx
unsigned int v4; // eax
__int64 v5; // rax
int v6; // edi
cocos2d::CCParticleBatchNode *m_pBatchNode; // rcx
m_uParticleCount = this->m_uParticleCount;
this->m_bIsActive = 1;
this->m_bWasRemoved = 0;
this->m_fElapsed = 0.0;
this->m_uParticleIdx = 0;
if ( m_uParticleCount )
{
v3 = 0;
do
{
*((_DWORD *)&this->m_pParticles->timeToLive + 37 * v3) = 0;
v3 = this->m_uParticleIdx + 1;
this->m_uParticleIdx = v3;
v4 = this->m_uParticleCount;
}
while ( v3 < v4 );
for ( ; v4; this->m_uParticleCount = v4 )
{
v5 = v4 - 1;
this->m_uParticleIdx = v5;
v6 = *((_DWORD *)&this->m_pParticles->modeA.dir.x + 37 * v5);
m_pBatchNode = this->m_pBatchNode;
if ( m_pBatchNode )
{
cocos2d::CCParticleBatchNode::disableParticle(m_pBatchNode, v6 + this->m_uAtlasIndex);
*((_DWORD *)&this->m_pParticles->modeA.dir.x + 37 * (this->m_uParticleCount - 1)) = v6;
}
v4 = this->m_uParticleCount - 1;
}
}
this->m_bVisible = 0;
}