From d763e294f44eb38b94bf7e2055b77a982b72b7c0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 16 Aug 2009 17:34:00 +0000 Subject: more constness --- src/client/hud.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/client/hud.cc') diff --git a/src/client/hud.cc b/src/client/hud.cc index 102c445..662bbe8 100644 --- a/src/client/hud.cc +++ b/src/client/hud.cc @@ -50,19 +50,19 @@ void HUD::draw_offscreen_target(core::Entity *entity, bool is_active_target) float cx = 0; float cy = 0; - if ( target.y*target.y + target.z*target.z < 0.0001 ) { + if ( target.y() * target.y() + target.z() * target.z() < 0.0001 ) { // X - bound, behind (front is visible) cx = 0.0f; cy = -0.5f; - } else if (fabs(target.y) > fabs(target.z)) { + } else if (fabs(target.y()) > fabs(target.z())) { // Y-bound - cx = math::sgnf(target.y) * 0.5f; - cy = 0.5f * target.z / fabs(target.y); + cx = math::sgnf(target.y()) * 0.5f; + cy = 0.5f * target.z() / fabs(target.y()); } else { // Z-bound - cx = 0.5f * target.y / fabs(target.z); - cy = math::sgnf(target.z) * 0.5f; + cx = 0.5f * target.y() / fabs(target.z()); + cy = math::sgnf(target.z()) * 0.5f; } const float r = 16; @@ -117,11 +117,11 @@ void HUD::draw_target(core::Entity *entity, bool is_active_target) target = render::Camera::axis().transpose() * target; // calculate the intersection between the line (0,0,0)-target and the frustum front - float t = (render::FRUSTUMFRONT + 0.001f) / target.x; + float t = (render::FRUSTUMFRONT + 0.001f) / target.x(); 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 = render::State::width() * (0.5 - center.y()); + float cy = 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); -- cgit v1.2.3