[Scummvm-cvs-logs] CVS: scummvm/scumm boxes.cpp,1.11,1.12

James Brown ender at users.sourceforge.net
Sun Feb 16 08:55:06 CET 2003


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

Modified Files:
	boxes.cpp 
Log Message:
Patch 684732: CMI Walkbox Fix - really, this does seem to be the only solution


Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/boxes.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- boxes.cpp	13 Jan 2003 14:04:40 -0000	1.11
+++ boxes.cpp	16 Feb 2003 16:54:17 -0000	1.12
@@ -308,6 +308,28 @@
 		box->ll.y = (int32)FROM_LE_32(bp->v8.lly);
 		box->lr.x = (int32)FROM_LE_32(bp->v8.lrx);
 		box->lr.y = (int32)FROM_LE_32(bp->v8.lry);
+
+		// FIXME: Some walkboxes in CMI appear to have been flipped,
+		// in the sense that for instance the lower boundary is above
+		// the upper one. Can that really be the case, or is there
+		// some more sinister problem afoot?
+		//
+		// Is this fix sufficient, or will we need something more
+		// elaborate?
+
+		if (box->ul.y > box->ll.y && box->ur.y > box->lr.y) {
+			SWAP(box->ul.x, box->ll.x);
+			SWAP(box->ul.y, box->ll.y);
+			SWAP(box->ur.x, box->lr.x);
+			SWAP(box->ur.y, box->lr.y);
+		}
+
+		if (box->ul.x > box->ur.x && box->ll.x > box->lr.x) {
+			SWAP(box->ul.x, box->ur.x);
+			SWAP(box->ul.y, box->ur.y);
+			SWAP(box->ll.x, box->lr.x);
+			SWAP(box->ll.y, box->lr.y);
+		}
 	} else {
 		box->ul.x = (int16)FROM_LE_16(bp->old.ulx);
 		box->ul.y = (int16)FROM_LE_16(bp->old.uly);





More information about the Scummvm-git-logs mailing list