From 3885d7521fdaea218e9e8f98156be472f2e58b5c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 21 Mar 2009 12:35:44 +0000 Subject: don't draw a docked ship on the map --- src/client/map.cc | 54 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/client/map.cc b/src/client/map.cc index 10a207c..6ad8b23 100644 --- a/src/client/map.cc +++ b/src/client/map.cc @@ -145,6 +145,13 @@ void Map::draw() draw_icon = false; } } + + if (entity == core::localplayer()->view()) { + valid_target = true; + if (core::application()->time() - floorf(core::application()->time()) > 0.5f) { + draw_icon = false; + } + } } if (entity == core::localcontrol()) { @@ -199,30 +206,33 @@ void Map::draw() // draw localcontrol icon entity = core::localcontrol(); - l.assign(v); - l.x -= s / scale * entity->location().y; - l.y -= s / scale * entity->location().x; - if (core::application()->time() - floorf(core::application()->time()) < 0.5f) { - if (texture_current != texture_entity) { - gl::end(); - texture_current = render::Textures::bind(texture_entity); - gl::begin(gl::Quads); - } - math::Color color(entity->color()); - color.a = 1.0f; - gl::color(color); - glTexCoord2f(0.0f, 0.0f); - gl::vertex(l.x-r, l.y-r); + if (core::localcontrol()->state() != core::Entity::Docked) { + l.assign(v); + l.x -= s / scale * entity->location().y; + l.y -= s / scale * entity->location().x; + if (core::application()->time() - floorf(core::application()->time()) < 0.5f) { + if (texture_current != texture_entity) { + gl::end(); + texture_current = render::Textures::bind(texture_entity); + gl::begin(gl::Quads); + } + + math::Color color(entity->color()); + color.a = 1.0f; + gl::color(color); + glTexCoord2f(0.0f, 0.0f); + gl::vertex(l.x-r, l.y-r); + + glTexCoord2f(1.0f, 0.0f); + gl::vertex(l.x+r, l.y-r); - glTexCoord2f(1.0f, 0.0f); - gl::vertex(l.x+r, l.y-r); - - glTexCoord2f(1.0f, 1.0f); - gl::vertex(l.x+r, l.y+r); - - glTexCoord2f(0.0f, 1.0f); - gl::vertex(l.x-r, l.y+r); + glTexCoord2f(1.0f, 1.0f); + gl::vertex(l.x+r, l.y+r); + + glTexCoord2f(0.0f, 1.0f); + gl::vertex(l.x-r, l.y+r); + } } gl::end(); -- cgit v1.2.3