summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-03-03 20:33:40 +0100
committerBertram <yohanndotferreiraatorange.fr>2010-04-12 23:50:22 +0200
commit27c7c5f725f5cf1e3393df9393b08fdc26057212 (patch)
tree566f9d7b043e7482331a0091f03daacd0d095db9 /src/gui/viewport.cpp
parent1bc96ba79136e8e47c077039d09e8a027569bcdb (diff)
downloadmana-client-27c7c5f725f5cf1e3393df9393b08fdc26057212.tar.gz
mana-client-27c7c5f725f5cf1e3393df9393b08fdc26057212.tar.bz2
mana-client-27c7c5f725f5cf1e3393df9393b08fdc26057212.tar.xz
mana-client-27c7c5f725f5cf1e3393df9393b08fdc26057212.zip
Added the player collision rectangle and tweaked colors
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 1c0959d7..ac9bfb2e 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -277,16 +277,23 @@ void Viewport::_drawDebugPath(Graphics *graphics)
else if (Net::getNetworkType() == ServerInfo::MANASERV)
{
const Vector &playerPos = player_node->getPosition();
+ const int playerRadius = player_node->getCollisionRadius();
+ // Draw player collision rectangle
+ graphics->setColor(gcn::Color(128, 128, 0, 120));
+ graphics->fillRectangle(
+ gcn::Rectangle((int) playerPos.x - (int) mPixelViewX - playerRadius,
+ (int) playerPos.y - (int) mPixelViewY - playerRadius,
+ playerRadius * 2, playerRadius * 2));
debugPath = mMap->findPixelPath(
(int) playerPos.x,
(int) playerPos.y,
mMouseX + (int) mPixelViewX,
mMouseY + (int) mPixelViewY,
- player_node->getWidth() / 2, 0xFF);
+ playerRadius, 0xFF);
// We draw the path proposed by mouse
- _drawPath(graphics, debugPath, gcn::Color(255, 0, 255));
+ _drawPath(graphics, debugPath, gcn::Color(128, 0, 128));
// But also the one currently walked on.
_drawPath(graphics, player_node->getPath(), gcn::Color(0, 0, 255));