aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMax Horn2008-09-03 16:56:40 +0000
committerMax Horn2008-09-03 16:56:40 +0000
commitd3642080def2d9ae5035724dab00565547a52a5e (patch)
tree315221bf3ab0185c4b885e1bf1f111d117a42664 /base
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
Diffstat (limited to 'base')
-rw-r--r--base/main.cpp23
1 files changed, 13 insertions, 10 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();