//
// AppDelegate::applicationDidEnterBackground from 0x10065c360 to 0x10065c453 (243 bytes)
//
// 1 xrefs:
// > ??> @ 0x100986b30
//
// 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 AppDelegate::applicationDidEnterBackground(AppDelegate *a1)
{
FMODAudioEngine *v1; // rax
FMODAudioEngine *v2; // rax
FMODAudioEngine *v3; // rax
FMODAudioEngine *v4; // rax
cocos2d::CCScene *m_pRunningScene; // rax
GameManager *v6; // rax
cocos2d::CCDirector *v7; // rax
cocos2d::CCDirector *v8; // rax
GameManager *v9; // rax
v1 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::pauseAllEffects(v1);
if ( a1->m_loadingFinished )
{
v2 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::pauseAllMusic(v2, 1);
}
v3 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stop(v3);
v4 = FMODAudioEngine::sharedEngine();
((void (__fastcall *)(FMODAudioEngine *, double))v4->update)(v4, 0.0);
m_pRunningScene = cocos2d::CCDirector::sharedDirector()->m_pRunningScene;
if ( m_pRunningScene
&& m_pRunningScene->m_eObjType == PlayLayerObjectType
&& GameManager::sharedState()->m_playLayer
&& !GameManager::sharedState()->m_playLayer->m_hasCompletedLevel
&& !cocos2d::CCApplication::sharedApplication()[1].m_resourceRootPath.m_data.m_short.shortStorage.__elems_[0] )
{
v6 = GameManager::sharedState();
PlayLayer::pauseGame(v6->m_playLayer, 1);
}
((void (__fastcall *)(AppDelegate *, _QWORD))a1->trySaveGame)(a1, 0);
v7 = cocos2d::CCDirector::sharedDirector();
((void (__fastcall *)(cocos2d::CCDirector *))v7->stopAnimation)(v7);
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::pause(v8);
if ( a1->m_loadingFinished )
{
PlatformToolbox::onNativePause();
v9 = GameManager::sharedState();
GameManager::applicationDidEnterBackground(v9);
}
}