aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMatthew Hoops2011-02-05 08:16:29 +0000
committerMatthew Hoops2011-02-05 08:16:29 +0000
commit53d862af0be3cdec5231f065e05fb80260ec9429 (patch)
tree47a3d397cfe1b1f013a7d138b9336d055aab525e /engines/sci
parentcb6d30a915ef4857a93cbf4fc41293ac5f5e64b2 (diff)
downloadscummvm-rg350-53d862af0be3cdec5231f065e05fb80260ec9429.tar.gz
scummvm-rg350-53d862af0be3cdec5231f065e05fb80260ec9429.tar.bz2
scummvm-rg350-53d862af0be3cdec5231f065e05fb80260ec9429.zip
SCI: Add support for BE selector name tables
svn-id: r55780
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/kernel.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 8ab7e02e8b..d8bbc75c18 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -111,6 +111,11 @@ void Kernel::loadSelectorNames() {
Resource *r = _resMan->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SELECTORS), 0);
bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY);
+ // Starting with KQ7, Mac versions have a BE name table. GK1 Mac and earlier (and all
+ // other platforms) always use LE.
+ bool isBE = (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_2_1
+ && g_sci->getGameId() != GID_GK1);
+
if (!r) { // No such resource?
// Check if we have a table for this game
// Some demos do not have a selector table
@@ -130,11 +135,11 @@ void Kernel::loadSelectorNames() {
return;
}
- int count = READ_LE_UINT16(r->data) + 1; // Counter is slightly off
+ int count = isBE ? READ_BE_UINT16(r->data) : READ_LE_UINT16(r->data) + 1; // Counter is slightly off
for (int i = 0; i < count; i++) {
- int offset = READ_LE_UINT16(r->data + 2 + i * 2);
- int len = READ_LE_UINT16(r->data + offset);
+ int offset = isBE ? READ_BE_UINT16(r->data + 2 + i * 2) : READ_LE_UINT16(r->data + 2 + i * 2);
+ int len = isBE ? READ_BE_UINT16(r->data + offset) : READ_LE_UINT16(r->data + offset);
Common::String tmp((const char *)r->data + offset + 2, len);
_selectorNames.push_back(tmp);