aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJamieson Christian2003-06-11 18:34:37 +0000
committerJamieson Christian2003-06-11 18:34:37 +0000
commitfdf69876ae458426c83ebbffa500b589590b255b (patch)
treee10cff70b013abb3997c830ba6ac9348d2d9d9e4 /common
parenteb23eb1cd78e4a5bc2c81ae0cc631e0e7c613c08 (diff)
downloadscummvm-rg350-fdf69876ae458426c83ebbffa500b589590b255b.tar.gz
scummvm-rg350-fdf69876ae458426c83ebbffa500b589590b255b.tar.bz2
scummvm-rg350-fdf69876ae458426c83ebbffa500b589590b255b.zip
Fixed command line options being ignored when the launcher is used.
Again, I hope I'm manipulating the domain-based config architecture correctly. I've created yet another transient domain called "_COMMAND_LINE", so that after game-specific options are loaded, the command line options can be loaded and override the config file. GUI options are then loaded so as to override command line options. svn-id: r8437
Diffstat (limited to 'common')
-rw-r--r--common/gameDetector.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index 5192371591..ca943f6797 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -310,8 +310,9 @@ void GameDetector::parseCommandLine(int argc, char **argv) {
char c;
_save_slot = -1;
- /* Parse the arguments */
- // FIXME: Add more lemons
+ // Parse the arguments
+ // into a transient "_COMMAND_LINE" config comain.
+ g_config->set_domain ("_COMMAND_LINE");
for (i = argc - 1; i >= 1; i--) {
s = argv[i];
@@ -487,8 +488,14 @@ void GameDetector::setGame(const String &name) {
g_config->rename_domain(name, "game-specific");
g_config->rename_domain("game-specific", name);
updateconfig();
+
+ // The command line and launcher options
+ // override config file global and game-specific options.
+ g_config->set_domain ("_COMMAND_LINE");
+ updateconfig();
g_config->set_domain ("user-overrides");
updateconfig();
+ g_config->delete_domain ("_COMMAND_LINE");
g_config->delete_domain ("user-overrides");
}