//
// AppDelegate::trySaveGame from 0x5bddb8 to 0x5bdeb0 (248 bytes)
//
// 2 xrefs:
// > ??> @ 0x52878
// > ??> @ 0x11455a8
//
// 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 AppDelegate::trySaveGame(AppDelegate *a1, bool a2)
{
GameManager *v3; // x0
LocalLevelManager *v4; // x0
float v5; // s0
__int64 v6; // [xsp+28h] [xbp+28h] BYREF
__int64 v7; // [xsp+30h] [xbp+30h]
if ( a2 )
{
LODWORD(a1->m_runningScene) = 0;
goto LABEL_3;
}
if ( *(float *)&a1->m_runningScene == 0.0 )
{
LABEL_3:
if ( !a1->m_glViewSetup )
{
LABEL_4:
PlatformToolbox::gameDidSave();
return;
}
LABEL_9:
v3 = GameManager::sharedState();
GManager::save(v3);
v4 = LocalLevelManager::sharedState();
GManager::save(v4);
clock_gettime(0, (struct timespec *)&v6);
v5 = (double)v6 + (double)v7 / 1000000000.0;
*(float *)&a1->m_runningScene = v5;
goto LABEL_4;
}
clock_gettime(0, (struct timespec *)&v6);
if ( (double)v6 + (double)v7 / 1000000000.0 - *(float *)&a1->m_runningScene >= 10.0 )
{
if ( !a1->m_glViewSetup )
goto LABEL_4;
goto LABEL_9;
}
}