From e10e412bba99090b67a99cd7fddd5405172452f1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 21 May 2012 21:21:48 +0300 Subject: 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. --- backends/saves/default/default-saves.cpp | 4 ++-- backends/saves/default/default-saves.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'backends/saves') 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: -- cgit v1.2.3