aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorOliver Kiehl2003-09-13 13:05:52 +0000
committerOliver Kiehl2003-09-13 13:05:52 +0000
commitbd50e9f3d7ee0a0e89ccb954387232ab8d923c80 (patch)
tree79e771ae582df448ee40afe096e0aa4b2a96e1ac /sword2
parentd2e56ed4a2b7464644ceafce7a8f3469c7425d4c (diff)
downloadscummvm-rg350-bd50e9f3d7ee0a0e89ccb954387232ab8d923c80.tar.gz
scummvm-rg350-bd50e9f3d7ee0a0e89ccb954387232ab8d923c80.tar.bz2
scummvm-rg350-bd50e9f3d7ee0a0e89ccb954387232ab8d923c80.zip
some more endian fixes
svn-id: r10224
Diffstat (limited to 'sword2')
-rw-r--r--sword2/anims.cpp2
-rw-r--r--sword2/driver/d_sound.cpp4
-rw-r--r--sword2/speech.cpp3
3 files changed, 4 insertions, 5 deletions
diff --git a/sword2/anims.cpp b/sword2/anims.cpp
index 3652b13463..4eb1446966 100644
--- a/sword2/anims.cpp
+++ b/sword2/anims.cpp
@@ -557,7 +557,7 @@ void CreateSequenceSpeech(_movieTextObject *sequenceText[]) // (James23may97)
local_text = sequence_text_list[line].textNumber&0xffff;
text = FetchTextLine( res_man.Res_open(text_res), local_text ); // open text resource & get the line
- memcpy(&wavId, text, 2); // this works on PSX & PC
+ wavId = (int32)READ_LE_UINT16(text);
res_man.Res_close(text_res); // now ok to close the text file
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index c97a8b9690..99c0a31bec 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -388,14 +388,14 @@ int32 Sword2Sound::GetCompSpeechSize(const char *filename, uint32 speechid) {
return (0);
}
- if (!speechIndex[0] || !speechIndex[1]) {
+ if (!FROM_LE_32(speechIndex[0]) || !FROM_LE_32(speechIndex[1])) {
fp.close();
return (0);
}
fp.close();
- i = (speechIndex[1] - 1) * 2 + sizeof(_wavHeader) + 8;
+ i = (FROM_LE_32(speechIndex[1]) - 1) * 2 + sizeof(_wavHeader) + 8;
return(i);
}
diff --git a/sword2/speech.cpp b/sword2/speech.cpp
index 18c57be888..6df23d61ec 100644
--- a/sword2/speech.cpp
+++ b/sword2/speech.cpp
@@ -1446,8 +1446,7 @@ int32 FN_i_speak(int32 *params) //Tony18Oct96 (revamped by James01july97)
local_text = params[S_TEXT]&0xffff;
text = FetchTextLine( res_man.Res_open(text_res), local_text ); // open text file & get the line
- //officialTextNumber = *(uint16*)text; // 1st word of text line is the official line number (this doesn't work on PSX)
- memcpy(&officialTextNumber, text, 2); // this works on PSX & PC
+ officialTextNumber = READ_LE_UINT16(text);
res_man.Res_close(text_res); // now ok to close the text file