aboutsummaryrefslogtreecommitdiff
path: root/backends/saves
diff options
context:
space:
mode:
Diffstat (limited to 'backends/saves')
-rw-r--r--backends/saves/default/default-saves.cpp3
-rw-r--r--backends/saves/default/default-saves.h3
-rw-r--r--backends/saves/posix/posix-saves.cpp38
-rw-r--r--backends/saves/posix/posix-saves.h6
-rw-r--r--backends/saves/psp/psp-saves.cpp3
-rw-r--r--backends/saves/psp/psp-saves.h3
-rw-r--r--backends/saves/savefile.cpp3
7 files changed, 26 insertions, 33 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 75e10cf810..237c50a1ba 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "common/scummsys.h"
diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h
index ea3d9e6d44..1ea87efc67 100644
--- a/backends/saves/default/default-saves.h
+++ b/backends/saves/default/default-saves.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#if !defined(BACKEND_SAVES_DEFAULT_H) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
diff --git a/backends/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp
index 3a8e5e998e..e04609be5b 100644
--- a/backends/saves/posix/posix-saves.cpp
+++ b/backends/saves/posix/posix-saves.cpp
@@ -18,19 +18,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
-// Enable mkdir
+// Enable getenv, mkdir and time.h stuff
+#define FORBIDDEN_SYMBOL_EXCEPTION_getenv
#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
#include "common/scummsys.h"
-#if defined(UNIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
+#if defined(POSIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
#include "backends/saves/posix/posix-saves.h"
@@ -53,7 +51,7 @@
POSIXSaveFileManager::POSIXSaveFileManager() {
// Register default savepath based on HOME
#if defined(SAMSUNGTV)
- ConfMan.registerDefault("savepath", "/dtv/usb/sda1/.scummvm");
+ ConfMan.registerDefault("savepath", "/mtd_wiselink/scummvm savegames");
#else
Common::String savePath;
const char *home = getenv("HOME");
@@ -62,15 +60,30 @@ POSIXSaveFileManager::POSIXSaveFileManager() {
savePath += "/" DEFAULT_SAVE_PATH;
ConfMan.registerDefault("savepath", savePath);
}
+
+ // The user can override the savepath with the SCUMMVM_SAVEPATH
+ // environment variable. This is weaker than a --savepath on the
+ // command line, but overrides the default savepath.
+ //
+ // To ensure that the command line option (if given) has precedence,
+ // we only set the value in the transient domain if it is not
+ // yet present there.
+ if (!ConfMan.hasKey("savepath", Common::ConfigManager::kTransientDomain)) {
+ const char *dir = getenv("SCUMMVM_SAVEPATH");
+ if (dir && *dir && strlen(dir) < MAXPATHLEN) {
+ Common::FSNode saveDir(dir);
+ if (!saveDir.exists()) {
+ warning("Ignoring non-existent SCUMMVM_SAVEPATH '%s'", dir);
+ } else if (!saveDir.isWritable()) {
+ warning("Ignoring non-writable SCUMMVM_SAVEPATH '%s'", dir);
+ } else {
+ ConfMan.set("savepath", dir, Common::ConfigManager::kTransientDomain);
+ }
+ }
+ }
#endif
}
-/*
-POSIXSaveFileManager::POSIXSaveFileManager(const Common::String &defaultSavepath)
- : DefaultSaveFileManager(defaultSavepath) {
-}
-*/
-#if defined(UNIX)
void POSIXSaveFileManager::checkPath(const Common::FSNode &dir) {
const Common::String path = dir.getPath();
clearError();
@@ -135,6 +148,5 @@ void POSIXSaveFileManager::checkPath(const Common::FSNode &dir) {
}
}
}
-#endif
#endif
diff --git a/backends/saves/posix/posix-saves.h b/backends/saves/posix/posix-saves.h
index a2543a54fa..160075d3db 100644
--- a/backends/saves/posix/posix-saves.h
+++ b/backends/saves/posix/posix-saves.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#if !defined(BACKEND_POSIX_SAVES_H) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
@@ -28,7 +25,7 @@
#include "backends/saves/default/default-saves.h"
-#if defined(UNIX)
+#if defined(POSIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
/**
* Customization of the DefaultSaveFileManager for POSIX platforms.
* The only two differences are that the default constructor sets
@@ -38,7 +35,6 @@
class POSIXSaveFileManager : public DefaultSaveFileManager {
public:
POSIXSaveFileManager();
-// POSIXSaveFileManager(const Common::String &defaultSavepath);
protected:
/**
diff --git a/backends/saves/psp/psp-saves.cpp b/backends/saves/psp/psp-saves.cpp
index 5752d2fa5f..006a4e815d 100644
--- a/backends/saves/psp/psp-saves.cpp
+++ b/backends/saves/psp/psp-saves.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
// Disable printf override in common/forbidden.h to avoid
diff --git a/backends/saves/psp/psp-saves.h b/backends/saves/psp/psp-saves.h
index d987f935a9..de2d8a693e 100644
--- a/backends/saves/psp/psp-saves.h
+++ b/backends/saves/psp/psp-saves.h
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#ifndef BACKEND_PSP_SAVES_H
diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp
index 9888146049..edfdd9bc20 100644
--- a/backends/saves/savefile.cpp
+++ b/backends/saves/savefile.cpp
@@ -18,9 +18,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
#include "common/util.h"