Moved check for shouldRTL() from engines to scummvm_main

svn-id: r34310
This commit is contained in:
Max Horn 2008-09-03 16:56:40 +00:00
parent e802acca0b
commit d3642080de
21 changed files with 35 additions and 32 deletions

View File

@ -201,8 +201,8 @@ static int runGame(const EnginePlugin *plugin, OSystem &system, const Common::St
// Reset the file/directory mappings
Common::File::resetDefaultDirectories();
// If result=1 return to the launcher, else quit ScummVM
return result;
// Return result (== 0 means no error)
return result;
}
@ -285,16 +285,19 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
// Try to run the game
int result = runGame(plugin, system, specialDebug);
// TODO: We should keep running if starting the selected game failed
// (so instead of just quitting, show a nice error dialog to the
// user and let him pick another game).
// Reset RTL flag in case we want to load another engine
g_system->getEventManager()->resetRTL();
if (result == 0)
// Did an error occur ?
if (result != 0) {
// TODO: Show an informative error dialog if starting the selected game failed.
}
// Quit unless an error occurred, or Return to launcher was requested
if (result == 0 && !g_system->getEventManager()->shouldRTL())
break;
// Reset RTL flag in case we want to load another engine
g_system->getEventManager()->resetRTL();
// Discard any command line options. It's unlikely that the user
// wanted to apply them to *all* games ever launched.
ConfMan.getDomain(Common::ConfigManager::kTransientDomain)->clear();

View File

@ -807,7 +807,7 @@ int AgiEngine::go() {
runGame();
return _eventMan->shouldRTL();
return 0;
}
void AgiEngine::syncSoundSettings() {

View File

@ -227,7 +227,7 @@ FIXME (Fingolfin asks): Why are Mickey, Winnie and Troll standalone classes
error("Unknown preagi engine");
break;
}
return _eventMan->shouldRTL();
return 0;
}
} // End of namespace Agi

View File

@ -1023,7 +1023,7 @@ int AGOSEngine::go() {
delay(100);
}
return _eventMan->shouldRTL();
return 0;
}

View File

@ -101,7 +101,7 @@ int CineEngine::go() {
delete[] collisionPage;
delete g_sound;
return _eventMan->shouldRTL();
return 0;
}
int CineEngine::getTimerDelay() const {

View File

@ -90,7 +90,7 @@ public:
* Start the main engine loop.
* The return value is not yet used, but could indicate whether the user
* wants to return to the launch or to fully quit ScummVM.
* @return a result code
* @return 0 for success, else an error code.
*/
virtual int go() = 0;

View File

@ -112,7 +112,7 @@ GobEngine::~GobEngine() {
int GobEngine::go() {
_init->initGame(0);
return _eventMan->shouldRTL();
return 0;
}
const char *GobEngine::getLangDesc(int16 language) const {

View File

@ -325,7 +325,7 @@ int KyraEngine_HoF::go() {
seq_playSequences(kSequenceFunters, kSequenceFrash);
}
return _eventMan->shouldRTL();
return 0;
}
void KyraEngine_HoF::startup() {

View File

@ -304,7 +304,7 @@ int KyraEngine_LoK::go() {
setGameFlag(0xEF);
seq_intro();
if (quit())
return _eventMan->shouldRTL();
return 0;
if (_skipIntroFlag && _abortIntroFlag)
resetGameFlag(0xEF);
}
@ -312,7 +312,7 @@ int KyraEngine_LoK::go() {
resetGameFlag(0xEF);
mainLoop();
}
return _eventMan->shouldRTL();
return 0;
}

View File

@ -324,7 +324,7 @@ int KyraEngine_MR::go() {
if (_showOutro)
playVQA("CREDITS");
return _eventMan->shouldRTL();
return 0;
}
void KyraEngine_MR::initMainMenu() {

View File

@ -137,7 +137,7 @@ int LureEngine::go() {
bool result = dialog->show();
delete dialog;
if (quit())
return _eventMan->shouldRTL();
return 0;
if (!result)
error("Sorry - copy protection failed");
@ -160,7 +160,7 @@ int LureEngine::go() {
}
delete gameInstance;
return _eventMan->shouldRTL();
return 0;
}
void LureEngine::pauseEngineIntern(bool pause) {

View File

@ -125,7 +125,7 @@ int Parallaction_br::go() {
cleanupGame();
}
return _eventMan->shouldRTL();
return 0;
}

View File

@ -235,7 +235,7 @@ int Parallaction_ns::go() {
runGame();
}
return _eventMan->shouldRTL();
return 0;
}
void Parallaction_ns::switchBackground(const char* background, const char* mask) {

View File

@ -444,7 +444,7 @@ int QueenEngine::go() {
update(true);
}
}
return _eventMan->shouldRTL();
return 0;
}
int QueenEngine::init() {

View File

@ -310,7 +310,7 @@ int SagaEngine::go() {
_system->delayMillis(10);
}
return _eventMan->shouldRTL();
return 0;
}
void SagaEngine::loadStrings(StringsTable &stringsTable, const byte *stringsPointer, size_t stringsLength) {

View File

@ -1756,7 +1756,7 @@ int ScummEngine::go() {
}
}
return _eventMan->shouldRTL();
return 0;
}
void ScummEngine::waitForTimer(int msec_delay) {

View File

@ -426,7 +426,7 @@ int SkyEngine::go() {
_skyMusic->stopMusic();
ConfMan.flushToDisk();
delay(1500);
return _eventMan->shouldRTL();
return 0;
}
int SkyEngine::init() {

View File

@ -727,7 +727,7 @@ int SwordEngine::go() {
}
}
return _eventMan->shouldRTL();
return 0;
}
void SwordEngine::checkCd(void) {

View File

@ -499,7 +499,7 @@ int Sword2Engine::go() {
#endif
}
return _eventMan->shouldRTL();
return 0;
}
void Sword2Engine::restartGame() {

View File

@ -774,7 +774,7 @@ int TinselEngine::go() {
// Write configuration
WriteConfig();
return _eventMan->shouldRTL();
return 0;
}

View File

@ -111,7 +111,7 @@ int ToucheEngine::go() {
res_deallocateTables();
res_closeDataFile();
return _eventMan->shouldRTL();
return 0;
}
void ToucheEngine::restart() {