aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/decompiler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise/decompiler.cpp')
-rw-r--r--engines/cruise/decompiler.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/engines/cruise/decompiler.cpp b/engines/cruise/decompiler.cpp
index 505ca0e4d6..a7244d3f8a 100644
--- a/engines/cruise/decompiler.cpp
+++ b/engines/cruise/decompiler.cpp
@@ -243,13 +243,10 @@ char getByteFromDecompScriptReal(void) {
}
void getShortFromDecompScript(char *buffer) {
- short int var =
- *(int16 *)(currentDecompScript + currentDecompScriptPtr->var4);
+ int16 var = (int16)READ_BE_UINT16(currentDecompScript + currentDecompScriptPtr->var4);
currentDecompScriptPtr->var4 = currentDecompScriptPtr->var4 + 2;
- flipShort(&var);
-
if (var == -1) {
resolveDecompShort(buffer);
@@ -260,14 +257,11 @@ void getShortFromDecompScript(char *buffer) {
sprintf(buffer, "%d", var);
}
-short int getShortFromDecompScriptReal(void) {
- short int var =
- *(int16 *)(currentDecompScript + currentDecompScriptPtr->var4);
+int16 getShortFromDecompScriptReal(void) {
+ int16 var = (int16)READ_BE_UINT16(currentDecompScript + currentDecompScriptPtr->var4);
currentDecompScriptPtr->var4 = currentDecompScriptPtr->var4 + 2;
- flipShort(&var);
-
return var;
}