Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-11-06 00:37:32 +0000
committerStijn Buys <ingar@osirion.org>2013-11-06 00:37:32 +0000
commit66746168f710cfdfbb0853947985fa0c552e81fb (patch)
treef556ee8468125be1c652b915a443d177687a93aa /src/client/hud.cc
parentc7455f12589b97612ebe928ed11881edf4c4aacc (diff)
Corrected a number of minor HUD target issues.
Diffstat (limited to 'src/client/hud.cc')
-rw-r--r--src/client/hud.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/hud.cc b/src/client/hud.cc
index 8c33014..d402cb2 100644
--- a/src/client/hud.cc
+++ b/src/client/hud.cc
@@ -203,10 +203,10 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target)
// calculate the intersection between the line (0,0,0)-target and the frustum front
float t = (render::FRUSTUMFRONT + 0.001f) / target.x();
- Vector3f center(target *t);
+ Vector3f center(target * t);
- float cx = render::State::width() * (0.5 - center.y());
- float cy = render::State::height() * (0.5 - center.z() * render::State::aspect());
+ float cx = roundf(render::State::width() * (0.5 - center.y()));
+ float cy = roundf(render::State::height() * (0.5 - center.z() * render::State::aspect()));
if ((cx < 0) || (cy < 0) || (cx > render::State::width()) || (cy > render::State::height())) {
draw_offscreen_target(entity, is_active_target);
@@ -308,7 +308,7 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target)
if (is_active_target) {
std::ostringstream strdistance;
- if (controlable) {
+ if (controlable && controlable->owner()) {
strdistance << "^B";
} else if (entity->has_flag(core::Entity::Dockable)) {
strdistance << "^B";
@@ -327,7 +327,7 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target)
strdistance << "--";
}
- label_location.assign(cx - bitmap_radius, cy + bitmap_radius);
+ label_location.assign(cx - bitmap_radius, cy - bitmap_radius);
ui::Paint::draw_label(label_location, label_size, label_font, strdistance.str());
}
@@ -345,7 +345,7 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target)
math::Vector2f pos;
pos[0] = cx - bitmap_radius;
pos[0] += bitmap_radius - 0.5f * hb_width;
- pos[1] = cy + bitmap_radius - hb_height * 0.5f;
+ pos[1] = cy + bitmap_radius - 1.5f * hb_height;
// health bar
gl::color(0, 1, 0, 1);