aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-09-03 16:56:40 +0000
committerMax Horn2008-09-03 16:56:40 +0000
commitd3642080def2d9ae5035724dab00565547a52a5e (patch)
tree315221bf3ab0185c4b885e1bf1f111d117a42664
parente802acca0b09a8e0475dbfbe2e6f6a865072e26d (diff)
downloadscummvm-rg350-d3642080def2d9ae5035724dab00565547a52a5e.tar.gz
scummvm-rg350-d3642080def2d9ae5035724dab00565547a52a5e.tar.bz2
scummvm-rg350-d3642080def2d9ae5035724dab00565547a52a5e.zip
Moved check for shouldRTL() from engines to scummvm_main
svn-id: r34310
-rw-r--r--base/main.cpp23
-rw-r--r--engines/agi/agi.cpp2
-rw-r--r--engines/agi/preagi.cpp2
-rw-r--r--engines/agos/agos.cpp2
-rw-r--r--engines/cine/cine.cpp2
-rw-r--r--engines/engine.h2
-rw-r--r--engines/gob/gob.cpp2
-rw-r--r--engines/kyra/kyra_hof.cpp2
-rw-r--r--engines/kyra/kyra_lok.cpp4
-rw-r--r--engines/kyra/kyra_mr.cpp2
-rw-r--r--engines/lure/lure.cpp4
-rw-r--r--engines/parallaction/parallaction_br.cpp2
-rw-r--r--engines/parallaction/parallaction_ns.cpp2
-rw-r--r--engines/queen/queen.cpp2
-rw-r--r--engines/saga/saga.cpp2
-rw-r--r--engines/scumm/scumm.cpp2
-rw-r--r--engines/sky/sky.cpp2
-rw-r--r--engines/sword1/sword1.cpp2
-rw-r--r--engines/sword2/sword2.cpp2
-rw-r--r--engines/tinsel/tinsel.cpp2
-rw-r--r--engines/touche/touche.cpp2
21 files changed, 35 insertions, 32 deletions
diff --git a/base/main.cpp b/base/main.cpp
index 7337c94a40..822df125b8 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -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();
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index fc09e8ab09..a17bdc50cf 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -807,7 +807,7 @@ int AgiEngine::go() {
runGame();
- return _eventMan->shouldRTL();
+ return 0;
}
void AgiEngine::syncSoundSettings() {
diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp
index f391cd974a..666d1b1b11 100644
--- a/engines/agi/preagi.cpp
+++ b/engines/agi/preagi.cpp
@@ -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
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 7d03156bb6..ec496fd285 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -1023,7 +1023,7 @@ int AGOSEngine::go() {
delay(100);
}
- return _eventMan->shouldRTL();
+ return 0;
}
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index ea4b2512f5..2c0fdc7d88 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -101,7 +101,7 @@ int CineEngine::go() {
delete[] collisionPage;
delete g_sound;
- return _eventMan->shouldRTL();
+ return 0;
}
int CineEngine::getTimerDelay() const {
diff --git a/engines/engine.h b/engines/engine.h
index d2f0849b51..a8e759e274 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -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;
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index bfe0756307..7e364e891d 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -112,7 +112,7 @@ GobEngine::~GobEngine() {
int GobEngine::go() {
_init->initGame(0);
- return _eventMan->shouldRTL();
+ return 0;
}
const char *GobEngine::getLangDesc(int16 language) const {
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index 086d8d6913..2c418e43e3 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -325,7 +325,7 @@ int KyraEngine_HoF::go() {
seq_playSequences(kSequenceFunters, kSequenceFrash);
}
- return _eventMan->shouldRTL();
+ return 0;
}
void KyraEngine_HoF::startup() {
diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp
index b6c874339c..59127d62ad 100644
--- a/engines/kyra/kyra_lok.cpp
+++ b/engines/kyra/kyra_lok.cpp
@@ -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;
}
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index 5bc843d8a8..9e26d5436b 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -324,7 +324,7 @@ int KyraEngine_MR::go() {
if (_showOutro)
playVQA("CREDITS");
- return _eventMan->shouldRTL();
+ return 0;
}
void KyraEngine_MR::initMainMenu() {
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index 335f3384a1..8cd76cbc73 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -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) {
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index c2111777fe..a06fba43f9 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -125,7 +125,7 @@ int Parallaction_br::go() {
cleanupGame();
}
- return _eventMan->shouldRTL();
+ return 0;
}
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index e0c86a4e37..8e11931c28 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -235,7 +235,7 @@ int Parallaction_ns::go() {
runGame();
}
- return _eventMan->shouldRTL();
+ return 0;
}
void Parallaction_ns::switchBackground(const char* background, const char* mask) {
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index d8dc9e2fe8..a73eedaf4f 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -444,7 +444,7 @@ int QueenEngine::go() {
update(true);
}
}
- return _eventMan->shouldRTL();
+ return 0;
}
int QueenEngine::init() {
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index aa3624acea..79e2fd9ac6 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -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) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index b11d0a18f4..a1365d5346 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1756,7 +1756,7 @@ int ScummEngine::go() {
}
}
- return _eventMan->shouldRTL();
+ return 0;
}
void ScummEngine::waitForTimer(int msec_delay) {
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index 594e7a6aaf..0900ba5617 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -426,7 +426,7 @@ int SkyEngine::go() {
_skyMusic->stopMusic();
ConfMan.flushToDisk();
delay(1500);
- return _eventMan->shouldRTL();
+ return 0;
}
int SkyEngine::init() {
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index e78d4fb628..ab6430d6fc 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -727,7 +727,7 @@ int SwordEngine::go() {
}
}
- return _eventMan->shouldRTL();
+ return 0;
}
void SwordEngine::checkCd(void) {
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 0d6c486260..a171cc0c41 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -499,7 +499,7 @@ int Sword2Engine::go() {
#endif
}
- return _eventMan->shouldRTL();
+ return 0;
}
void Sword2Engine::restartGame() {
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 092fae4be4..7fb949704a 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -774,7 +774,7 @@ int TinselEngine::go() {
// Write configuration
WriteConfig();
- return _eventMan->shouldRTL();
+ return 0;
}
diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp
index d1d7528517..e122187dcd 100644
--- a/engines/touche/touche.cpp
+++ b/engines/touche/touche.cpp
@@ -111,7 +111,7 @@ int ToucheEngine::go() {
res_deallocateTables();
res_closeDataFile();
- return _eventMan->shouldRTL();
+ return 0;
}
void ToucheEngine::restart() {