From c61c89dd350b765ec1b3d39097e250c042d5358b Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 5 Feb 2016 18:40:14 +0100 Subject: SCI: QfG1/2/3/4 character file detection changed No longer checking for .sav file suffix, but instead checking room number instead. The user is able to change the suffix, which would have resulted in a compressed character file. --- engines/sci/engine/file.cpp | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/sci/engine/file.cpp b/engines/sci/engine/file.cpp index a602cb4503..0b1001bfda 100644 --- a/engines/sci/engine/file.cpp +++ b/engines/sci/engine/file.cpp @@ -66,13 +66,29 @@ reg_t file_open(EngineState *s, const Common::String &filename, int mode, bool u bool isCompressed = true; const SciGameId gameId = g_sci->getGameId(); - if ((gameId == GID_QFG1 || gameId == GID_QFG1VGA || gameId == GID_QFG2 || gameId == GID_QFG3) - && englishName.hasSuffix(".sav")) { - // QFG Characters are saved via the CharSave object. - // We leave them uncompressed so that they can be imported in later QFG - // games. - // Rooms/Scripts: QFG1: 601, QFG2: 840, QFG3/4: 52 - isCompressed = false; + + // QFG Characters are saved via the CharSave object. + // We leave them uncompressed so that they can be imported in later QFG + // games, even when using the original interpreter. + // We check for room numbers in here, because the file suffix can be changed by the user. + // Rooms/Scripts: QFG1(EGA/VGA): 601, QFG2: 840, QFG3/4: 52 + switch (gameId) { + case GID_QFG1: + case GID_QFG1VGA: + if (s->currentRoomNumber() == 601) + isCompressed = false; + break; + case GID_QFG2: + if (s->currentRoomNumber() == 840) + isCompressed = false; + break; + case GID_QFG3: + case GID_QFG4: + if (s->currentRoomNumber() == 52) + isCompressed = false; + break; + default: + break; } if (mode == _K_FILE_MODE_OPEN_OR_FAIL) { -- cgit v1.2.3