[Scummvm-cvs-logs] CVS: scummvm/base gameDetector.cpp,1.96,1.97

Max Horn fingolfin at users.sourceforge.net
Thu Dec 30 13:49:04 CET 2004


Update of /cvsroot/scummvm/scummvm/base
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22485/base

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

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/gameDetector.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- gameDetector.cpp	27 Dec 2004 22:08:18 -0000	1.96
+++ gameDetector.cpp	30 Dec 2004 21:48:22 -0000	1.97
@@ -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 @@
 #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 @@
 	}
 
 
-static const Common::String &kTransientDomain = Common::ConfigManager::kTransientDomain;
-
 void GameDetector::parseCommandLine(int argc, char **argv) {
 	int i;
 	char *s;





More information about the Scummvm-git-logs mailing list