aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWalter van Niftrik2009-06-04 23:55:08 +0000
committerWalter van Niftrik2009-06-04 23:55:08 +0000
commit8e987c80d1d66815687c8aac0efdc5543e2b697a (patch)
tree8d1c095dc2e24fce3eef0ac03404e9456bab95eb /engines/sci
parentfa02e0df7b48a3d24984d78117dc2952d0b6c5b4 (diff)
downloadscummvm-rg350-8e987c80d1d66815687c8aac0efdc5543e2b697a.tar.gz
scummvm-rg350-8e987c80d1d66815687c8aac0efdc5543e2b697a.tar.bz2
scummvm-rg350-8e987c80d1d66815687c8aac0efdc5543e2b697a.zip
SCI: Fixed some endian bugs related to speech handling. READ_UINT* are not LE,
but use native endianness. Thanks to clone2727 for pointing this out. svn-id: r41181
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/resource.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 4999299f75..8299b718f4 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1231,7 +1231,7 @@ bool AudioResource::findAudEntrySCI1(uint16 audioNumber, byte &volume, uint32 &o
return false;
byte *ptr = _audioMapSCI1;
- while ((n = READ_UINT16(ptr)) != 0xFFFF) {
+ while ((n = READ_LE_UINT16(ptr)) != 0xFFFF) {
if (n == audioNumber) {
off = READ_LE_UINT32(ptr + 2);
size = READ_LE_UINT32(ptr + 6);
@@ -1264,7 +1264,7 @@ bool AudioResource::findAudEntrySCI11Late(uint32 audioNumber, uint32 &offset, bo
byte *ptr = _audioMapSCI11->data;
- offset = READ_UINT32(ptr);
+ offset = READ_LE_UINT32(ptr);
ptr += 4;
while (ptr < _audioMapSCI11->data + _audioMapSCI11->size) {
@@ -1274,7 +1274,7 @@ bool AudioResource::findAudEntrySCI11Late(uint32 audioNumber, uint32 &offset, bo
if (n == 0xffffffff)
break;
- offset += (READ_UINT16(ptr) | (ptr[2] << 16));
+ offset += READ_LE_UINT24(ptr);
ptr += 3;
int syncSkip = 0;
@@ -1284,9 +1284,9 @@ bool AudioResource::findAudEntrySCI11Late(uint32 audioNumber, uint32 &offset, bo
if (getSync) {
if (size)
- *size = READ_UINT16(ptr);
+ *size = READ_LE_UINT16(ptr);
} else {
- syncSkip = READ_UINT16(ptr);
+ syncSkip = READ_LE_UINT16(ptr);
}
ptr += 2;
@@ -1295,7 +1295,7 @@ bool AudioResource::findAudEntrySCI11Late(uint32 audioNumber, uint32 &offset, bo
n ^= 0x40;
if (!getSync)
- syncSkip += READ_UINT16(ptr);
+ syncSkip += READ_LE_UINT16(ptr);
ptr += 2;
}
@@ -1339,10 +1339,10 @@ bool AudioResource::findAudEntrySCI11Early(uint32 audioNumber, uint32 &offset, b
if (n == 0xffffffff)
break;
- offset = READ_UINT32(ptr);
+ offset = READ_LE_UINT32(ptr);
ptr += 4;
- int syncSize = READ_UINT16(ptr);
+ int syncSize = READ_LE_UINT16(ptr);
ptr += 2;
if (n == audioNumber) {
@@ -1383,13 +1383,13 @@ bool AudioResource::findAudEntrySCI11(uint32 audioNumber, uint32 volume, uint32
if (volume == 65535) {
while (ptr < _audioMapSCI11->data + _audioMapSCI11->size) {
- n = READ_UINT16(ptr);
+ n = READ_LE_UINT16(ptr);
ptr += 2;
if (n == 0xffff)
break;
- offset = READ_UINT32(ptr);
+ offset = READ_LE_UINT32(ptr);
ptr += 4;
if (n == audioNumber)