diff options
author | Alexander Tkachev | 2016-08-31 13:39:09 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-31 13:39:09 +0600 |
commit | a6bcd207fcaaba50a1e76200b33cf9608756cc33 (patch) | |
tree | e26d4c06aef7bf0ab5cb8f19d92cba34c35152da /backends | |
parent | 7f913c831d32d597faa377950ce9529c7c5fd18c (diff) | |
download | scummvm-rg350-a6bcd207fcaaba50a1e76200b33cf9608756cc33.tar.gz scummvm-rg350-a6bcd207fcaaba50a1e76200b33cf9608756cc33.tar.bz2 scummvm-rg350-a6bcd207fcaaba50a1e76200b33cf9608756cc33.zip |
DC: Fix VMSaveManager
* updateSavefilesList() stub;
* openRawFile();
* Common::OutSaveFile in openForSaving();
* OutVMSave derived from WriteStream.
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/dc/vmsave.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/backends/platform/dc/vmsave.cpp b/backends/platform/dc/vmsave.cpp index d896ba1299..5e8f50ca89 100644 --- a/backends/platform/dc/vmsave.cpp +++ b/backends/platform/dc/vmsave.cpp @@ -266,7 +266,7 @@ public: { return ::readSaveGame(buffer, _size, filename); } }; -class OutVMSave : public Common::OutSaveFile { +class OutVMSave : public Common::WriteStream { private: char *buffer; int _pos, size, committed; @@ -293,11 +293,24 @@ public: class VMSaveManager : public Common::SaveFileManager { public: + virtual void updateSavefilesList(Common::StringArray &lockedFiles) { + // TODO: implement this (locks files, preventing them from being listed, saved or loaded) + } - virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) { - OutVMSave *s = new OutVMSave(filename.c_str()); - return compress ? Common::wrapCompressedWriteStream(s) : s; - } + virtual Common::InSaveFile *openRawFile(const Common::String &filename) { + InVMSave *s = new InVMSave(); + if (s->readSaveGame(filename.c_str())) { + return s; + } else { + delete s; + return NULL; + } + } + + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true) { + OutVMSave *s = new OutVMSave(filename.c_str()); + return new Common::OutSaveFile(compress ? Common::wrapCompressedWriteStream(s) : s); + } virtual Common::InSaveFile *openForLoading(const Common::String &filename) { InVMSave *s = new InVMSave(); |