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 // CCContainer implementation
TInt CCContainer::LoopCallBack(TAny*) { TInt CCContainer::LoopCallBack(TAny*) {
if (!WindowInfo.Exists) { cc_bool run = false;
Window_RequestClose(); for (;;) {
container->iAppUi->Exit(); if (!WindowInfo.Exists) {
return EFalse; Window_RequestClose();
} container->iAppUi->Exit();
return EFalse;
// launcher -> game -> launcher -> ... loop
launcher:
if (!gameRunning) {
if (Launcher_Tick()) {
return ETrue;
} }
Launcher_Finish();
if (run) {
// run game run = false;
gameRunning = true; ProcessProgramArgs(0, 0);
Game_Setup(); Game_Setup();
container->RestartTimerL(100); gameRunning = true;
container->RestartTimerL(100);
}
if (!gameRunning) {
if (Launcher_Tick()) break;
Launcher_Finish();
run = true;
continue;
}
if (!Game_Running) {
gameRunning = false;
Game_Free();
// Launcher_Setup();
// container->RestartTimerL(10000);
WindowInfo.Exists = false;
continue;
}
Game_RenderFrame();
break;
} }
if (!Game_Running) {
// return to launcher
gameRunning = false;
Game_Free();
Launcher_Setup();
container->RestartTimerL(10000);
goto launcher;
}
Game_RenderFrame();
return ETrue; return ETrue;
} }