diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
commit | bd56bf8afdab16383ed8ad08412a8c807f84af85 (patch) | |
tree | 0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/gui/minimap.cpp | |
parent | 5359640b6f271af31f6423df9d661433eff89a3e (diff) | |
download | mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2 mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip |
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r-- | src/gui/minimap.cpp | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index b23d7b1c..1165d7bb 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -24,6 +24,7 @@ #include "minimap.h" #include "../being.h" +#include "../beingmanager.h" #include "../graphics.h" #include "../map.h" @@ -86,38 +87,36 @@ void Minimap::draw(gcn::Graphics *graphics) mMapImage, getPadding(), getTitleBarHeight()); } - std::list<Being*>::iterator bi; + Beings *beings = beingManager->getAll(); + Beings::iterator bi; - for (bi = beings.begin(); bi != beings.end(); bi++) + for (bi = beings->begin(); bi != beings->end(); bi++) { Being *being = (*bi); + int dotSize = 1; - if (being == player_node) - { - // Player dot - graphics->setColor(gcn::Color(209, 52, 61)); - graphics->fillRectangle(gcn::Rectangle( - being->x / 2 + getPadding() - 1, - being->y / 2 + getTitleBarHeight() - 1, 3, 3)); - } - else - { - switch (being->getType()) { - case Being::PLAYER: - graphics->setColor(gcn::Color(61, 52, 209)); - break; - - case Being::MONSTER: - graphics->setColor(gcn::Color(209, 52, 61)); - break; - - default: - break; - } - - graphics->fillRectangle(gcn::Rectangle( - being->x / 2 + getPadding(), - being->y / 2 + getTitleBarHeight(), 1, 1)); + switch (being->getType()) { + case Being::LOCALPLAYER: + dotSize = 3; + graphics->setColor(gcn::Color(209, 52, 61)); + break; + + case Being::PLAYER: + graphics->setColor(gcn::Color(61, 52, 209)); + break; + + case Being::MONSTER: + graphics->setColor(gcn::Color(209, 52, 61)); + break; + + default: + break; } + + int offset = (dotSize - 1) / 2; + + graphics->fillRectangle(gcn::Rectangle( + being->x / 2 + getPadding() - offset, + being->y / 2 + getTitleBarHeight() - offset, 1, 1)); } } |