[Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.105,1.106

Jamieson Christian jamieson630 at users.sourceforge.net
Wed Jun 11 11:35:11 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv13588/scummvm/common

Modified Files:
	gameDetector.cpp 
Log Message:
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.

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- gameDetector.cpp	11 Jun 2003 06:49:45 -0000	1.105
+++ gameDetector.cpp	11 Jun 2003 18:34:37 -0000	1.106
@@ -310,8 +310,9 @@
 	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 @@
 	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");
 }
 





More information about the Scummvm-git-logs mailing list