[Scummvm-cvs-logs] scummvm master -> ec94ef4e642b4b6ee8f9febce0fa710e79939b4f

fuzzie fuzzie at fuzzie.org
Thu Feb 17 21:12:49 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ec94ef4e64 TOON: Fix TextResource on big-endian.


Commit: ec94ef4e642b4b6ee8f9febce0fa710e79939b4f
    https://github.com/scummvm/scummvm/commit/ec94ef4e642b4b6ee8f9febce0fa710e79939b4f
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-02-17T12:15:37-08:00

Commit Message:
TOON: Fix TextResource on big-endian.

Fix for bug #3183943 ("TOON: No speech and no text").

Changed paths:
    engines/toon/text.cpp



diff --git a/engines/toon/text.cpp b/engines/toon/text.cpp
index c54ea87..f0d17dd 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;
 }
 






More information about the Scummvm-git-logs mailing list