From ec94ef4e642b4b6ee8f9febce0fa710e79939b4f Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Thu, 17 Feb 2011 21:11:13 +0100 Subject: TOON: Fix TextResource on big-endian. Fix for bug #3183943 ("TOON: No speech and no text"). --- engines/toon/text.cpp | 8 ++++---- 1 file 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; } -- cgit v1.2.3