//
// cocos2d::CCParticleSystem::resetSystem from 0x1007c9df0 to 0x1007c9f5a (362 bytes)
//
// 72 xrefs:
// > LevelEditorLayer::claimCustomParticle @ 0x1000f43ae
// > GJBaseGameLayer::playSpeedParticle @ 0x10015cdf4
// > GJBaseGameLayer::claimCustomParticle @ 0x10015e2cc
// > ParticleGameObject::resetObject @ 0x1001b2c0f
// > ParticleGameObject::updateSyncedAnimation @ 0x1001b2c5a
// > ParticleGameObject::updateSyncedAnimation @ 0x1001b2d5d
// > ParticleGameObject::updateAnimateOnTrigger @ 0x1001b2daf
// > PlayerObject::playDeathEffect @ 0x10020c626
// > PlayerObject::playDeathEffect @ 0x10020cce8
// > PlayerObject::playDeathEffect @ 0x10020d3f6
// > PlayerObject::playDeathEffect @ 0x10020da8e
// > PlayerObject::playDeathEffect @ 0x10020de92
// > PlayerObject::playDeathEffect @ 0x10020e6a8
// > PlayerObject::playDeathEffect @ 0x10020ec46
// > PlayerObject::playDeathEffect @ 0x10020f325
// > PlayerObject::playDeathEffect @ 0x10020f6bd
// > PlayerObject::playDeathEffect @ 0x10020fcd2
// > PlayerObject::playDeathEffect @ 0x10021023b
// > PlayerObject::playDeathEffect @ 0x1002109f8
// > PlayerObject::playDeathEffect @ 0x100210fe4
// > PlayerObject::playDeathEffect @ 0x100211978
// > PlayerObject::playDeathEffect @ 0x100211f35
// > PlayerObject::playDeathEffect @ 0x100212599
// > PlayerObject::playDeathEffect @ 0x100212bf2
// > PlayerObject::playDeathEffect @ 0x100212d95
// > PlayerObject::playDeathEffect @ 0x1002132e1
// > PlayerObject::playCompleteEffect @ 0x100214322
// > GJChestSprite::switchToState @ 0x10021e948
// > GJChestSprite::switchToState @ 0x10021ed40
// > MapSelectLayer::checkTouchMonster @ 0x1002694e2
// > GJDifficultySprite::updateFeatureState @ 0x1002b6fcc
// > GJPathPage::playUnlockAnimation @ 0x100301275
// > GJPathPage::unlockAnimationStep2 @ 0x100301ca7
// > GJPathPage::unlockAnimationStep3 @ 0x100302330
// > GJPathPage::unlockAnimationStep3 @ 0x10030253c
// > GJShopLayer::init @ 0x100323e3a
// > PlayerObject::removeAllParticles @ 0x1003fcd45
// > PlayerObject::toggleVisibility @ 0x100403101
// > PlayerObject::toggleVisibility @ 0x100403205
// > PlayerObject::resetAllParticles @ 0x1004032c5
// > PlayerObject::hitGround @ 0x10040bfcf
// > PlayerObject::playSpiderDashEffect @ 0x10040ec53
// > PlayerObject::spiderTestJumpX @ 0x10040fbd9
// > PlayerObject::spiderTestJumpY @ 0x100410a6f
// > PlayerObject::rotateGameplay @ 0x100412675
// > PlayerObject::toggleFlyMode @ 0x1004165b5
// > PlayerObject::toggleFlyMode @ 0x1004165c1
// > PlayerObject::toggleBirdMode @ 0x100417165
// > PlayerObject::toggleSwingMode @ 0x10041763c
// > PlayerObject::toggleSwingMode @ 0x100417648
// > PlayerObject::toggleSwingMode @ 0x10041777a
// > PlayerObject::toggleSwingMode @ 0x100417786
// > LevelPage::updateDynamicPage @ 0x1004330c8
// > LevelPage::updateDynamicPage @ 0x10043319c
// > LevelPage::updateDynamicPage @ 0x100433283
// > CreateParticlePopup::onDurationForever @ 0x1004753f4
// > CreateParticlePopup::onMaxEmission @ 0x100475444
// > CreateParticlePopup::onCalcEmission @ 0x1004754ef
// > CreateParticlePopup::update @ 0x1004766fb
// > GameToolbox::particleFromStruct @ 0x1004f651c
// > MenuGameLayer::destroyPlayer @ 0x1004fb096
// > GauntletSelectLayer::playUnlockAnimation @ 0x10057347f
// > GauntletSelectLayer::unlockAnimationStep2 @ 0x100573a6a
// > GauntletSelectLayer::unlockAnimationStep3 @ 0x100573d0b
// > GauntletSelectLayer::unlockAnimationStep3 @ 0x100573e85
// > GameObject::setVisible @ 0x1005bca9c
// > cocos2d::CCParticleSystemQuad::setTotalParticles @ 0x100603a98
// > CurrencyRewardLayer::init @ 0x1007a647a
// > CurrencyRewardLayer::init @ 0x1007a688e
// > CurrencyRewardLayer::init @ 0x1007a6c99
// > CurrencyRewardLayer::init @ 0x1007a7046
// > CurrencyRewardLayer::createObjectsFull @ 0x1007a8991
//
// 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 *a1)
{
unsigned int m_uParticleCount; // eax
cocos2d::tCCParticle *m_pParticles; // rcx
__int64 v4; // rsi
_DWORD *p_timeToLive; // r8
__int64 v6; // rcx
__int64 v7; // rsi
cocos2d::CCParticleBatchNode *m_pBatchNode; // rdi
int v9; // r14d
a1->m_bIsActive = 1;
a1->m_bWasRemoved = 0;
a1->m_fElapsed = 0.0;
m_uParticleCount = a1->m_uParticleCount;
if ( m_uParticleCount )
{
m_pParticles = a1->m_pParticles;
if ( m_uParticleCount >= 4 )
{
p_timeToLive = (_DWORD *)&m_pParticles->timeToLive;
v4 = 0;
do
{
*p_timeToLive = 0;
p_timeToLive[37] = 0;
p_timeToLive[74] = 0;
p_timeToLive[111] = 0;
v4 += 4;
p_timeToLive += 148;
}
while ( (m_uParticleCount & 0xFFFFFFFC) != v4 );
}
else
{
v4 = 0;
}
if ( (m_uParticleCount & 3) != 0 )
{
v6 = (__int64)(&m_pParticles->timeToLive + 37 * v4);
v7 = 0;
do
{
*(_DWORD *)(v6 + v7) = 0;
v7 += 148;
}
while ( 148LL * (m_uParticleCount & 3) != v7 );
}
a1->m_uParticleIdx = m_uParticleCount;
m_pBatchNode = a1->m_pBatchNode;
if ( m_pBatchNode )
{
while ( 1 )
{
a1->m_uParticleIdx = m_uParticleCount - 1;
if ( m_pBatchNode )
{
v9 = *((_DWORD *)&a1->m_pParticles->modeA + 37 * m_uParticleCount - 37);
cocos2d::CCParticleBatchNode::disableParticle(m_pBatchNode, v9 + a1->m_uAtlasIndex);
m_uParticleCount = a1->m_uParticleCount;
*((_DWORD *)&a1->m_pParticles->modeA + 37 * m_uParticleCount - 37) = v9;
}
a1->m_uParticleCount = --m_uParticleCount;
if ( !m_uParticleCount )
break;
m_pBatchNode = a1->m_pBatchNode;
}
}
else
{
a1->m_uParticleIdx = 0;
a1->m_uParticleCount = 0;
}
}
else
{
a1->m_uParticleIdx = 0;
}
a1->m_bVisible = 0;
}