mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-08-03 18:57:27 -04:00
Symbian: rewrite main loop
This commit is contained in:
parent
e6644af301
commit
aa11859bda
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user