aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMax Horn2004-12-30 21:48:22 +0000
committerMax Horn2004-12-30 21:48:22 +0000
commitacd1f910d5d5f8a8bbeb6fc953afdf5a1ece404c (patch)
tree2b01a2336bd1df3d1900f74c5c759179abc65db7 /base
parent75f31d28c97492fbf73826fe6eb3f600875e8ea0 (diff)
downloadscummvm-rg350-acd1f910d5d5f8a8bbeb6fc953afdf5a1ece404c.tar.gz
scummvm-rg350-acd1f910d5d5f8a8bbeb6fc953afdf5a1ece404c.tar.bz2
scummvm-rg350-acd1f910d5d5f8a8bbeb6fc953afdf5a1ece404c.zip
Handle SCUMMVM_SAVEPATH exactly like the command line option --savepath (but the command line option has higher priority); i.e. it's affecting the config system (see also bug #1045171)
svn-id: r16391
Diffstat (limited to 'base')
-rw-r--r--base/gameDetector.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index e371cf2924..1d10138ba9 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -48,6 +48,9 @@
extern int gDebugLevel;
+// For convenience, we alias kTransientDomain here
+static const Common::String &kTransientDomain = Common::ConfigManager::kTransientDomain;
+
// DONT FIXME: DO NOT ORDER ALPHABETICALLY, THIS IS ORDERED BY IMPORTANCE/CATEGORY! :)
#ifdef __PALM_OS__
@@ -187,6 +190,16 @@ GameDetector::GameDetector() {
#endif
#endif
+ // The user can override the savepath with the SCUMMVM_SAVEPATH
+ // environment variable.
+#if !defined(MACOS_CARBON) && !defined(_WIN32_WCE)
+ const char *dir = getenv("SCUMMVM_SAVEPATH");
+ if (dir && *dir) {
+ // TODO: Verify whether the path is valid
+ ConfMan.set("savepath", dir, kTransientDomain);
+ }
+#endif
+
_dumpScripts = false;
memset(&_game, 0, sizeof(_game));
@@ -291,8 +304,6 @@ GameSettings GameDetector::findGame(const String &gameName, const Plugin **plugi
}
-static const Common::String &kTransientDomain = Common::ConfigManager::kTransientDomain;
-
void GameDetector::parseCommandLine(int argc, char **argv) {
int i;
char *s;