mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-08-04 03:07:07 -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
|
// CCContainer implementation
|
||||||
TInt CCContainer::LoopCallBack(TAny*) {
|
TInt CCContainer::LoopCallBack(TAny*) {
|
||||||
|
cc_bool run = false;
|
||||||
|
for (;;) {
|
||||||
if (!WindowInfo.Exists) {
|
if (!WindowInfo.Exists) {
|
||||||
Window_RequestClose();
|
Window_RequestClose();
|
||||||
container->iAppUi->Exit();
|
container->iAppUi->Exit();
|
||||||
return EFalse;
|
return EFalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
// launcher -> game -> launcher -> ... loop
|
if (run) {
|
||||||
launcher:
|
run = false;
|
||||||
if (!gameRunning) {
|
ProcessProgramArgs(0, 0);
|
||||||
if (Launcher_Tick()) {
|
|
||||||
return ETrue;
|
|
||||||
}
|
|
||||||
Launcher_Finish();
|
|
||||||
|
|
||||||
// run game
|
|
||||||
gameRunning = true;
|
|
||||||
Game_Setup();
|
Game_Setup();
|
||||||
|
gameRunning = true;
|
||||||
container->RestartTimerL(100);
|
container->RestartTimerL(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!gameRunning) {
|
||||||
|
if (Launcher_Tick()) break;
|
||||||
|
Launcher_Finish();
|
||||||
|
run = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Game_Running) {
|
if (!Game_Running) {
|
||||||
// return to launcher
|
|
||||||
gameRunning = false;
|
gameRunning = false;
|
||||||
Game_Free();
|
Game_Free();
|
||||||
Launcher_Setup();
|
// Launcher_Setup();
|
||||||
container->RestartTimerL(10000);
|
// container->RestartTimerL(10000);
|
||||||
goto launcher;
|
WindowInfo.Exists = false;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Game_RenderFrame();
|
Game_RenderFrame();
|
||||||
|
break;
|
||||||
|
}
|
||||||
return ETrue;
|
return ETrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user