From 4df1759a3636108839f9533268c8ce1b7156e132 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 2 Oct 2005 13:38:27 +0000 Subject: Added check for pthread library (needed for FreeBSD, still needs to be checked on MacOS X) and some cleanups. --- src/map.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index e74a3203..583a01be 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -25,6 +25,7 @@ #include "tileset.h" #include "being.h" #include "graphics.h" +#include "resources/image.h" #include @@ -103,7 +104,9 @@ Map::draw(Graphics *graphics, int scrollX, int scrollY, int layer) { Image *img = getTile(x, y, layer); if (img) { - graphics->drawImage(img, x * 32 - scrollX, y * 32 - scrollY); + graphics->drawImage(img, + x * 32 - scrollX, + y * 32 - scrollY + 32 - img->getHeight()); } } } @@ -251,7 +254,7 @@ Map::findPath(int startX, int startY, int destX, int destY) // Declare open list, a list with open tiles sorted on F cost std::priority_queue openList; - // Return when destination not walkable + // Return empty path when destination not walkable if (!getWalk(destX, destY)) return path; // Reset starting tile's G cost to 0 @@ -266,8 +269,7 @@ Map::findPath(int startX, int startY, int destX, int destY) // Keep trying new open tiles until no more tiles to try or target found while (!openList.empty() && !foundPath) { - // Take the location with the lowest F cost from the open list, and - // add it to the closed list. + // Take the location with the lowest F cost from the open list. Location curr = openList.top(); openList.pop(); -- cgit v1.2.3-70-g09d2