[Scummvm-cvs-logs] SF.net SVN: scummvm:[45861] scummvm/trunk/engines/teenagent/objects.h

megath at users.sourceforge.net megath at users.sourceforge.net
Thu Nov 12 14:29:09 CET 2009


Revision: 45861
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45861&view=rev
Author:   megath
Date:     2009-11-12 13:29:09 +0000 (Thu, 12 Nov 2009)

Log Message:
-----------
fixed intersects functions

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/objects.h

Modified: scummvm/trunk/engines/teenagent/objects.h
===================================================================
--- scummvm/trunk/engines/teenagent/objects.h	2009-11-12 13:01:35 UTC (rev 45860)
+++ scummvm/trunk/engines/teenagent/objects.h	2009-11-12 13:29:09 UTC (rev 45861)
@@ -64,11 +64,15 @@
 	void save() const;
 	
 	inline bool intersects_hline(int x1, int x2, int y) const {
-		return x1 < right && x2 > left && y >= top && y < bottom;
+		if (x1 > x2)
+			SWAP(x1, x2);
+		return y >= top && y <= bottom && x1 <= right && x2 >= left;
 	}
 
 	inline bool intersects_vline(int x, int y1, int y2) const {
-		return y1 < bottom && y2 > top && x >= left && x < right;
+		if (y1 > y2)
+			SWAP(y1, y2);
+		return x >= left && x <= right && y1 <= bottom && y2 >= top;
 	}
 
 protected:


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