//
// PlayLayer::resumeAndRestart from 0x1000bf410 to 0x1000bf5bc (428 bytes)
//
// 2 xrefs:
// > PauseLayer::onRestartFull @ 0x1003d72af
// > PauseLayer::onRestart @ 0x1003d74dc
//
// 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::resumeAndRestart(PlayLayer *a1, bool a2)
{
FMODAudioEngine *v2; // rax
FMODAudioEngine *v3; // rax
FMODAudioEngine *v4; // rax
GameManager *v5; // rax
GameManager *v6; // rax
GameManager *v7; // rax
bool GameVariable; // r15
GameManager *v9; // rax
FMODAudioEngine *v10; // rax
GameManager *v11; // rax
if ( !a1->m_isPracticeMode || a1->m_practiceMusicSync )
{
if ( a2 || !a1->m_isPlatformer )
{
GJBaseGameLayer::resetAudio(a1);
}
else
{
v2 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllEffects(v2);
v3 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v3, 0);
}
a1->m_musicPrepared = 0;
v4 = FMODAudioEngine::sharedEngine();
a1->m_isSilent = FMODAudioEngine::getBackgroundMusicVolume(v4) <= 0.0;
}
a1->m_isPaused = 0;
if ( AppDelegate::get()->m_gamePaused )
{
AppDelegate::get()->m_gamePaused = 0;
PlayerObject::releaseAllButtons(a1->m_player1);
UILayer::resetAllButtons(a1->m_uiLayer);
UILayer::toggleMenuVisibility(a1->m_uiLayer, 1);
v5 = GameManager::sharedState();
if ( GameManager::getGameVariable(v5, "0128") )
{
PlatformToolbox::toggleLockCursor(1);
}
else
{
v6 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v6, "0024") )
PlatformToolbox::hideCursor();
}
((void (__fastcall *)(PlayLayer *))a1->onEnter)(a1);
if ( a2 )
{
v7 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v7, "0146");
v9 = GameManager::sharedState();
GameManager::setGameVariable(v9, "0146", 1);
((void (__fastcall *)(PlayLayer *))a1->removeAllCheckpoints)(a1);
v10 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v10, 1);
a1->m_freezeStartCamera = 1;
((void (__fastcall *)(PlayLayer *))a1->resetLevel)(a1);
v11 = GameManager::sharedState();
GameManager::setGameVariable(v11, "0146", GameVariable);
}
else
{
((void (__fastcall *)(PlayLayer *))a1->resetLevel)(a1);
}
}
}