aboutsummaryrefslogtreecommitdiff
path: root/scumm/boxes.cpp
diff options
context:
space:
mode:
authorMax Horn2003-07-12 12:40:20 +0000
committerMax Horn2003-07-12 12:40:20 +0000
commitb2f737888dfb28ca9d60685c8b433ab955be4ff7 (patch)
treeec82a99c6df2a2764c723944665ef3903e6af4ac /scumm/boxes.cpp
parentee62678369742eca033378328649320d92e32f6b (diff)
downloadscummvm-rg350-b2f737888dfb28ca9d60685c8b433ab955be4ff7.tar.gz
scummvm-rg350-b2f737888dfb28ca9d60685c8b433ab955be4ff7.tar.bz2
scummvm-rg350-b2f737888dfb28ca9d60685c8b433ab955be4ff7.zip
fix box coordinates for v1/v2 games (boxes are now contiguous)
svn-id: r8943
Diffstat (limited to 'scumm/boxes.cpp')
-rw-r--r--scumm/boxes.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp
index 6e430b9d85..11e72e551d 100644
--- a/scumm/boxes.cpp
+++ b/scumm/boxes.cpp
@@ -356,15 +356,25 @@ void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) {
SWAP(box->ll.y, box->lr.y);
}
} else if (_version <= 2) {
+ // We have to adjust the x/y values of the walk box, since the coordinates
+ // given in the data files are *character* coordinates. Each character is
+ // 8 pixels wide and 2 pixels high. To compute the leftmost *pixel*
+ // coordinate of the walkbox, we just multiply the left most char-x by 8.
+ // For the rightmost, however, we multiply by 8 and then add 7 - to account
+ // for the fact that the character has a width of 8 pixels.
+ // We proceeed likewise for the y coordinates.
+
box->ul.x = bp->v2.ulx * 8;
box->ul.y = bp->v2.uy * 2;
- box->ur.x = bp->v2.urx * 8;
+ box->ur.x = bp->v2.urx * 8 + 7;
box->ur.y = bp->v2.uy * 2;
box->ll.x = bp->v2.llx * 8;
- box->ll.y = bp->v2.ly * 2;
- box->lr.x = bp->v2.lrx * 8;
- box->lr.y = bp->v2.ly * 2;
+ box->ll.y = bp->v2.ly * 2 + 1;
+ box->lr.x = bp->v2.lrx * 8 + 7;
+ box->lr.y = bp->v2.ly * 2 + 1;
+
+
} else {
box->ul.x = (int16)READ_LE_UINT16(&bp->old.ulx);
box->ul.y = (int16)READ_LE_UINT16(&bp->old.uly);