aboutsummaryrefslogtreecommitdiff
path: root/sword2/resman.cpp
diff options
context:
space:
mode:
authorOliver Kiehl2003-09-13 20:42:08 +0000
committerOliver Kiehl2003-09-13 20:42:08 +0000
commit52ff6acc1fa224b3027d5e6268e37e681fdf2031 (patch)
treebdafcbd9413ff43b0204ff3595d0580c2d244cad /sword2/resman.cpp
parent7eb758f69722a5c201c99c9f9c384494dd2e4cf0 (diff)
downloadscummvm-rg350-52ff6acc1fa224b3027d5e6268e37e681fdf2031.tar.gz
scummvm-rg350-52ff6acc1fa224b3027d5e6268e37e681fdf2031.tar.bz2
scummvm-rg350-52ff6acc1fa224b3027d5e6268e37e681fdf2031.zip
and another endian fix
svn-id: r10241
Diffstat (limited to 'sword2/resman.cpp')
-rw-r--r--sword2/resman.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/sword2/resman.cpp b/sword2/resman.cpp
index 20d0bf0741..a409e0f772 100644
--- a/sword2/resman.cpp
+++ b/sword2/resman.cpp
@@ -41,6 +41,7 @@
#include "resman.h"
#include "sound.h" // (James22july97) for Clear_fx_queue() called from CacheNewCluster()
#include "sword2.h" // (James11aug97) for CloseGame()
+#include "router.h"
// ---------------------------------------------------------------------------
// welcome to the easy resource manager - written in simple code for easy
@@ -391,6 +392,27 @@ static void convertEndian(uint8 *file, uint32 len) {
SWAP32(walkGridHeader->numBars);
SWAP32(walkGridHeader->numNodes);
+
+ _barData *barData = (_barData *) (file + sizeof(_walkGridHeader));
+ for (i = 0; i < walkGridHeader->numBars; i++) {
+ SWAP16(barData->x1);
+ SWAP16(barData->y1);
+ SWAP16(barData->x2);
+ SWAP16(barData->y2);
+ SWAP16(barData->xmin);
+ SWAP16(barData->ymin);
+ SWAP16(barData->xmax);
+ SWAP16(barData->ymax);
+ SWAP16(barData->dx);
+ SWAP16(barData->dy);
+ SWAP32(barData->co);
+ barData++;
+ }
+
+ uint16 *node = (uint16 *) (file + sizeof(_walkGridHeader) + walkGridHeader->numBars * sizeof(_barData));
+ for (i = 0; i < walkGridHeader->numNodes*2; i++)
+ *node = SWAP_BYTES_16(*node++);
+
break;
}
case GLOBAL_VAR_FILE: