diff options
author | Max Horn | 2003-09-13 00:19:39 +0000 |
---|---|---|
committer | Max Horn | 2003-09-13 00:19:39 +0000 |
commit | 01fc842d917abc69f94d97043e3d51d004584c82 (patch) | |
tree | 5794397bf27473b0d24e34ddee3a556e26a9ebd5 /sword2 | |
parent | 4d9296d4c4b2b8f81575ff37bea80835d2d98a05 (diff) | |
download | scummvm-rg350-01fc842d917abc69f94d97043e3d51d004584c82.tar.gz scummvm-rg350-01fc842d917abc69f94d97043e3d51d004584c82.tar.bz2 scummvm-rg350-01fc842d917abc69f94d97043e3d51d004584c82.zip |
endian fix for walk data
svn-id: r10198
Diffstat (limited to 'sword2')
-rw-r--r-- | sword2/router.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sword2/router.cpp b/sword2/router.cpp index 4567e95ce9..eb86964a65 100644 --- a/sword2/router.cpp +++ b/sword2/router.cpp @@ -1007,7 +1007,6 @@ int32 deltaY; modularPath[slidy].dir = 9; modularPath[slidy].num = ROUTE_END_FLAG; return 1; - } //**************************************************************************** @@ -2646,11 +2645,11 @@ void LoadWalkData(Object_walkdata *ob_walkdata) uint32 frameCounter = 0; // starts at frame 0 of mega set (16sep96 JEL) - nWalkFrames = ob_walkdata->nWalkFrames; - usingStandingTurnFrames = ob_walkdata->usingStandingTurnFrames; - usingWalkingTurnFrames = ob_walkdata->usingWalkingTurnFrames; - usingSlowInFrames = ob_walkdata->usingSlowInFrames; - usingSlowOutFrames = ob_walkdata->usingSlowOutFrames; + nWalkFrames = FROM_LE_32(ob_walkdata->nWalkFrames); + usingStandingTurnFrames = FROM_LE_32(ob_walkdata->usingStandingTurnFrames); + usingWalkingTurnFrames = FROM_LE_32(ob_walkdata->usingWalkingTurnFrames); + usingSlowInFrames = FROM_LE_32(ob_walkdata->usingSlowInFrames); + usingSlowOutFrames = FROM_LE_32(ob_walkdata->usingSlowOutFrames); numberOfSlowOutFrames = usingSlowOutFrames; // 0 = not using slow out frames; non-zero = using that many frames for each leading leg for each direction memcpy(&numberOfSlowInFrames[0],ob_walkdata->nSlowInFrames,NO_DIRECTIONS*sizeof(numberOfSlowInFrames[0])); @@ -2658,6 +2657,17 @@ void LoadWalkData(Object_walkdata *ob_walkdata) memcpy(&dx[0],ob_walkdata->dx,NO_DIRECTIONS*(nWalkFrames+1)*sizeof(dx[0])); memcpy(&dy[0],ob_walkdata->dy,NO_DIRECTIONS*(nWalkFrames+1)*sizeof(dy[0])); +#ifdef SCUMM_BIG_ENDIAN + for (direction=0; direction<NO_DIRECTIONS; direction++) { + numberOfSlowInFrames[direction] = SWAP_BYTES_32(numberOfSlowInFrames[direction]); + leadingLeg[direction] = SWAP_BYTES_32(leadingLeg[direction]); + } + for (walkFrameNo = 0; walkFrameNo < NO_DIRECTIONS*(nWalkFrames+1); walkFrameNo++) { + dx[walkFrameNo] = SWAP_BYTES_32(dx[walkFrameNo]); + dy[walkFrameNo] = SWAP_BYTES_32(dy[walkFrameNo]); + } +#endif + //--------------------------------------------------------- for (direction=0; direction<NO_DIRECTIONS; direction++) |