//
// PlayLayer::togglePracticeMode from 0x1000be100 to 0x1000be29a (410 bytes)
//
// 4 xrefs:
// > PlayLayer::fullReset @ 0x1000be02a
// > PauseLayer::onPracticeMode @ 0x1003d72f6
// > PauseLayer::onNormalMode @ 0x1003d7347
// > PauseLayer::keyDown @ 0x1003d7b5a
//
// 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::togglePracticeMode(PlayLayer *a1, bool a2)
{
unsigned __int8 v2; // r15
FMODAudioEngine *v3; // rax
FMODAudioEngine *v4; // r14
GameManager *v5; // rax
GameManager *v6; // rax
bool GameVariable; // r15
GameManager *v8; // rax
FMODAudioEngine *v9; // rax
GameManager *v10; // rax
_BYTE v11[16]; // [rsp+0h] [rbp-30h] BYREF
void *__p; // [rsp+10h] [rbp-20h]
if ( a1->m_isPracticeMode != a2 )
{
a1->m_isPracticeMode = a2;
v2 = 1;
if ( !a2 || !a1->m_isDebugDrawEnabled )
v2 = a1->m_hitboxesOnDeath && a1->m_playerDied;
if ( v2 != ((unsigned __int8 (__fastcall *)(cocos2d::CCDrawNode *))a1->m_debugDrawNode->isVisible)(a1->m_debugDrawNode) )
{
cocos2d::CCDrawNode::clear(a1->m_debugDrawNode);
((void (__fastcall *)(cocos2d::CCDrawNode *, _QWORD))a1->m_debugDrawNode->setVisible)(a1->m_debugDrawNode, v2);
if ( v2 )
((void (__fastcall *)(PlayLayer *))a1->updateDebugDraw)(a1);
}
UILayer::toggleCheckpointsMenu(a1->m_uiLayer, a2);
if ( a2 )
{
if ( !a1->m_practiceMusicSync )
{
v3 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v3, 1);
v4 = FMODAudioEngine::sharedEngine();
v5 = GameManager::sharedState();
GameManager::getPracticeMusicFile(v11, v5);
FMODAudioEngine::playMusic(v4, v11, 1, 0, 0.0);
if ( (v11[0] & 1) != 0 )
operator delete(__p);
}
}
else
{
v6 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v6, "0146");
v8 = GameManager::sharedState();
GameManager::setGameVariable(v8, "0146", 1);
((void (__fastcall *)(PlayLayer *))a1->removeAllCheckpoints)(a1);
v9 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v9, 1);
a1->m_freezeStartCamera = 1;
((void (__fastcall *)(PlayLayer *))a1->resetLevel)(a1);
v10 = GameManager::sharedState();
GameManager::setGameVariable(v10, "0146", GameVariable);
}
if ( a1->m_isPracticeMode )
cocos2d::CCNode::stopActionByTag(a1, 31);
}
}