[Scummvm-cvs-logs] SF.net SVN: scummvm: [21570] scummvm/trunk/base

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Apr 2 14:29:02 CEST 2006


Revision: 21570
Author:   fingolfin
Date:     2006-04-02 14:28:01 -0700 (Sun, 02 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21570&view=rev

Log Message:
-----------
Treat 'targes' like the other command line 'commands'

Modified Paths:
--------------
    scummvm/trunk/base/gameDetector.cpp
    scummvm/trunk/base/gameDetector.h
    scummvm/trunk/base/main.cpp
Modified: scummvm/trunk/base/gameDetector.cpp
===================================================================
--- scummvm/trunk/base/gameDetector.cpp	2006-04-02 21:06:49 UTC (rev 21569)
+++ scummvm/trunk/base/gameDetector.cpp	2006-04-02 21:28:01 UTC (rev 21570)
@@ -352,8 +352,8 @@
 			if (i != argc - 1)
 				usage("Stray argument '%s'", s);
 
-			// We defer checking whether this is a valid target to a later point
-			settings["target"] = s;
+			// We defer checking whether this is a valid target to a later point.
+			return s;
 		} else {
 
 			char shortCmdLower = tolower(s[1]);
@@ -537,19 +537,17 @@
 }
 
 
-void GameDetector::processSettings(Common::StringMap &settings) {
+void GameDetector::processSettings(Common::String &target, Common::StringMap &settings) {
 
 	// If a target was specified, check whether there is either a game
 	// domain (i.e. a target) matching this argument, or alternatively
 	// whether there is a gameid matching that name.
-	if (settings.contains("target")) {
-		String str(settings["target"]);
-		if (ConfMan.hasGameDomain(str) || findGame(str).gameid.size() > 0) {
-			setTarget(str);
+	if (!target.empty()) {
+		if (ConfMan.hasGameDomain(target) || findGame(target).gameid.size() > 0) {
+			setTarget(target);
 		} else {
-			usage("Unrecognized game target '%s'", str.c_str());
+			usage("Unrecognized game target '%s'", target.c_str());
 		}
-		settings.erase("target");	// This option should not be passed to ConfMan.
 	}
 	
 

Modified: scummvm/trunk/base/gameDetector.h
===================================================================
--- scummvm/trunk/base/gameDetector.h	2006-04-02 21:06:49 UTC (rev 21569)
+++ scummvm/trunk/base/gameDetector.h	2006-04-02 21:28:01 UTC (rev 21570)
@@ -70,7 +70,7 @@
 	GameDetector();
 
 	static Common::String parseCommandLine(Common::StringMap &settings, int argc, char **argv);
-	void processSettings(Common::StringMap &settings);
+	void processSettings(Common::String &target, Common::StringMap &settings);
 	bool detectMain();
 
 	String _targetName;

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2006-04-02 21:06:49 UTC (rev 21569)
+++ scummvm/trunk/base/main.cpp	2006-04-02 21:28:01 UTC (rev 21570)
@@ -368,7 +368,7 @@
 #ifndef _WIN32_WCE
 	GameDetector detector;
 #endif
-	detector.processSettings(settings);
+	detector.processSettings(command, settings);
 
 #ifdef __SYMBIAN32__
 	// init keymap support here: we wanna move this somewhere else?


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list