//
// cocos2d::CCDirector::purgeDirector from 0x100484700 to 0x100484833 (307 bytes)
//
// 1 xrefs:
// > cocos2d::CCDisplayLinkDirector::mainLoop @ 0x100484cb0
//
// 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::CCDirector::purgeDirector(cocos2d::CCDirector *a1)
{
cocos2d::CCScheduler *v2; // rax
cocos2d::CCObject **p_m_pRunningScene; // r14
cocos2d::CCScene *m_pRunningScene; // rdi
cocos2d::CCLabelAtlas *m_pFPSLabel; // rdi
cocos2d::CCLabelAtlas *m_pSPFLabel; // rdi
cocos2d::CCLabelAtlas *m_pDrawsLabel; // rdi
v2 = (cocos2d::CCScheduler *)((__int64 (__fastcall *)(cocos2d::CCDirector *))a1->getScheduler)(a1);
cocos2d::CCScheduler::unscheduleAll(v2);
cocos2d::CCTouchDispatcher::removeAllDelegates(a1->m_pTouchDispatcher);
p_m_pRunningScene = &a1->m_pRunningScene;
m_pRunningScene = a1->m_pRunningScene;
if ( m_pRunningScene )
{
((void (__fastcall *)(cocos2d::CCScene *))m_pRunningScene->onExitTransitionDidStart)(m_pRunningScene);
((void (__fastcall *)(cocos2d::CCObject *))(*p_m_pRunningScene)->__vftable[8].getTag)(*p_m_pRunningScene);
((void (__fastcall *)(cocos2d::CCObject *))(*p_m_pRunningScene)->__vftable[9].copyWithZone)(*p_m_pRunningScene);
cocos2d::CCObject::release(*p_m_pRunningScene);
}
a1->m_pSceneReference = nullptr;
*(_OWORD *)p_m_pRunningScene = 0;
sub_100720270(a1->m_pobScenesStack);
((void (__fastcall *)(cocos2d::CCDirector *))a1->stopAnimation)(a1);
m_pFPSLabel = a1->m_pFPSLabel;
if ( m_pFPSLabel )
{
cocos2d::CCObject::release(m_pFPSLabel);
a1->m_pFPSLabel = nullptr;
}
m_pSPFLabel = a1->m_pSPFLabel;
if ( m_pSPFLabel )
{
cocos2d::CCObject::release(m_pSPFLabel);
a1->m_pSPFLabel = nullptr;
}
m_pDrawsLabel = a1->m_pDrawsLabel;
if ( m_pDrawsLabel )
{
cocos2d::CCObject::release(m_pDrawsLabel);
a1->m_pDrawsLabel = nullptr;
}
cocos2d::CCLabelBMFont::purgeCachedData();
cocos2d::ccDrawFree();
cocos2d::CCAnimationCache::purgeSharedAnimationCache();
cocos2d::CCSpriteFrameCache::purgeSharedSpriteFrameCache();
cocos2d::CCTextureCache::purgeSharedTextureCache();
cocos2d::CCShaderCache::purgeSharedShaderCache();
cocos2d::CCFileUtils::purgeFileUtils();
cocos2d::CCConfiguration::purgeConfiguration();
cocos2d::CCUserDefault::purgeSharedUserDefault();
cocos2d::CCNotificationCenter::purgeNotificationCenter();
cocos2d::ccGLInvalidateStateCache();
((void (__fastcall *)(cocos2d::CCEGLView *))a1->m_pobOpenGLView->end)(a1->m_pobOpenGLView);
a1->m_pobOpenGLView = nullptr;
cocos2d::CCObject::release(a1);
}