diff options
Diffstat (limited to 'src/client/radar.cc')
-rw-r--r-- | src/client/radar.cc | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/client/radar.cc b/src/client/radar.cc index cc4257e..cdf5391 100644 --- a/src/client/radar.cc +++ b/src/client/radar.cc @@ -4,14 +4,48 @@ the terms of the GNU General Public License version 2 */ +#include "auxiliary/functions.h" #include "core/core.h" #include "client/radar.h" #include "client/video.h" #include "render/draw.h" #include "render/render.h" +#include "render/text.h" + namespace client { +void Radar::draw() { + using namespace render; + + if (!core::localcontrol()) + return; + + float y = 4 + Text::fontheight(); + Text::draw(4, y, "^N------------ ^BRadar test ^N--------------"); + y += Text::fontheight(); + + gl::color(1.0f, 1.0f, 1.0f, 1.0f); + + std::map<unsigned int, core::Entity *>::iterator it; + for (it=core::Entity::registry.begin(); it != core::Entity::registry.end(); it++) { + core::Entity *entity = (*it).second; + core::ClientState *state = entity->state(); + + if (state && state->targetable() && entity->label().size()) { + gl::color(entity->color()); + std::ostringstream line; + line << aux::pad_right(entity->name(), 24) << + state->state_screenlocation[0] << " " << + state->state_screenlocation[1] << " " << + state->state_screenlocation[2] << " "; + Text::draw(4, y, line.str()); + y += Text::fontheight(); + } + } + +} +/* void Radar::draw() { using namespace render; @@ -75,5 +109,5 @@ void Radar::draw() glDisableClientState(GL_NORMAL_ARRAY); //glDisableClientState(GL_COLOR_ARRAY); } - +*/ } |