From eb075660e7cb61b138c2da337115c59857f89e17 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 16 Jul 2008 22:55:07 +0000 Subject: network protocol cleanup, radar test (doesn't work) --- src/client/radar.cc | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'src/client/radar.cc') 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::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); } - +*/ } -- cgit v1.2.3