aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorsluicebox2019-12-09 22:55:33 -0800
committersluicebox2019-12-09 22:57:46 -0800
commitd43163b37cf4bc753f99fb8817a7ab3dac15236c (patch)
treed708313fa526453740193c990ef88f618cf8cf13 /engines/sci
parentbaea8d5c9c35aed1ebfde4891c9130dc550a58ad (diff)
downloadscummvm-rg350-d43163b37cf4bc753f99fb8817a7ab3dac15236c.tar.gz
scummvm-rg350-d43163b37cf4bc753f99fb8817a7ab3dac15236c.tar.bz2
scummvm-rg350-d43163b37cf4bc753f99fb8817a7ab3dac15236c.zip
SCI32: Fix PHANT1 save file interoperability
Phantasmagoria 1 save files are uncompressed because they are small and interoperable with the original interpreter, but the game scripts frequently rename them. Renaming save files unconditionally compresses the result and so only some files have been interoperable. Phantasmagoria 1 files now remain uncompressed when renamed.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kfile.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 007f8056a7..1e3f8bfd4c 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -900,9 +900,13 @@ reg_t kFileIORename(EngineState *s, int argc, reg_t *argv) {
oldName = g_sci->wrapFilename(oldName);
newName = g_sci->wrapFilename(newName);
+ // Phantasmagoria 1 files are small and interoperable with the
+ // original interpreter so they aren't compressed, see file_open().
+ bool isCompressed = (g_sci->getGameId() != GID_PHANTASMAGORIA);
+
// SCI1.1 returns 0 on success and a DOS error code on fail. SCI32
// returns -1 on fail. We just return -1 for all versions.
- if (g_sci->getSaveFileManager()->renameSavefile(oldName, newName))
+ if (g_sci->getSaveFileManager()->renameSavefile(oldName, newName, isCompressed))
return NULL_REG;
else
return SIGNAL_REG;