aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-07-16 14:54:49 +0000
committerMax Horn2002-07-16 14:54:49 +0000
commitb019de6872027e1537d21e920b8d5b289c62d63a (patch)
treeae8b9139f466b89c244f46da31e937099785fc6e
parente3ea2d3ad4a2e63e7c0ed3ea0be014431e14430b (diff)
downloadscummvm-rg350-b019de6872027e1537d21e920b8d5b289c62d63a.tar.gz
scummvm-rg350-b019de6872027e1537d21e920b8d5b289c62d63a.tar.bz2
scummvm-rg350-b019de6872027e1537d21e920b8d5b289c62d63a.zip
fixed #555647; got rid of some FIXME's
svn-id: r4570
-rw-r--r--actor.cpp17
-rw-r--r--boxes.cpp24
-rw-r--r--script_v1.cpp8
3 files changed, 22 insertions, 27 deletions
diff --git a/actor.cpp b/actor.cpp
index d2a8c85a75..1bf8af1ad8 100644
--- a/actor.cpp
+++ b/actor.cpp
@@ -340,7 +340,7 @@ void Actor::setupActorScale()
// FIXME: Special 'no scaling' class for MI1 VGA Floppy
// Not totally sure if this is correct.
- if (_vm->_gameId == GID_MONKEY_VGA && isInClass(0x96))
+ if (_vm->_gameId == GID_MONKEY_VGA && isInClass(22))
return;
if (_vm->_features & GF_NO_SCALLING) {
@@ -601,8 +601,19 @@ AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY, int pathfrom)
if (flags & 0x80 && (!(flags & 0x20) || isInClass(0x1F)))
continue;
- if (pathfrom >= firstValidBox && (_vm->getPathToDestBox(pathfrom, j) == -1))
- continue;
+ if (pathfrom >= firstValidBox) {
+ int i = _vm->getPathToDestBox(pathfrom, j);
+ if (i == -1)
+ continue;
+
+ // FIXME - we check here if the box suggested by getPathToDestBox
+ // is locked or not. This prevents us from walking thru
+ // closed doors in some cases in Zak256. However a better fix
+ // would be to recompute the box matrix whenever flags change.
+ flags = _vm->getBoxFlags(i);
+ if (flags & 0x80 && (!(flags & 0x20) || isInClass(0x1F)))
+ continue;
+ }
if (!_vm->inBoxQuickReject(j, dstX, dstY, threshold))
continue;
diff --git a/boxes.cpp b/boxes.cpp
index 1287e32b4c..55d5fc9bec 100644
--- a/boxes.cpp
+++ b/boxes.cpp
@@ -133,10 +133,10 @@ bool Scumm::checkXYInBoxBounds(int b, int x, int y)
if (!compareSlope(box.ur.x, box.ur.y, box.ll.x, box.ll.y, x, y))
return 0;
- if (!compareSlope(box.ll.x, box.ll.y, box.lr.x, box.lr.y, x, y))
+ if (!compareSlope(box.lr.x, box.lr.y, x, y, box.ll.x, box.ll.y))
return 0;
- if (!compareSlope(box.lr.x, box.lr.y, box.ul.x, box.ul.y, x, y))
+ if (!compareSlope(box.ul.x, box.ul.y, x, y, box.lr.x, box.lr.y))
return 0;
return 1;
@@ -151,18 +151,10 @@ void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box)
box->ur.x = (int16)FROM_LE_16(bp->urx);
box->ur.y = (int16)FROM_LE_16(bp->ury);
- if (_features & GF_OLD256) {
- box->ll.x = (int16)FROM_LE_16(bp->lrx);
- box->ll.y = (int16)FROM_LE_16(bp->lry);
- box->lr.x = (int16)FROM_LE_16(bp->llx);
- box->lr.y = (int16)FROM_LE_16(bp->lly);
- } else {
- box->ll.x = (int16)FROM_LE_16(bp->llx);
- box->ll.y = (int16)FROM_LE_16(bp->lly);
- box->lr.x = (int16)FROM_LE_16(bp->lrx);
- box->lr.y = (int16)FROM_LE_16(bp->lry);
- }
-
+ box->ll.x = (int16)FROM_LE_16(bp->llx);
+ box->ll.y = (int16)FROM_LE_16(bp->lly);
+ box->lr.x = (int16)FROM_LE_16(bp->lrx);
+ box->lr.y = (int16)FROM_LE_16(bp->lry);
}
uint Scumm::distanceFromPt(int x, int y, int ptx, int pty)
@@ -190,10 +182,10 @@ ScummPoint Scumm::closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int
int x2, y2;
ScummPoint pt;
- if (llx == ulx) {
+ if (llx == ulx) { // Vertical line?
x2 = ulx;
y2 = y;
- } else if (lly == uly) {
+ } else if (lly == uly) { // Horizontal line?
x2 = x;
y2 = uly;
} else {
diff --git a/script_v1.cpp b/script_v1.cpp
index 2cf216077a..37d9796b0b 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -1345,14 +1345,6 @@ void Scumm::o5_getDist()
o2 = getVarOrDirectWord(0x40);
r = getObjActToObjActDist(o1, o2);
- /* FIXME: Fix for monkey 2, dunno what's wrong in scummvm */
- if (_gameId == GID_MONKEY2 && vm.slot[_currentScript].number == 40 && r < 60)
- r = 60;
-
- /* FIXME: Patch to allow TV cord to be picked up in Zak256 */
- if ((_gameId == GID_ZAK256) && (r > 0))
- r--;
-
setResult(r);
}