Symbian: rewrite main loop

This commit is contained in:
Shinovon 2025-07-24 12:54:13 +05:00
parent e6644af301
commit aa11859bda

View File

@ -485,35 +485,41 @@ void CCAppUi::HandleCommandL(TInt aCommand) {
// CCContainer implementation
TInt CCContainer::LoopCallBack(TAny*) {
cc_bool run = false;
for (;;) {
if (!WindowInfo.Exists) {
Window_RequestClose();
container->iAppUi->Exit();
return EFalse;
}
// launcher -> game -> launcher -> ... loop
launcher:
if (!gameRunning) {
if (Launcher_Tick()) {
return ETrue;
}
Launcher_Finish();
// run game
gameRunning = true;
if (run) {
run = false;
ProcessProgramArgs(0, 0);
Game_Setup();
gameRunning = true;
container->RestartTimerL(100);
}
if (!gameRunning) {
if (Launcher_Tick()) break;
Launcher_Finish();
run = true;
continue;
}
if (!Game_Running) {
// return to launcher
gameRunning = false;
Game_Free();
Launcher_Setup();
container->RestartTimerL(10000);
goto launcher;
// Launcher_Setup();
// container->RestartTimerL(10000);
WindowInfo.Exists = false;
continue;
}
Game_RenderFrame();
break;
}
return ETrue;
}