From 72faf78b82a6395a058d89f1e349c6831e9517a7 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Thu, 15 Jul 2010 06:04:52 +0000 Subject: SCI: adding support to qfg4 to import qfg3 character data svn-id: r50911 --- engines/sci/engine/kfile.cpp | 10 ++++++---- engines/sci/sci.cpp | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 27ae7f1493..5c8179103c 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -844,13 +844,15 @@ reg_t kFileIOFindFirst(EngineState *s, int argc, reg_t *argv) { int attr = argv[2].toUint16(); // We won't use this, Win32 might, though... debugC(2, kDebugLevelFile, "kFileIO(findFirst): %s, 0x%x", mask.c_str(), attr); + // QfG3 uses "/\*.*" for the character import, QfG4 uses "/\*" + if (mask.hasPrefix("/\\")) { + mask.deleteChar(0); + mask.deleteChar(0); + } + // We remove ".*". mask will get prefixed, so we will return all additional files for that gameid if (mask == "*.*") mask = "*"; - - // QfG3 uses this mask for the character import - if (mask == "/\\*.*") - mask = "*"; return s->_dirseeker.firstFile(mask, buf, s->_segMan); } diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 1ebc6a2ba3..4601092af8 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -497,8 +497,11 @@ Common::String SciEngine::getFilePrefix() const { // Quest for Glory 3 wants to read files from Quest for Glory 2 to import character data if (_gamestate->currentRoomNumber() == 54) return "qfg2"; + } else if (_gameId == GID_QFG4) { + // Quest for Glory 4 wants to read files from Quest for Glory 3 to import character data + if (_gamestate->currentRoomNumber() == 54) + return "qfg3"; } - // TODO: Implement the same for qfg4, when sci32 is good enough return _targetName; } -- cgit v1.2.3