aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/linker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise/linker.cpp')
-rw-r--r--engines/cruise/linker.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp
index bb6f682e1e..2d14d46ce3 100644
--- a/engines/cruise/linker.cpp
+++ b/engines/cruise/linker.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/endian.h"
#include "cruise/cruise_main.h"
namespace Cruise {
@@ -182,9 +183,7 @@ int updateScriptImport(int ovlIdx) {
uint8 *ptr = ptrData + temp;
*(ptr + 1) = out2;
- *(int16 *)(ptr + 2) = ptrDest2->idx;
-
- bigEndianShortToNative((int16 *)(ptr + 2));
+ WRITE_BE_UINT16(ptr + 2, ptrDest2->idx);
} else {
if (param2 == 20 || param2 == 30 || param2 == 40 || param2 == 50) { // this patch a double push
uint8 *ptr = ptrData + temp;
@@ -192,9 +191,7 @@ int updateScriptImport(int ovlIdx) {
*(ptr + 1) = 0;
*(ptr + 2) = out2; // update the overlay number
- *(int16 *)(ptr + 4) = ptrDest2->idx;
-
- bigEndianShortToNative((int16 *)(ptr + 4));
+ WRITE_BE_UINT16(ptr + 4, ptrDest2->idx);
} else {
int var_4 = ptrDest2->var4;
@@ -213,17 +210,7 @@ int updateScriptImport(int ovlIdx) {
*(ptrData + temp) = param2;
*(ptrData + temp + 1) = out2;
- *(int16 *)(ptrData + temp + 2) = ptrDest2->idx;
-
- bigEndianShortToNative
- (
- (int16
- *)
- (ptrData
- +
- temp
- +
- 2));
+ WRITE_BE_UINT16(ptrData + temp + 2, ptrDest2->idx);
}
}
}