diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/map.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ -2007-02-27 Philipp Sehmisch <tmw@crushnet.org> +2007-03-11 Philipp Sehmisch <tmw@crushnet.org> * src/map.cpp, src/gui/viewport.cpp: Fixed a bug that made the engine not draw the last row and column of the map. diff --git a/src/map.cpp b/src/map.cpp index 3206a218..575f80d3 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -147,10 +147,10 @@ Map::draw(Graphics *graphics, int scrollX, int scrollY, int layer) if (startX < 0) startX = 0; if (startY < 0) startY = 0; - if (endX >= mWidth) endX = mWidth - 1; - if (endY >= mHeight) endY = mHeight - 1; + if (endX >= mWidth) endX = mWidth; + if (endY >= mHeight) endY = mHeight; - for (int y = startY; y <= endY; y++) + for (int y = startY; y < endY; y++) { // If drawing the fringe layer, make sure all sprites above this row of // tiles have been drawn @@ -163,7 +163,7 @@ Map::draw(Graphics *graphics, int scrollX, int scrollY, int layer) } } - for (int x = startX; x <= endX; x++) + for (int x = startX; x < endX; x++) { Image *img = getTile(x, y, layer); if (img) { |