diff options
author | Max Horn | 2003-09-07 01:51:15 +0000 |
---|---|---|
committer | Max Horn | 2003-09-07 01:51:15 +0000 |
commit | 2fb59884f1d6d9fe049a525004d313dbd7a39af8 (patch) | |
tree | 5180cc09a4bad9ebbd9722a6760f1e074a7e9709 /sword2 | |
parent | b380affbd57cd7a16bf436984e3476472313bfc4 (diff) | |
download | scummvm-rg350-2fb59884f1d6d9fe049a525004d313dbd7a39af8.tar.gz scummvm-rg350-2fb59884f1d6d9fe049a525004d313dbd7a39af8.tar.bz2 scummvm-rg350-2fb59884f1d6d9fe049a525004d313dbd7a39af8.zip |
some endian fixes
svn-id: r10056
Diffstat (limited to 'sword2')
-rw-r--r-- | sword2/driver/rdwin.cpp | 2 | ||||
-rw-r--r-- | sword2/interpreter.cpp | 12 | ||||
-rw-r--r-- | sword2/protocol.cpp | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp index 4a4a1ac812..447b443e75 100644 --- a/sword2/driver/rdwin.cpp +++ b/sword2/driver/rdwin.cpp @@ -33,7 +33,7 @@ #include "render.h" #include "menu.h" #include "d_sound.h" -#include "../sword2.h" +#include "bs2/sword2.h" #define MENUDEEP 40 // Temporary, until menu.h is written! diff --git a/sword2/interpreter.cpp b/sword2/interpreter.cpp index 319ed2cb08..0dc01f1683 100644 --- a/sword2/interpreter.cpp +++ b/sword2/interpreter.cpp @@ -330,10 +330,10 @@ int RunScript ( char * scriptData , char * objectData , uint32 *offset ) // FIXME: 'scriptData' and 'variables' used to be const. However, // this code writes into 'variables' so it can not be const. char *variables = scriptData + sizeof(int); - const char *code = scriptData + *((int *)scriptData) + sizeof(int); - uint32 noScripts = *((const int32 *)code); + const char *code = scriptData + (int)READ_LE_UINT32(scriptData) + sizeof(int); + uint32 noScripts = (int)READ_LE_UINT32(code); if ( (*offset) < noScripts) - { ip = ((const int *)code)[(*offset)+1]; + { ip = (int)READ_LE_UINT32((const int *)code + (*offset) + 1); DEBUG2("Start script %d with offset %d",*offset,ip); } else @@ -354,7 +354,7 @@ int RunScript ( char * scriptData , char * objectData , uint32 *offset ) const int *checksumBlock = (const int *)code; code += sizeof(int) * 3; - if (checksumBlock[0] != 12345678) + if ((int)READ_LE_UINT32(checksumBlock) != 12345678) { #ifdef INSIDE_LINC AfxMessageBox(CVString("Invalid script in object %s",header->name)); @@ -363,11 +363,11 @@ int RunScript ( char * scriptData , char * objectData , uint32 *offset ) #endif return(0); } - int codeLen = checksumBlock[1]; + int codeLen = (int)READ_LE_UINT32(checksumBlock + 1); int checksum = 0; for (int count = 0 ; count < codeLen ; count++) checksum += (unsigned char)code[count]; - if ( checksum != checksumBlock[2] ) + if ( checksum != (int)READ_LE_UINT32(checksumBlock + 2) ) { #ifdef INSIDE_LINC AfxMessageBox(CVString("Checksum error in script %s",header->name)); diff --git a/sword2/protocol.cpp b/sword2/protocol.cpp index a10049ebbe..c3031f18ac 100644 --- a/sword2/protocol.cpp +++ b/sword2/protocol.cpp @@ -206,7 +206,7 @@ uint8 *FetchTextLine(uint8 *file, uint32 text_line) //Tony24Oct96 point=(uint32*) text_header+1; //point to the lookup table - return( (uint8*) (file+ *(point+text_line)) ); + return( (uint8*) (file + READ_LE_UINT32(point+text_line)) ); } //--------------------------------------------------------------- // Used for testing text & speech (see FN_I_speak in speech.cpp) |