From d43163b37cf4bc753f99fb8817a7ab3dac15236c Mon Sep 17 00:00:00 2001 From: sluicebox Date: Mon, 9 Dec 2019 22:55:33 -0800 Subject: 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. --- engines/sci/engine/kfile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3