[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.136,1.137

Max Horn fingolfin at users.sourceforge.net
Sat Jul 12 10:54:10 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv11081

Modified Files:
	actor.cpp 
Log Message:
adjusted V2 actor position to match original (MM) interpreter; tweaked adjustXYToBeInBox mod for V2 (so it's clear why it is needed)

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- actor.cpp	7 Jul 2003 22:11:03 -0000	1.136
+++ actor.cpp	12 Jul 2003 17:53:22 -0000	1.137
@@ -627,7 +627,9 @@
 		if (numBoxes < firstValidBox)
 			return abr;
 
-		bestDist = (_vm->_version <= 2) ? 0xFFFFFF : 0xFFFF;
+		bestDist = 0xFFFF;
+		if (_vm->_version <= 2)
+			bestDist *= 8*2;	// Adjust for the fact that we multiply x by 8 and y by 2
 		bestBox = kInvalidBox;
 
 		// We iterate (backwards) over all boxes, searching the one closest
@@ -902,14 +904,21 @@
 
 	BaseCostumeRenderer* bcr = _vm->_costumeRenderer;
 
-	bcr->updateNbStrips ();
+	bcr->updateNbStrips();
 
 	bcr->_actorX = x - _vm->virtscr[0].xstart;
 	bcr->_actorY = y - elevation;
+
 	if (_vm->_version <= 2) {
-		// We have to adjust the x position by one strip (8 pixels) in V2 games
-		bcr->_actorX += 8;
+		// FIXME: We have to adjust the x position by one strip (8 pixels) in V2 games
+		// However, it is not quite clear to me why. And to fully match the original,
+		// it seems we have to offset by 2 strips when facing left (270 degree).
+		if (facing == 270)
+			bcr->_actorX += 16;
+		else
+			bcr->_actorX += 8;
 	}
+
 	bcr->_scaleX = scalex;
 	bcr->_scaleY = scaley;
 





More information about the Scummvm-git-logs mailing list