From 489489b12768a94505ce5605bb811a549b32b1df Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Wed, 31 Aug 2016 14:12:45 +0600 Subject: PS2: Fix Ps2SaveFileManager * updateSavefilesList() stub; * openRawFile(); * Common::OutSaveFile in openForLoading(). --- backends/platform/ps2/savefilemgr.cpp | 15 ++++++++++++--- backends/platform/ps2/savefilemgr.h | 3 +++ 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); -- cgit v1.2.3