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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Oct 29 14:30:32 CET 2006


Revision: 24565
          http://svn.sourceforge.net/scummvm/?rev=24565&view=rev
Author:   fingolfin
Date:     2006-10-29 05:30:20 -0800 (Sun, 29 Oct 2006)

Log Message:
-----------
cleanup

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

Modified: scummvm/trunk/engines/scumm/actor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/actor.cpp	2006-10-29 07:30:31 UTC (rev 24564)
+++ scummvm/trunk/engines/scumm/actor.cpp	2006-10-29 13:30:20 UTC (rev 24565)
@@ -926,6 +926,28 @@
 	return 0;
 }
 
+static bool inBoxQuickReject(const BoxCoords &box, int x, int y, int threshold) {
+	int t;
+
+	t = x - threshold;
+	if (t > box.ul.x && t > box.ur.x && t > box.lr.x && t > box.ll.x)
+		return true;
+
+	t = x + threshold;
+	if (t < box.ul.x && t < box.ur.x && t < box.lr.x && t < box.ll.x)
+		return true;
+
+	t = y - threshold;
+	if (t > box.ul.y && t > box.ur.y && t > box.lr.y && t > box.ll.y)
+		return true;
+
+	t = y + threshold;
+	if (t < box.ul.y && t < box.ur.y && t < box.lr.y && t < box.ll.y)
+		return true;
+
+	return false;
+}
+
 AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) {
 	const uint thresholdTable[] = { 30, 80, 0 };
 	AdjustBoxResult abr;

Modified: scummvm/trunk/engines/scumm/boxes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/boxes.cpp	2006-10-29 07:30:31 UTC (rev 24564)
+++ scummvm/trunk/engines/scumm/boxes.cpp	2006-10-29 13:30:20 UTC (rev 24565)
@@ -629,28 +629,6 @@
 	return *box;
 }
 
-bool inBoxQuickReject(const BoxCoords &box, int x, int y, int threshold) {
-	int t;
-
-	t = x - threshold;
-	if (t > box.ul.x && t > box.ur.x && t > box.lr.x && t > box.ll.x)
-		return true;
-
-	t = x + threshold;
-	if (t < box.ul.x && t < box.ur.x && t < box.lr.x && t < box.ll.x)
-		return true;
-
-	t = y - threshold;
-	if (t > box.ul.y && t > box.ur.y && t > box.lr.y && t > box.ll.y)
-		return true;
-
-	t = y + threshold;
-	if (t < box.ul.y && t < box.ur.y && t < box.lr.y && t < box.ll.y)
-		return true;
-
-	return false;
-}
-
 int getClosestPtOnBox(const BoxCoords &box, int x, int y, int16& outX, int16& outY) {
 	const Common::Point p(x, y);
 	Common::Point tmp;
@@ -1077,11 +1055,11 @@
 			if (box2.ur.x == box2.ul.x && box.ul.x == box2.ul.x && box.ur.x == box2.ul.x) {
 				bool swappedBox2 = false, swappedBox1 = false;
 				if (box2.ur.y < box2.ul.y) {
-					swappedBox2 = 1;
+					swappedBox2 = true;
 					SWAP(box2.ur.y, box2.ul.y);
 				}
 				if (box.ur.y < box.ul.y) {
-					swappedBox1 = 1;
+					swappedBox1 = true;
 					SWAP(box.ur.y, box.ul.y);
 				}
 				if (box.ur.y < box2.ul.y ||
@@ -1106,11 +1084,11 @@
 			if (box2.ur.y == box2.ul.y && box.ul.y == box2.ul.y && box.ur.y == box2.ul.y) {
 				bool swappedBox2 = false, swappedBox1 = false;
 				if (box2.ur.x < box2.ul.x) {
-					swappedBox2 = 1;
+					swappedBox2 = true;
 					SWAP(box2.ur.x, box2.ul.x);
 				}
 				if (box.ur.x < box.ul.x) {
-					swappedBox1 = 1;
+					swappedBox1 = true;
 					SWAP(box.ur.x, box.ul.x);
 				}
 				if (box.ur.x < box2.ul.x ||

Modified: scummvm/trunk/engines/scumm/boxes.h
===================================================================
--- scummvm/trunk/engines/scumm/boxes.h	2006-10-29 07:30:31 UTC (rev 24564)
+++ scummvm/trunk/engines/scumm/boxes.h	2006-10-29 13:30:20 UTC (rev 24565)
@@ -50,7 +50,6 @@
 	Common::Point lr;
 };
 
-bool inBoxQuickReject(const BoxCoords &box, int x, int y, int threshold);
 int getClosestPtOnBox(const BoxCoords &box, int x, int y, int16& outX, int16& outY);
 
 } // End of namespace Scumm


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