[Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.91,1.92 boxes.cpp,1.35,1.36 script_v1.cpp,1.123,1.124

Max Horn fingolfin at users.sourceforge.net
Tue Jul 16 07:55:08 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv18198

Modified Files:
	actor.cpp boxes.cpp script_v1.cpp 
Log Message:
fixed #555647; got rid of some FIXME's

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- actor.cpp	15 Jul 2002 22:56:24 -0000	1.91
+++ actor.cpp	16 Jul 2002 14:54:48 -0000	1.92
@@ -340,7 +340,7 @@
 
 	// 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 @@
 					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;

Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/boxes.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- boxes.cpp	15 Jul 2002 21:50:51 -0000	1.35
+++ boxes.cpp	16 Jul 2002 14:54:49 -0000	1.36
@@ -133,10 +133,10 @@
 	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 @@
 	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 @@
 	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 {

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/script_v1.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- script_v1.cpp	15 Jul 2002 15:56:56 -0000	1.123
+++ script_v1.cpp	16 Jul 2002 14:54:49 -0000	1.124
@@ -1345,14 +1345,6 @@
 	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);
 }
 





More information about the Scummvm-git-logs mailing list