diff options
author | Filippos Karapetis | 2012-05-21 21:21:48 +0300 |
---|---|---|
committer | Filippos Karapetis | 2012-06-21 10:48:03 +0300 |
commit | e10e412bba99090b67a99cd7fddd5405172452f1 (patch) | |
tree | f6883df79a535de2748e0fa990740017b24a8e93 /backends | |
parent | 82a553a12c033489939c031bb104e37e77ee0797 (diff) | |
download | scummvm-rg350-e10e412bba99090b67a99cd7fddd5405172452f1.tar.gz scummvm-rg350-e10e412bba99090b67a99cd7fddd5405172452f1.tar.bz2 scummvm-rg350-e10e412bba99090b67a99cd7fddd5405172452f1.zip |
COMMON: Allow the savefile manager to create uncompressed saves
These are useful in cases where the files can be used in the original
interpreters (such as the exported characters from QFG), in order to avoid
confusion in cases where the users are unaware that these saves are
compressed and are trying to load them in the original interpreters.
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/ds/arm9/source/gbampsave.cpp | 2 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/gbampsave.h | 2 | ||||
-rw-r--r-- | backends/platform/ps2/savefilemgr.cpp | 4 | ||||
-rw-r--r-- | backends/platform/ps2/savefilemgr.h | 2 | ||||
-rw-r--r-- | backends/saves/default/default-saves.cpp | 4 | ||||
-rw-r--r-- | backends/saves/default/default-saves.h | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp index 03729c5e6e..3192e2d277 100644 --- a/backends/platform/ds/arm9/source/gbampsave.cpp +++ b/backends/platform/ds/arm9/source/gbampsave.cpp @@ -45,7 +45,7 @@ static Common::String getSavePath() { // GBAMP Save File Manager ////////////////////////// -Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename) { +Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &filename, bool compress) { Common::String fileSpec = getSavePath(); if (fileSpec.lastChar() != '/') fileSpec += '/'; diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h index 492054dc52..0d9d9aca8c 100644 --- a/backends/platform/ds/arm9/source/gbampsave.h +++ b/backends/platform/ds/arm9/source/gbampsave.h @@ -27,7 +27,7 @@ class GBAMPSaveFileManager : public Common::SaveFileManager { public: - virtual Common::OutSaveFile *openForSaving(const Common::String &filename); + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true); virtual Common::InSaveFile *openForLoading(const Common::String &filename); virtual bool removeSavefile(const Common::String &filename); diff --git a/backends/platform/ps2/savefilemgr.cpp b/backends/platform/ps2/savefilemgr.cpp index 421edc3e2e..46af42e193 100644 --- a/backends/platform/ps2/savefilemgr.cpp +++ b/backends/platform/ps2/savefilemgr.cpp @@ -145,7 +145,7 @@ Common::InSaveFile *Ps2SaveFileManager::openForLoading(const Common::String &fil return Common::wrapCompressedReadStream(sf); } -Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename) { +Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &filename, bool compress) { Common::FSNode savePath(ConfMan.get("savepath")); // TODO: is this fast? Common::WriteStream *sf; @@ -193,7 +193,7 @@ Common::OutSaveFile *Ps2SaveFileManager::openForSaving(const Common::String &fil } _screen->wantAnim(false); - return Common::wrapCompressedWriteStream(sf); + return 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 a25fb063ae..163706eace 100644 --- a/backends/platform/ps2/savefilemgr.h +++ b/backends/platform/ps2/savefilemgr.h @@ -35,7 +35,7 @@ public: virtual ~Ps2SaveFileManager(); virtual Common::InSaveFile *openForLoading(const Common::String &filename); - virtual Common::OutSaveFile *openForSaving(const Common::String &filename); + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true); virtual Common::StringArray listSavefiles(const Common::String &pattern); virtual bool removeSavefile(const Common::String &filename); diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index 237c50a1ba..64e7e778b6 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -97,7 +97,7 @@ Common::InSaveFile *DefaultSaveFileManager::openForLoading(const Common::String return Common::wrapCompressedReadStream(sf); } -Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String &filename) { +Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String &filename, bool compress) { // Ensure that the savepath is valid. If not, generate an appropriate error. Common::String savePathName = getSavePath(); checkPath(Common::FSNode(savePathName)); @@ -112,7 +112,7 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String // Open the file for saving Common::WriteStream *sf = file.createWriteStream(); - return Common::wrapCompressedWriteStream(sf); + return compress ? Common::wrapCompressedWriteStream(sf) : sf; } bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) { diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h index 1ea87efc67..c7fca279bc 100644 --- a/backends/saves/default/default-saves.h +++ b/backends/saves/default/default-saves.h @@ -38,7 +38,7 @@ public: virtual Common::StringArray listSavefiles(const Common::String &pattern); virtual Common::InSaveFile *openForLoading(const Common::String &filename); - virtual Common::OutSaveFile *openForSaving(const Common::String &filename); + virtual Common::OutSaveFile *openForSaving(const Common::String &filename, bool compress = true); virtual bool removeSavefile(const Common::String &filename); protected: |