diff options
author | Joost Peters | 2005-04-11 22:44:37 +0000 |
---|---|---|
committer | Joost Peters | 2005-04-11 22:44:37 +0000 |
commit | 40fb3732c0e57d8ee4e1719df74ac5de4e60e9e2 (patch) | |
tree | 8b0870cfe8bdeefa7426c7244e2fd9b2c1dd5652 /gob | |
parent | 510fcec93de60df2363aa8f90851eefe310038b3 (diff) | |
download | scummvm-rg350-40fb3732c0e57d8ee4e1719df74ac5de4e60e9e2.tar.gz scummvm-rg350-40fb3732c0e57d8ee4e1719df74ac5de4e60e9e2.tar.bz2 scummvm-rg350-40fb3732c0e57d8ee4e1719df74ac5de4e60e9e2.zip |
endian-convert pieces value when read, instead of when they are loaded (since I don't know how to tell how many picts there)
svn-id: r17556
Diffstat (limited to 'gob')
-rw-r--r-- | gob/scenery.cpp | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/gob/scenery.cpp b/gob/scenery.cpp index 8d7c42d6e2..ac3d9a50d6 100644 --- a/gob/scenery.cpp +++ b/gob/scenery.cpp @@ -141,11 +141,6 @@ int16 scen_loadStatic(char search) { game_loadTotResource(pictDescId); } - ptr->pieces[i]->left = (int16)READ_LE_UINT16(&ptr->pieces[i]->left); - ptr->pieces[i]->right = (int16)READ_LE_UINT16(&ptr->pieces[i]->right); - ptr->pieces[i]->top = (int16)READ_LE_UINT16(&ptr->pieces[i]->top); - ptr->pieces[i]->bottom = (int16)READ_LE_UINT16(&ptr->pieces[i]->bottom); - width = inter_load16(); height = inter_load16(); sprResId = inter_load16(); @@ -256,10 +251,10 @@ void scen_renderStatic(int16 scenery, int16 layer) { draw_destSpriteX = planePtr->destX; draw_destSpriteY = planePtr->destY; - left = ptr->pieces[pictIndex][pieceIndex].left; - right = ptr->pieces[pictIndex][pieceIndex].right; - top = ptr->pieces[pictIndex][pieceIndex].top; - bottom = ptr->pieces[pictIndex][pieceIndex].bottom; + left = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].left); + right = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].right); + top = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].top); + bottom = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].bottom); draw_sourceSurface = scen_staticPictToSprite[scenery * 7 + pictIndex]; @@ -325,10 +320,10 @@ void scen_updateStatic(int16 orderFrom) { draw_destSpriteX = planePtr->destX; draw_destSpriteY = planePtr->destY; - left = pictPtr[pictIndex][pieceIndex].left; - right = pictPtr[pictIndex][pieceIndex].right; - top = pictPtr[pictIndex][pieceIndex].top; - bottom = pictPtr[pictIndex][pieceIndex].bottom; + left = FROM_LE_16(pictPtr[pictIndex][pieceIndex].left); + right = FROM_LE_16(pictPtr[pictIndex][pieceIndex].right); + top = FROM_LE_16(pictPtr[pictIndex][pieceIndex].top); + bottom = FROM_LE_16(pictPtr[pictIndex][pieceIndex].bottom); if (draw_destSpriteX > scen_toRedrawRight) continue; @@ -453,12 +448,6 @@ int16 scen_loadAnim(char search) { game_loadTotResource(pictDescId); } - - ptr->pieces[i]->left = (int16)READ_LE_UINT16(&ptr->pieces[i]->left); - ptr->pieces[i]->right = (int16)READ_LE_UINT16(&ptr->pieces[i]->right); - ptr->pieces[i]->top = (int16)READ_LE_UINT16(&ptr->pieces[i]->top); - ptr->pieces[i]->bottom = (int16)READ_LE_UINT16(&ptr->pieces[i]->bottom); - width = inter_load16(); height = inter_load16(); sprResId = inter_load16(); @@ -602,10 +591,10 @@ void scen_updateAnim(int16 layer, int16 frame, int16 animation, int16 flags, pictIndex = (pictIndex & 15) - 1; - left = pictPtr[pictIndex][pieceIndex].left; - right = pictPtr[pictIndex][pieceIndex].right; - top = pictPtr[pictIndex][pieceIndex].top; - bottom = pictPtr[pictIndex][pieceIndex].bottom; + left = FROM_LE_16(pictPtr[pictIndex][pieceIndex].left); + right = FROM_LE_16(pictPtr[pictIndex][pieceIndex].right); + top = FROM_LE_16(pictPtr[pictIndex][pieceIndex].top); + bottom = FROM_LE_16(pictPtr[pictIndex][pieceIndex].bottom); if (flags & 2) { if (destX < anim_animAreaLeft) { |