[Scummvm-cvs-logs] SF.net SVN: scummvm: [24369] scummvm/trunk/engines/scumm/boxes.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Oct 18 16:30:36 CEST 2006


Revision: 24369
          http://svn.sourceforge.net/scummvm/?rev=24369&view=rev
Author:   fingolfin
Date:     2006-10-18 07:30:29 -0700 (Wed, 18 Oct 2006)

Log Message:
-----------
SCUMM: Be less generous to code invoking checkXYInBoxBounds with a bad box param: we now abort instead of ignoring it silently. May cause some trivial-to-fix regressions

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/boxes.cpp

Modified: scummvm/trunk/engines/scumm/boxes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/boxes.cpp	2006-10-18 14:21:44 UTC (rev 24368)
+++ scummvm/trunk/engines/scumm/boxes.cpp	2006-10-18 14:30:29 UTC (rev 24369)
@@ -439,13 +439,8 @@
 }
 
 bool ScummEngine::checkXYInBoxBounds(int b, int x, int y) {
-	BoxCoords box;
+	BoxCoords box = getBoxCoordinates(b);
 
-	if (b < 0 || b == Actor::kInvalidBox)
-		return false;
-
-	box = getBoxCoordinates(b);
-
 	if (x < box.ul.x && x < box.ur.x && x < box.lr.x && x < box.ll.x)
 		return false;
 
@@ -458,8 +453,8 @@
 	if (y > box.ul.y && y > box.ur.y && y > box.lr.y && y > box.ll.y)
 		return false;
 
-	if (box.ul.x == box.ur.x && box.ul.y == box.ur.y && box.lr.x == box.ll.x && box.lr.y == box.ll.y ||
-		box.ul.x == box.ll.x && box.ul.y == box.ll.y && box.ur.x == box.lr.x && box.ur.y == box.lr.y) {
+	if (box.ul == box.ur && box.lr == box.ll ||
+		box.ul == box.ll && box.ur == box.lr) {
 
 		Common::Point pt;
 		pt = closestPtOnLine(box.ul, box.lr, x, y);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list