//
// PlayLayer::pauseGame from 0x1000bf2c0 to 0x1000bf406 (326 bytes)
//
// 4 xrefs:
// > UILayer::doPause @ 0x1004c9715
// > AppDelegate::applicationWillResignActive @ 0x10065c2de
// > AppDelegate::pauseGame @ 0x10065c34e
// > AppDelegate::applicationDidEnterBackground @ 0x10065c403
//
// 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 PlayLayer::pauseGame(PlayLayer *a1, bool a2)
{
PauseLayer *v2; // rbx
__int64 v3; // rax
timeb v4; // [rsp-28h] [rbp-28h] BYREF
if ( !a1->m_levelEndAnimationStarted && !a1->m_hasCompletedLevel && !AppDelegate::get()->m_gamePaused )
{
((void (__fastcall *)(PlayLayer *, float))a1->applyTimeWarp)(a1, 1.0);
a1->m_isPaused = 1;
*(_OWORD *)&a1->m_unk38b0 = 0;
a1->m_unk38c0 = 0.0;
ftime(&v4);
a1->m_pauseTime = (double)(v4.millitm + 1000 * (v4.time & 0xFFFFF)) / 1000.0;
cocos2d::CCDirector::sharedDirector()->m_bSmoothFixCheck = 0;
PlatformToolbox::showCursor();
GJBaseGameLayer::processQueuedButtons(a1, 0.0, 1);
PlayerObject::releaseAllButtons(a1->m_player1);
GJBaseGameLayer::pauseAudio(a1);
GameManager::sharedState();
PlayerObject::releaseAllButtons(a1->m_player1);
UILayer::resetAllButtons(a1->m_uiLayer);
UILayer::toggleMenuVisibility(a1->m_uiLayer, 0);
v2 = PauseLayer::create(a2);
v3 = ((__int64 (__fastcall *)(PlayLayer *))a1->getParent)(a1);
(*(void (__fastcall **)(__int64, PauseLayer *, __int64))(*(_QWORD *)v3 + 448LL))(v3, v2, 10);
((void (__fastcall *)(PlayLayer *))a1->onExit)(a1);
}
}