aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorOliver Kiehl2003-09-13 14:32:40 +0000
committerOliver Kiehl2003-09-13 14:32:40 +0000
commit6d94352f2fd295f4f561ce44cee54247851b573f (patch)
treefcaf2ce8800bc8e67d748d778e581e946b63390b /sword2
parent7f81defbfffe55663828378913f4d1c0b6eb8bb2 (diff)
downloadscummvm-rg350-6d94352f2fd295f4f561ce44cee54247851b573f.tar.gz
scummvm-rg350-6d94352f2fd295f4f561ce44cee54247851b573f.tar.bz2
scummvm-rg350-6d94352f2fd295f4f561ce44cee54247851b573f.zip
fix speech on BE
svn-id: r10229
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/d_sound.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index 99c0a31bec..796f6db2f1 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -387,15 +387,19 @@ int32 Sword2Sound::GetCompSpeechSize(const char *filename, uint32 speechid) {
fp.close();
return (0);
}
+#ifdef SCUMM_BIG_ENDIAN
+ speechIndex[0] = SWAP_BYTES_32(speechIndex[0]);
+ speechIndex[1] = SWAP_BYTES_32(speechIndex[1]);
+#endif
- if (!FROM_LE_32(speechIndex[0]) || !FROM_LE_32(speechIndex[1])) {
+ if (!speechIndex[0] || !speechIndex[1]) {
fp.close();
return (0);
}
fp.close();
- i = (FROM_LE_32(speechIndex[1]) - 1) * 2 + sizeof(_wavHeader) + 8;
+ i = (speechIndex[1] - 1) * 2 + sizeof(_wavHeader) + 8;
return(i);
}
@@ -419,6 +423,10 @@ int32 Sword2Sound::PreFetchCompSpeech(const char *filename, uint32 speechid, uin
fp.close();
return (RDERR_READERROR);
}
+#ifdef SCUMM_BIG_ENDIAN
+ speechIndex[0] = SWAP_BYTES_32(speechIndex[0]);
+ speechIndex[1] = SWAP_BYTES_32(speechIndex[1]);
+#endif
if (!speechIndex[0] || !speechIndex[1]) {
fp.close();
@@ -500,6 +508,10 @@ int32 Sword2Sound::PlayCompSpeech(const char *filename, uint32 speechid, uint8 v
fp.close();
return (RDERR_READERROR);
}
+#ifdef SCUMM_BIG_ENDIAN
+ speechIndex[0] = SWAP_BYTES_32(speechIndex[0]);
+ speechIndex[1] = SWAP_BYTES_32(speechIndex[1]);
+#endif
if (speechIndex[0] == 0 || speechIndex[1] == 0) {
fp.close();