//
// PlayLayer::resumeAndRestart from 0x6f7314 to 0x6f746c (344 bytes)
//
// 3 xrefs:
// > PauseLayer::onRestart @ 0x7d5724
// > PauseLayer::onRestartFull @ 0x7d57a4
// > ??> @ 0x57028
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:51:51 +0000
//
__int64 __fastcall PlayLayer::resumeAndRestart(UILayer **this, unsigned __int8 a2)
{
char *v2; // x20
int v4; // w21
unsigned __int64 v5; // x0
FMODAudioEngine *v6; // x0
FMODAudioEngine *v7; // x0
__int64 result; // x0
GameManager *v9; // x0
GameManager *v10; // x0
GameManager *GameVariable; // x0
GameManager *v12; // x0
PlatformToolbox *v13; // x0
FMOD::ChannelControl **v14; // x0
FMODAudioEngine *v15; // x0
FMODAudioEngine *v16; // x0
v2 = (char *)(this + 1536);
v4 = a2;
if ( !*((_BYTE *)this + 12544) || (v5 = *((unsigned __int8 *)this + 12545), v2[257]) )
{
if ( !a2 && *((_BYTE *)this + 12238) )
{
v14 = (FMOD::ChannelControl **)FMODAudioEngine::sharedEngine((FMODAudioEngine *)*((unsigned __int8 *)this + 12238));
v15 = (FMODAudioEngine *)FMODAudioEngine::stopAllEffects(v14);
v16 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v15);
v6 = (FMODAudioEngine *)FMODAudioEngine::stopAllMusic(v16, 0);
}
else
{
v6 = (FMODAudioEngine *)GJBaseGameLayer::resetAudio((GJBaseGameLayer *)this);
}
v2[2592] = 0;
v7 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v6);
v5 = FMODAudioEngine::getBackgroundMusicVolume(v7) <= 0.0;
v2[2000] = v5;
}
v2[2463] = 0;
*((_BYTE *)this + 1982) = 0;
result = *(unsigned __int8 *)(AppDelegate::get((AppDelegate *)v5) + 17);
if ( (_DWORD)result )
{
*(_BYTE *)(AppDelegate::get((AppDelegate *)result) + 17) = 0;
PlayLayer::releaseAllPlayerButtons(this);
UILayer::resetAllButtons(*(this + 1661));
v9 = (GameManager *)UILayer::toggleMenuVisibility(*(this + 1661), 1u);
v10 = (GameManager *)GameManager::sharedState(v9);
GameVariable = (GameManager *)(unsigned __int8)GameManager::getGameVariable(v10, "0128");
if ( (_BYTE)GameVariable )
{
PlatformToolbox::toggleLockCursor((PlatformToolbox *)((char *)&dword_0 + 1));
(*((void (__fastcall **)(UILayer **))*this + 88))(this);
if ( !v4 )
return (*((__int64 (__fastcall **)(UILayer **))*this + 201))(this);
}
else
{
v12 = (GameManager *)GameManager::sharedState(GameVariable);
v13 = (PlatformToolbox *)(unsigned __int8)GameManager::getGameVariable(v12, "0024");
if ( !(_BYTE)v13 )
PlatformToolbox::hideCursor(v13);
(*((void (__fastcall **)(UILayer **))*this + 88))(this);
if ( !v4 )
return (*((__int64 (__fastcall **)(UILayer **))*this + 201))(this);
}
return PlayLayer::resetLevelFromStart((PlayLayer *)this);
}
return result;
}