aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-15 06:04:52 +0000
committerMartin Kiewitz2010-07-15 06:04:52 +0000
commit72faf78b82a6395a058d89f1e349c6831e9517a7 (patch)
treee891fe38f3691ee99c3b012dff1243c40b1ed028
parent7c210829dd3b4b3078a5c98bda9a7224165daa82 (diff)
downloadscummvm-rg350-72faf78b82a6395a058d89f1e349c6831e9517a7.tar.gz
scummvm-rg350-72faf78b82a6395a058d89f1e349c6831e9517a7.tar.bz2
scummvm-rg350-72faf78b82a6395a058d89f1e349c6831e9517a7.zip
SCI: adding support to qfg4 to import qfg3 character data
svn-id: r50911
-rw-r--r--engines/sci/engine/kfile.cpp10
-rw-r--r--engines/sci/sci.cpp5
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;
}