diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-01-09 01:01:17 +0200 |
---|---|---|
committer | Blue <bluesansdouze@gmail.com> | 2010-01-09 00:20:08 +0100 |
commit | b5643b417e12308163802c3a11ac28f1abd239f9 (patch) | |
tree | 68318813f4760929a5c475a655e2113d9b8db8d4 /src/gui/viewport.cpp | |
parent | 104266da0f92ab2a765598dde59bf2e7f6426484 (diff) | |
download | mana-b5643b417e12308163802c3a11ac28f1abd239f9.tar.gz mana-b5643b417e12308163802c3a11ac28f1abd239f9.tar.bz2 mana-b5643b417e12308163802c3a11ac28f1abd239f9.tar.xz mana-b5643b417e12308163802c3a11ac28f1abd239f9.zip |
Add special map mode.
This mode hide big map objects and show collisions.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 01aa75ee..dc4b9721 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -86,6 +86,10 @@ Viewport::~Viewport() void Viewport::setMap(Map *map) { + if (mMap && map) + { + map->setDebugFlags(mMap->getDebugFlags()); + } mMap = map; } @@ -191,8 +195,10 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) if (mShowDebugPath) { mMap->drawCollision(graphics, (int) mPixelViewX, - (int) mPixelViewY); - _drawDebugPath(graphics); + (int) mPixelViewY, + mShowDebugPath); + if (mShowDebugPath == Map::MAP_DEBUG) + _drawDebugPath(graphics); } } @@ -462,3 +468,15 @@ void Viewport::mouseMoved(gcn::MouseEvent &event) mSelectedBeing = beingManager->findBeing(tilex, tiley); } + +void Viewport::toggleDebugPath() +{ + mShowDebugPath++; + if (mShowDebugPath > Map::MAP_SPECIAL) + mShowDebugPath = Map::MAP_NORMAL; + if (mMap) + { + mMap->setDebugFlags(mShowDebugPath); + } +} + |