aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2006-04-02 21:28:01 +0000
committerMax Horn2006-04-02 21:28:01 +0000
commit29858dadcdf4dd277995cfa83ecdeac31316df46 (patch)
tree0c76c8e1314268a443fbebf422d61e4883b30fef
parent7b63eadb50e55575abf501922e8aab8846e2bcf1 (diff)
downloadscummvm-rg350-29858dadcdf4dd277995cfa83ecdeac31316df46.tar.gz
scummvm-rg350-29858dadcdf4dd277995cfa83ecdeac31316df46.tar.bz2
scummvm-rg350-29858dadcdf4dd277995cfa83ecdeac31316df46.zip
Treat 'targes' like the other command line 'commands'
svn-id: r21570
-rw-r--r--base/gameDetector.cpp16
-rw-r--r--base/gameDetector.h2
-rw-r--r--base/main.cpp2
3 files changed, 9 insertions, 11 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index e10ad0e694..30d96c49f3 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -352,8 +352,8 @@ Common::String GameDetector::parseCommandLine(Common::StringMap &settings, int a
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 @@ unknownOption:
}
-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.
}
diff --git a/base/gameDetector.h b/base/gameDetector.h
index 5299e3cbe5..f9234bb9c6 100644
--- a/base/gameDetector.h
+++ b/base/gameDetector.h
@@ -70,7 +70,7 @@ public:
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;
diff --git a/base/main.cpp b/base/main.cpp
index a15380a28c..d2856feb81 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -368,7 +368,7 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
#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?