//
// PlayLayer::resumeAndRestart from 0x100122924 to 0x100122a64 (320 bytes)
//
// 2 xrefs:
// > PauseLayer::onRestartFull @ 0x100143310
// > PauseLayer::onRestart @ 0x1001434cc
//
// 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)
{
_BOOL4 v2; // w20
bool *p_m_isPlatformer; // x21
FMODAudioEngine *v5; // x0
FMODAudioEngine *v6; // x0
FMODAudioEngine *v7; // x0
GameManager *v8; // x0
GameManager *v9; // x0
v2 = a2;
p_m_isPlatformer = &a1->m_isPlatformer;
if ( !a1->m_isPracticeMode || a1->m_practiceMusicSync )
{
if ( a2 || !*p_m_isPlatformer )
{
GJBaseGameLayer::resetAudio(a1);
}
else
{
v5 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllEffects(v5);
v6 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v6, 0);
}
p_m_isPlatformer[2298] = 0;
v7 = FMODAudioEngine::sharedEngine();
p_m_isPlatformer[1874] = FMODAudioEngine::getBackgroundMusicVolume(v7) <= 0.0;
}
p_m_isPlatformer[2169] = 0;
if ( AppDelegate::get()->m_resourceRootPath.m_data.m_short.shortStorage.__elems_[8] == 1 )
{
AppDelegate::get()->m_resourceRootPath.m_data.m_short.shortStorage.__elems_[8] = 0;
PlayerObject::releaseAllButtons(a1->m_player1);
UILayer::resetAllButtons(a1->m_uiLayer);
UILayer::toggleMenuVisibility(a1->m_uiLayer, 1);
v8 = GameManager::sharedState();
if ( GameManager::getGameVariable(v8, "0128") )
{
PlatformToolbox::toggleLockCursor(1);
}
else
{
v9 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v9, "0024") )
PlatformToolbox::hideCursor();
}
((void (__fastcall *)(PlayLayer *))a1->onEnter)(a1);
if ( v2 )
PlayLayer::resetLevelFromStart(a1);
else
((void (__fastcall *)(PlayLayer *))a1->resetLevel)(a1);
}
}