aboutsummaryrefslogtreecommitdiff
path: root/engines/toon/text.cpp
diff options
context:
space:
mode:
authorAlyssa Milburn2011-02-17 21:11:13 +0100
committerAlyssa Milburn2011-02-17 21:15:37 +0100
commitec94ef4e642b4b6ee8f9febce0fa710e79939b4f (patch)
treed505a909de03c3490f9e0e6da1714b53368ca1ac /engines/toon/text.cpp
parentd3e3eca6a30d8aa9f23b1811b3ae86b8d2419b7f (diff)
downloadscummvm-rg350-ec94ef4e642b4b6ee8f9febce0fa710e79939b4f.tar.gz
scummvm-rg350-ec94ef4e642b4b6ee8f9febce0fa710e79939b4f.tar.bz2
scummvm-rg350-ec94ef4e642b4b6ee8f9febce0fa710e79939b4f.zip
TOON: Fix TextResource on big-endian.
Fix for bug #3183943 ("TOON: No speech and no text").
Diffstat (limited to 'engines/toon/text.cpp')
-rw-r--r--engines/toon/text.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/toon/text.cpp b/engines/toon/text.cpp
index c54ea87d50..f0d17dd34e 100644
--- a/engines/toon/text.cpp
+++ b/engines/toon/text.cpp
@@ -57,7 +57,7 @@ int32 TextResource::getNext(int32 offset) {
uint16 *table = (uint16 *)_textData + 1;
int a = getId(offset);
- return table[a+1];
+ return READ_LE_UINT16(table + a + 1);
}
int32 TextResource::getId(int32 offset) {
@@ -66,7 +66,7 @@ int32 TextResource::getId(int32 offset) {
uint16 *table = (uint16 *)_textData + 1;
int32 found = -1;
for (int32 i = 0; i < _numTexts; i++) {
- if (offset == table[i]) {
+ if (offset == READ_LE_UINT16(table + i)) {
found = i;
break;
}
@@ -80,7 +80,7 @@ char *TextResource::getText(int32 offset) {
uint16 *table = (uint16 *)_textData + 1;
int32 found = -1;
for (int32 i = 0; i < _numTexts; i++) {
- if (offset == table[i]) {
+ if (offset == READ_LE_UINT16(table + i)) {
found = i;
break;
}
@@ -88,7 +88,7 @@ char *TextResource::getText(int32 offset) {
if (found < 0)
return NULL;
- int32 realOffset = ((uint16 *)_textData + 1 + _numTexts)[found];
+ int32 realOffset = READ_LE_UINT16((uint16 *)_textData + 1 + _numTexts + found);
return (char *)_textData + realOffset;
}