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
This commit is contained in:
parent
75f31d28c9
commit
acd1f910d5
2 changed files with 21 additions and 16 deletions
|
@ -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;
|
||||
|
|
|
@ -39,12 +39,7 @@ const char *SaveFileManager::getSavePath() const {
|
|||
|
||||
const char *dir = NULL;
|
||||
|
||||
#if !defined(MACOS_CARBON) && !defined(_WIN32_WCE)
|
||||
dir = getenv("SCUMMVM_SAVEPATH");
|
||||
#endif
|
||||
|
||||
// If SCUMMVM_SAVEPATH was not specified, try to use game specific savepath from config
|
||||
if (!dir || dir[0] == 0) {
|
||||
// Try to use game specific savepath from config
|
||||
dir = ConfMan.get("savepath").c_str();
|
||||
|
||||
// Work around a bug (#999122) in the original 0.6.1 release of
|
||||
|
@ -54,7 +49,6 @@ const char *SaveFileManager::getSavePath() const {
|
|||
ConfMan.flushToDisk();
|
||||
dir = ConfMan.get("savepath").c_str();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
if (dir[0] == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue