aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-27 13:59:08 -0400
committerPaul Gilbert2016-08-27 13:59:08 -0400
commitf5ab3d1cd9eb3a884b0ab5d0b154a4f9cccc74b7 (patch)
tree771a8d2b3fddf96c17a1d81d42cb08dfba09d110 /backends/platform/sdl
parent873d555add9aaf5eb0d021518f5134142e2c2ff6 (diff)
parent5ea32efbb0ecb3e6b8336ad3c2edd3905ea5b89a (diff)
downloadscummvm-rg350-f5ab3d1cd9eb3a884b0ab5d0b154a4f9cccc74b7.tar.gz
scummvm-rg350-f5ab3d1cd9eb3a884b0ab5d0b154a4f9cccc74b7.tar.bz2
scummvm-rg350-f5ab3d1cd9eb3a884b0ab5d0b154a4f9cccc74b7.zip
Merge branch 'master' into xeen
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/posix/posix.cpp18
-rw-r--r--backends/platform/sdl/posix/posix.h2
-rw-r--r--backends/platform/sdl/sdl.cpp8
-rw-r--r--backends/platform/sdl/sdl.h1
4 files changed, 29 insertions, 0 deletions
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index e2a642b288..0d5f39736a 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -141,6 +141,24 @@ Common::String OSystem_POSIX::getDefaultConfigFileName() {
return configFile;
}
+void OSystem_POSIX::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
+#ifdef DATA_PATH
+ const char *snap = getenv("SNAP");
+ if (snap) {
+ Common::String dataPath = Common::String(snap) + DATA_PATH;
+ Common::FSNode dataNode(dataPath);
+ if (dataNode.exists() && dataNode.isDirectory()) {
+ // This is the same priority which is used for the data path (below),
+ // but we insert this one first, so it will be searched first.
+ s.add(dataPath, new Common::FSDirectory(dataNode, 4), priority);
+ }
+ }
+#endif
+
+ // For now, we always add the data path, just in case SNAP doesn't make sense.
+ OSystem_SDL::addSysArchivesToSearchSet(s, priority);
+}
+
Common::WriteStream *OSystem_POSIX::createLogFile() {
// Start out by resetting _logFilePath, so that in case
// of a failure, we know that no log file is open.
diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h
index 0514d30191..050463c273 100644
--- a/backends/platform/sdl/posix/posix.h
+++ b/backends/platform/sdl/posix/posix.h
@@ -38,6 +38,8 @@ public:
virtual void init();
virtual void initBackend();
+ virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
+
protected:
/**
* Base string for creating the default path and filename for the
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index c55753194b..dca6891fef 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -492,6 +492,14 @@ AudioCDManager *OSystem_SDL::createAudioCDManager() {
#endif
}
+Common::SaveFileManager *OSystem_SDL::getSavefileManager() {
+#ifdef ENABLE_EVENTRECORDER
+ return g_eventRec.getSaveManager(_savefileManager);
+#else
+ return _savefileManager;
+#endif
+}
+
#ifdef USE_OPENGL
const OSystem::GraphicsMode *OSystem_SDL::getSupportedGraphicsModes() const {
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index c93c8308a7..1fe670c5c3 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -76,6 +76,7 @@ public:
virtual void getTimeAndDate(TimeDate &td) const;
virtual Audio::Mixer *getMixer();
virtual Common::TimerManager *getTimerManager();
+ virtual Common::SaveFileManager *getSavefileManager();
protected:
bool _inited;