[Scummvm-cvs-logs] SF.net SVN: scummvm:[45599] scummvm/trunk/engines/draci/walking.cpp

spalek at users.sourceforge.net spalek at users.sourceforge.net
Sun Nov 1 20:30:51 CET 2009


Revision: 45599
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45599&view=rev
Author:   spalek
Date:     2009-11-01 19:30:51 +0000 (Sun, 01 Nov 2009)

Log Message:
-----------
One more clean-up of the path-finding code

Modified Paths:
--------------
    scummvm/trunk/engines/draci/walking.cpp

Modified: scummvm/trunk/engines/draci/walking.cpp
===================================================================
--- scummvm/trunk/engines/draci/walking.cpp	2009-11-01 19:22:41 UTC (rev 45598)
+++ scummvm/trunk/engines/draci/walking.cpp	2009-11-01 19:30:51 UTC (rev 45599)
@@ -218,16 +218,17 @@
 		// with the smallest number of turns is preferred.
 		for (int addDir = 0; addDir < 4; ++addDir) {
 			const int probeDirection = (from + addDir) % 4;
-			const Common::Point p(here.x + kDirections[probeDirection][0], here.y + kDirections[probeDirection][1]);
-			if (p.x < 0 || p.x >= _mapWidth || p.y < 0 || p.y >= _mapHeight) {
+			const int x = here.x + kDirections[probeDirection][0];
+			const int y = here.y + kDirections[probeDirection][1];
+			if (x < 0 || x >= _mapWidth || y < 0 || y >= _mapHeight) {
 				continue;
 			}
 			// If this point is walkable and we haven't seen it
 			// yet, record how we have reached it and insert it
 			// into the round buffer for exploration.
-			if (getPixel(p.x, p.y) && cameFrom[p.y * _mapWidth + p.x] == -1) {
-				cameFrom[p.y * _mapWidth + p.x] = probeDirection;
-				toSearch[toWrite++] = p;
+			if (getPixel(x, y) && cameFrom[y * _mapWidth + x] == -1) {
+				cameFrom[y * _mapWidth + x] = probeDirection;
+				toSearch[toWrite++] = Common::Point(x, y);
 				toWrite %= bufSize;
 			}
 		}


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