//
// CCAnimatedSprite::cleanupSprite from 0x570608 to 0x5706a8 (160 bytes)
//
// 2 xrefs:
// > CCAnimatedSprite::loadType @ 0x5707b0
// > ??> @ 0x52a70
//
// 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 CCAnimatedSprite::cleanupSprite(CCAnimatedSprite *a1)
{
CCPartAnimSprite *m_paSprite; // x0
cocos2d::CCSprite *m_fbfSprite; // x0
SpriteAnimationManager *m_animationManager; // x0
cocos2d::CCSprite *v5; // x0
CCPartAnimSprite *v6; // x0
m_paSprite = a1->m_paSprite;
if ( m_paSprite )
m_paSprite->cleanup(m_paSprite);
m_fbfSprite = a1->m_fbfSprite;
if ( m_fbfSprite )
{
m_fbfSprite->cleanup(m_fbfSprite);
m_animationManager = a1->m_animationManager;
if ( !m_animationManager )
goto LABEL_6;
}
else
{
m_animationManager = a1->m_animationManager;
if ( !m_animationManager )
goto LABEL_8;
}
SpriteAnimationManager::doCleanup(m_animationManager);
LABEL_6:
v5 = a1->m_fbfSprite;
if ( v5 )
v5->removeFromParentAndCleanup(v5, 1);
LABEL_8:
v6 = a1->m_paSprite;
if ( v6 )
v6->removeFromParentAndCleanup(v6, 1);
a1->m_spriteMode = 0;
a1->m_animationManager = nullptr;
a1->m_fbfSprite = nullptr;
a1->m_paSprite = nullptr;
a1->m_sprite = nullptr;
}