diff options
author | Max Horn | 2002-07-16 14:54:49 +0000 |
---|---|---|
committer | Max Horn | 2002-07-16 14:54:49 +0000 |
commit | b019de6872027e1537d21e920b8d5b289c62d63a (patch) | |
tree | ae8b9139f466b89c244f46da31e937099785fc6e | |
parent | e3ea2d3ad4a2e63e7c0ed3ea0be014431e14430b (diff) | |
download | scummvm-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.cpp | 17 | ||||
-rw-r--r-- | boxes.cpp | 24 | ||||
-rw-r--r-- | script_v1.cpp | 8 |
3 files changed, 22 insertions, 27 deletions
@@ -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; @@ -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); } |