From b83bca17d42761c41f097ea315d01bb89105f618 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 17 Jul 2011 17:09:00 +0300 Subject: Fix map redrawing if changing map view mode. --- src/game.cpp | 8 ++++++-- src/map.cpp | 8 +++++++- src/map.h | 3 +++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 623d2a069..494d35692 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1040,8 +1040,12 @@ void Game::handleInput() // Find path to mouse (debug purpose) if (!player_node->getDisableGameModifiers()) { - viewport->toggleDebugPath(); - miniStatusWindow->updateStatus(); + if (viewport) + viewport->toggleDebugPath(); + if (miniStatusWindow) + miniStatusWindow->updateStatus(); + if (mCurrentMap) + mCurrentMap->redrawMap(); used = true; } break; diff --git a/src/map.cpp b/src/map.cpp index fa9d014df..c5a7a8816 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -727,8 +727,9 @@ void Map::draw(Graphics *graphics, int scrollX, int scrollY) bool overFringe = false; int updateFlag = 0; - if (mLastX != startX || mLastY != startY) + if (mRedrawMap || mLastX != startX || mLastY != startY) { + mRedrawMap = false; // fill vectors mLastX = startX; mLastY = startY; @@ -1913,6 +1914,11 @@ void Map::reduce() logger->log("tiles reduced: %d", cnt); } +void Map::redrawMap() +{ + mRedrawMap = true; +} + SpecialLayer::SpecialLayer(int width, int height, bool drawSprites): mWidth(width), mHeight(height) { diff --git a/src/map.h b/src/map.h index 6832ed008..749c77ce5 100644 --- a/src/map.h +++ b/src/map.h @@ -507,6 +507,8 @@ class Map : public Properties, public ConfigListener void reduce(); + void redrawMap(); + protected: friend class Actor; friend class Minimap; @@ -607,6 +609,7 @@ class Map : public Properties, public ConfigListener int mLastY; int mLastScrollX; int mLastScrollY; + bool mRedrawMap; }; -- cgit v1.2.3-70-g09d2