diff options
author | Stefan Beller <stefanbeller@googlemail.com> | 2012-08-01 23:25:41 +0200 |
---|---|---|
committer | Stefan Beller <stefanbeller@googlemail.com> | 2012-08-05 13:44:04 +0200 |
commit | 46a6cee5e42c2be0d47e9048111eacd7ef929768 (patch) | |
tree | 919bfd25b39a3e9f6b8b185ba482fa8977278e3e /src/gui/viewport.cpp | |
parent | 11a46f3cfd3499bdfcec11f961ba917de32b5ba2 (diff) | |
download | mana-46a6cee5e42c2be0d47e9048111eacd7ef929768.tar.gz mana-46a6cee5e42c2be0d47e9048111eacd7ef929768.tar.bz2 mana-46a6cee5e42c2be0d47e9048111eacd7ef929768.tar.xz mana-46a6cee5e42c2be0d47e9048111eacd7ef929768.zip |
Add a checkbox to the debugging window to show being ids.
Reviewed-by: Ablu
Conflicts:
src/gui/viewport.cpp
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index e93c285d..0f737fb0 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -249,6 +249,26 @@ void Viewport::draw(gcn::Graphics *gcnGraphics) b->drawSpeech((int) mPixelViewX, (int) mPixelViewY); } + if (mDebugFlags & Map::DEBUG_BEING_IDS) + { + graphics->setColor(gcn::Color(255, 0, 255, 255)); + ActorSpritesConstIterator it, it_end; + const ActorSprites &actors = actorSpriteManager->getAll(); + for (it = actors.begin(), it_end = actors.end(); it != it_end; ++it) + { + Being *being = dynamic_cast<Being*>(*it); + if (!being) + continue; + + const Vector &beingPos = being->getPosition(); + std::string idString = toString(being->getId()); + graphics->drawText(idString, + beingPos.x - mPixelViewX, + beingPos.y - mPixelViewY, + gcn::Graphics::CENTER); + } + } + // Draw contained widgets WindowContainer::draw(gcnGraphics); } @@ -368,7 +388,7 @@ void Viewport::_drawDebugPath(Graphics *graphics) // Draw the path debug information for every beings. ActorSpritesConstIterator it, it_end; const ActorSprites &actors = actorSpriteManager->getAll(); - for (it = actors.begin(), it_end = actors.end() ; it != it_end; it++) + for (it = actors.begin(), it_end = actors.end(); it != it_end; it++) { Being *being = dynamic_cast<Being*>(*it); if (!being) |