[Scummvm-cvs-logs] SF.net SVN: scummvm:[46286] scummvm/trunk/engines/teenagent/scene.cpp

megath at users.sourceforge.net megath at users.sourceforge.net
Mon Dec 7 22:59:51 CET 2009


Revision: 46286
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46286&view=rev
Author:   megath
Date:     2009-12-07 21:59:50 +0000 (Mon, 07 Dec 2009)

Log Message:
-----------
skip walkboxes that contain source or destination point.

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/scene.cpp

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-12-07 20:46:19 UTC (rev 46285)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-12-07 21:59:50 UTC (rev 46286)
@@ -58,9 +58,12 @@
 	p.push_back(src);
 	p.push_back(dst);
 
-	Common::List<int> boxes;
-	for(uint i = 0; i < scene_walkboxes.size(); ++i)
-		boxes.push_back(i);
+	Common::List<uint> boxes;
+	for(uint i = 0; i < scene_walkboxes.size(); ++i) {
+		const Walkbox & w = scene_walkboxes[i];
+		if (!w.rect.in(src) && !w.rect.in(dst))
+			boxes.push_back(i);
+	}
 	
 	for(Path::iterator i = p.begin(); i != p.end() && !boxes.empty(); ) {
 		Path::iterator next = i;
@@ -71,7 +74,7 @@
 		const Common::Point &p1 = *i, &p2 = *next;
 		debug(1, "%d,%d -> %d,%d", p1.x, p1.y, p2.x, p2.y);
 		
-		Common::List<int>::iterator wi;
+		Common::List<uint>::iterator wi;
 		for(wi = boxes.begin(); wi != boxes.end(); ++wi) {
 			const Walkbox & w = scene_walkboxes[*wi];
 			int mask = w.rect.intersects_line(p1, p2);
@@ -87,8 +90,6 @@
 					debug(1, "hint left: %u", w.side_hint[3]);
 					Common::Point w1, w2;
 					w.rect.side(w1, w2, w.side_hint[3], p1);
-					if (w1 == p2)
-						continue;
 					debug(1, "hint: %d,%d-%d,%d", w1.x, w1.y, w2.x, w2.y);
 					p.insert(next, w1);
 					boxes.erase(wi);
@@ -99,8 +100,6 @@
 					debug(1, "hint right: %u", w.side_hint[1]);
 					Common::Point w1, w2;
 					w.rect.side(w1, w2, w.side_hint[1], p1);
-					if (w1 == p2)
-						continue;
 					debug(1, "hint: %d,%d-%d,%d", w1.x, w1.y, w2.x, w2.y);
 					p.insert(next, w1);
 					boxes.erase(wi);
@@ -113,8 +112,6 @@
 					debug(1, "hint top: %u", w.side_hint[0]);
 					Common::Point w1, w2;
 					w.rect.side(w1, w2, w.side_hint[0], p1);
-					if (w1 == p2)
-						continue;
 					debug(1, "hint: %d,%d-%d,%d", w1.x, w1.y, w2.x, w2.y);
 					p.insert(next, w1);
 					boxes.erase(wi);
@@ -125,8 +122,6 @@
 					debug(1, "hint bottom: %u", w.side_hint[2]);
 					Common::Point w1, w2;
 					w.rect.side(w1, w2, w.side_hint[2], p1);
-					if (w1 == p2)
-						continue;
 					debug(1, "hint: %d,%d-%d,%d", w1.x, w1.y, w2.x, w2.y);
 					p.insert(next, w1);
 					boxes.erase(wi);


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