diff options
author | James Brown | 2003-02-16 16:54:17 +0000 |
---|---|---|
committer | James Brown | 2003-02-16 16:54:17 +0000 |
commit | 6351fe7d05c8aea35c750b6298b609e0ecae1846 (patch) | |
tree | b54f4c40bd99b9c4c0a3e3e650d3d1ad6de1293f /scumm/boxes.cpp | |
parent | 656bde5aa9504ae62a3c3266f276f9e1c9b9d961 (diff) | |
download | scummvm-rg350-6351fe7d05c8aea35c750b6298b609e0ecae1846.tar.gz scummvm-rg350-6351fe7d05c8aea35c750b6298b609e0ecae1846.tar.bz2 scummvm-rg350-6351fe7d05c8aea35c750b6298b609e0ecae1846.zip |
Patch 684732: CMI Walkbox Fix - really, this does seem to be the only solution
svn-id: r6612
Diffstat (limited to 'scumm/boxes.cpp')
-rw-r--r-- | scumm/boxes.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp index 07765a1e31..7f3bec66fd 100644 --- a/scumm/boxes.cpp +++ b/scumm/boxes.cpp @@ -308,6 +308,28 @@ void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) box->ll.y = (int32)FROM_LE_32(bp->v8.lly); box->lr.x = (int32)FROM_LE_32(bp->v8.lrx); box->lr.y = (int32)FROM_LE_32(bp->v8.lry); + + // FIXME: Some walkboxes in CMI appear to have been flipped, + // in the sense that for instance the lower boundary is above + // the upper one. Can that really be the case, or is there + // some more sinister problem afoot? + // + // Is this fix sufficient, or will we need something more + // elaborate? + + if (box->ul.y > box->ll.y && box->ur.y > box->lr.y) { + SWAP(box->ul.x, box->ll.x); + SWAP(box->ul.y, box->ll.y); + SWAP(box->ur.x, box->lr.x); + SWAP(box->ur.y, box->lr.y); + } + + if (box->ul.x > box->ur.x && box->ll.x > box->lr.x) { + SWAP(box->ul.x, box->ur.x); + SWAP(box->ul.y, box->ur.y); + SWAP(box->ll.x, box->lr.x); + SWAP(box->ll.y, box->lr.y); + } } else { box->ul.x = (int16)FROM_LE_16(bp->old.ulx); box->ul.y = (int16)FROM_LE_16(bp->old.uly); |