2003-08-10 20:49:13 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
2006-01-18 17:39:49 +00:00
|
|
|
* Copyright (C) 2002-2006 The ScummVM project
|
2003-08-10 20:49:13 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-08-10 20:49:13 +00:00
|
|
|
*
|
2006-02-11 09:53:53 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2003-08-10 20:49:13 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-06-24 15:23:51 +00:00
|
|
|
#include "common/stdafx.h"
|
2003-08-10 20:49:13 +00:00
|
|
|
#include "common/util.h"
|
2004-11-27 00:26:11 +00:00
|
|
|
#include "common/config-manager.h"
|
2003-10-12 13:27:42 +00:00
|
|
|
#include "common/savefile.h"
|
2003-08-10 20:49:13 +00:00
|
|
|
|
2004-04-17 09:57:15 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2005-05-10 23:17:38 +00:00
|
|
|
namespace Common {
|
|
|
|
|
2004-11-27 00:26:11 +00:00
|
|
|
const char *SaveFileManager::getSavePath() const {
|
|
|
|
|
2005-09-03 16:12:52 +00:00
|
|
|
#if defined(PALMOS_MODE) || defined(__PSP__)
|
2004-11-27 00:26:11 +00:00
|
|
|
return SCUMMVM_SAVEPATH;
|
|
|
|
#else
|
|
|
|
|
|
|
|
const char *dir = NULL;
|
|
|
|
|
2004-12-30 21:48:22 +00:00
|
|
|
// Try to use game specific savepath from config
|
|
|
|
dir = ConfMan.get("savepath").c_str();
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-12-30 21:48:22 +00:00
|
|
|
// Work around a bug (#999122) in the original 0.6.1 release of
|
|
|
|
// ScummVM, which would insert a bad savepath value into config files.
|
|
|
|
if (0 == strcmp(dir, "None")) {
|
2006-04-15 20:36:41 +00:00
|
|
|
ConfMan.removeKey("savepath", ConfMan.getActiveDomainName());
|
2004-12-30 21:48:22 +00:00
|
|
|
ConfMan.flushToDisk();
|
2004-11-27 00:26:11 +00:00
|
|
|
dir = ConfMan.get("savepath").c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _WIN32_WCE
|
|
|
|
if (dir[0] == 0)
|
2004-12-11 00:39:27 +00:00
|
|
|
dir = ConfMan.get("path").c_str();
|
2004-11-27 00:26:11 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
assert(dir);
|
|
|
|
|
|
|
|
return dir;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2005-05-10 23:17:38 +00:00
|
|
|
} // End of namespace Common
|