aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Tkachev2016-08-31 14:12:45 +0600
committerAlexander Tkachev2016-08-31 14:12:45 +0600
commit489489b12768a94505ce5605bb811a549b32b1df (patch)
treea9dd85ba76258da4df0399bbbd1e95a3d71e0163
parentac93dd99fe5a151fde4dfe12c55eac9290643a5f (diff)
downloadscummvm-rg350-489489b12768a94505ce5605bb811a549b32b1df.tar.gz
scummvm-rg350-489489b12768a94505ce5605bb811a549b32b1df.tar.bz2
scummvm-rg350-489489b12768a94505ce5605bb811a549b32b1df.zip
PS2: Fix Ps2SaveFileManager
* updateSavefilesList() stub; * openRawFile(); * Common::OutSaveFile in openForLoading().
-rw-r--r--backends/platform/ps2/savefilemgr.cpp15
-rw-r--r--backends/platform/ps2/savefilemgr.h3
2 files changed, 15 insertions, 3 deletions
diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp
index 569d0e13e3..4cd988074e 100644
--- a/backends/platform/ps2/savefilemgr.cpp
+++ b/backends/platform/ps2/savefilemgr.cpp
@@ -82,7 +82,11 @@ void Ps2SaveFileManager::mcSplit(char *full, char *game, char *ext) {
// TODO
}
-Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &filename) {
+void Ps2SaveFileManager::updateSavefilesList(Common::StringArray &lockedFiles) {
+ // TODO: implement this (locks files, preventing them from being listed, saved or loaded)
+}
+
+Common::InSaveFile *Ps2SaveFileManager::openRawFile(const Common::String &filename) {
Common::FSNode savePath(ConfMan.get("savepath")); // TODO: is this fast?
Common::SeekableReadStream *sf;
@@ -141,7 +145,12 @@ Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &fil
// _screen->wantAnim(false);
- return Common::wrapCompressedReadStream(sf);
+ return sf;
+}
+
+Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &filename) {
+ Common::SeekableReadStream *sf = openRawFile(filename);
+ return (sf == NULL ? NULL : Common::wrapCompressedReadStream(sf));
}
Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename, bool compress) {
@@ -192,7 +201,7 @@ Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &fil
}
_screen->wantAnim(false);
- return new OutSaveFile(compress ? Common::wrapCompressedWriteStream(sf) : sf);
+ return new Common::OutSaveFile(compress ? Common::wrapCompressedWriteStream(sf) : sf);
}
bool Ps2SaveFileManager::removeSavefile(const Common::String &filename) {
diff --git a/backends/platform/ps2/savefilemgr.h b/backends/platform/ps2/savefilemgr.h
index 547f16fa77..3d45382c64 100644
--- a/backends/platform/ps2/savefilemgr.h
+++ b/backends/platform/ps2/savefilemgr.h
@@ -34,6 +34,9 @@ public:
Ps2SaveFileManager(OSystem_PS2 *system, Gs2dScreen *screen);
virtual ~Ps2SaveFileManager();
+ virtual void updateSavefilesList(Common::StringArray &lockedFiles);
+ virtual Common::InSaveFile *openRawFile(const Common::String &filename);
+
virtual Common::InSaveFile *openForLoading(const Common::String &filename);
virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true);
virtual Common::StringArray listSavefiles(const Common::String &pattern);