aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-29 15:01:33 +0000
committerFilippos Karapetis2010-05-29 15:01:33 +0000
commit708b37898c17ca520e8b3ae92a2e458665c7bd81 (patch)
tree8648fbe0b31ce5bf82aabf91596e9822daf4000a
parent6f056c6c98e6c32c1e18a731ca6296b9ee4b130a (diff)
downloadscummvm-rg350-708b37898c17ca520e8b3ae92a2e458665c7bd81.tar.gz
scummvm-rg350-708b37898c17ca520e8b3ae92a2e458665c7bd81.tar.bz2
scummvm-rg350-708b37898c17ca520e8b3ae92a2e458665c7bd81.zip
Fixed regression in SCI2-SCI21 games from commit 49308
svn-id: r49309
-rw-r--r--engines/sci/resource.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index d336cbab38..ab46fa3abd 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1926,6 +1926,10 @@ reg_t ResourceManager::findGameObject(bool addSci11ScriptOffset) {
if (getSciVersion() >= SCI_VERSION_1_1 && addSci11ScriptOffset)
offset += script->size;
+ // TODO: Investigate why this is needed for SCI2+ games
+ if (getSciVersion() >= SCI_VERSION_2)
+ offset += 1;
+
return make_reg(1, offset);
}
@@ -1941,8 +1945,14 @@ Common::String ResourceManager::findSierraGameId() {
nameSelector += 5;
}
+ int16 gameObjectOffset = findGameObject(false).offset;
+
+ // Compensate for the odd offsets of SCI2+ games
+ if (getSciVersion() >= SCI_VERSION_2)
+ gameObjectOffset -= 1;
+
// Seek to the name selector of the first export
- byte *seeker = heap->data + READ_UINT16(heap->data + findGameObject(false).offset + nameSelector * 2);
+ byte *seeker = heap->data + READ_UINT16(heap->data + gameObjectOffset + nameSelector * 2);
Common::String sierraId;
sierraId += (const char *)seeker;