From 6d94352f2fd295f4f561ce44cee54247851b573f Mon Sep 17 00:00:00 2001 From: Oliver Kiehl Date: Sat, 13 Sep 2003 14:32:40 +0000 Subject: fix speech on BE svn-id: r10229 --- sword2/driver/d_sound.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'sword2/driver') 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(); -- cgit v1.2.3