aboutsummaryrefslogtreecommitdiff
path: root/scumm/boxes.cpp
diff options
context:
space:
mode:
authorMax Horn2003-05-19 20:36:39 +0000
committerMax Horn2003-05-19 20:36:39 +0000
commitbc73fcf386bdf58a87f2c8bb36759a173a1ba866 (patch)
treeb3a80c79e56f31a48f61bd7a46ccc03e392437c5 /scumm/boxes.cpp
parent3703ed51dca1450eb7c6c70ffdaffb34728d8ba5 (diff)
downloadscummvm-rg350-bc73fcf386bdf58a87f2c8bb36759a173a1ba866.tar.gz
scummvm-rg350-bc73fcf386bdf58a87f2c8bb36759a173a1ba866.tar.bz2
scummvm-rg350-bc73fcf386bdf58a87f2c8bb36759a173a1ba866.zip
cleanup
svn-id: r7701
Diffstat (limited to 'scumm/boxes.cpp')
-rw-r--r--scumm/boxes.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp
index 11a8a6793a..ee7b3d18c3 100644
--- a/scumm/boxes.cpp
+++ b/scumm/boxes.cpp
@@ -577,23 +577,27 @@ int Scumm::getPathToDestBox(byte from, byte to) {
boxm = getBoxMatrixBaseAddr();
if (_features & GF_AFTER_V2) {
+ // The v2 box matrix is a real matrix with numOfBoxes rows and columns.
+ // The first numOfBoxes bytes contain indices to the start of the corresponding
+ // row (although that seems unnecessary to me - the value is easily computable.
boxm += numOfBoxes + boxm[from];
return boxm[to];
}
- i = 0;
- while (i != from) {
+ // Skip up to the matrix data for box 'from'
+ for (i = 0; i < from; i++) {
while (*boxm != 0xFF)
boxm += 3;
- i++;
boxm++;
}
+ // Now search for the entry for box 'to'
while (boxm[0] != 0xFF) {
if (boxm[0] <= to && to <= boxm[1])
dest = boxm[2];
boxm += 3;
}
+
return dest;
}