diff options
author | sluicebox | 2019-12-09 22:50:28 -0800 |
---|---|---|
committer | sluicebox | 2019-12-09 22:57:46 -0800 |
commit | baea8d5c9c35aed1ebfde4891c9130dc550a58ad (patch) | |
tree | c94b634d8bdc8af592e2faa3a0b79d878a70538a /backends/saves/savefile.cpp | |
parent | 099ef8db300fc776539694c766dcb58a4a948952 (diff) | |
download | scummvm-rg350-baea8d5c9c35aed1ebfde4891c9130dc550a58ad.tar.gz scummvm-rg350-baea8d5c9c35aed1ebfde4891c9130dc550a58ad.tar.bz2 scummvm-rg350-baea8d5c9c35aed1ebfde4891c9130dc550a58ad.zip |
COMMON: Make save compression optional when copying
Allows for copying or renaming uncompressed save files, such as
in Phantasmagoria 1, without compressing them in the process.
Diffstat (limited to 'backends/saves/savefile.cpp')
-rw-r--r-- | backends/saves/savefile.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp index 059b7dba8d..d3de5f2fbd 100644 --- a/backends/saves/savefile.cpp +++ b/backends/saves/savefile.cpp @@ -56,7 +56,7 @@ int32 OutSaveFile::pos() const { return _wrapped->pos(); } -bool SaveFileManager::copySavefile(const String &oldFilename, const String &newFilename) { +bool SaveFileManager::copySavefile(const String &oldFilename, const String &newFilename, bool compress) { InSaveFile *inFile = 0; OutSaveFile *outFile = 0; uint32 size = 0; @@ -70,7 +70,7 @@ bool SaveFileManager::copySavefile(const String &oldFilename, const String &newF buffer = malloc(size); assert(buffer); - outFile = openForSaving(newFilename); + outFile = openForSaving(newFilename, compress); if (buffer && outFile) { inFile->read(buffer, size); @@ -94,8 +94,8 @@ bool SaveFileManager::copySavefile(const String &oldFilename, const String &newF return success; } -bool SaveFileManager::renameSavefile(const String &oldFilename, const String &newFilename) { - if (!copySavefile(oldFilename, newFilename)) +bool SaveFileManager::renameSavefile(const String &oldFilename, const String &newFilename, bool compress) { + if (!copySavefile(oldFilename, newFilename, compress)) return false; return removeSavefile(oldFilename); |