// FIXME
-float get__heading() { return fgGetFloat("/orientation/heading-deg") * M_PI / 180.0; }
-float get__throttleval() { return fgGetFloat("/controls/engines/engine/throttle"); }
-float get__Vx() { return fgGetFloat("/velocities/uBody-fps"); }
-float get__Vy() { return fgGetFloat("/velocities/vBody-fps"); }
-float get__Vz() { return fgGetFloat("/velocities/wBody-fps"); }
-float get__Ax() { return fgGetFloat("/accelerations/pilot/x-accel-fps_sec"); }
-float get__Ay() { return fgGetFloat("/accelerations/pilot/y-accel-fps_sec"); }
-float get__Az() { return fgGetFloat("/accelerations/pilot/z-accel-fps_sec"); }
-float get__alpha() { return fgGetFloat("/orientation/alpha-deg"); }
-float get__beta() { return fgGetFloat("/orientation/side-slip-deg"); }
+static float get__heading() { return fgGetFloat("/orientation/heading-deg") * M_PI / 180.0; }
+static float get__throttleval() { return fgGetFloat("/controls/engines/engine/throttle"); }
+static float get__Vx() { return fgGetFloat("/velocities/uBody-fps"); }
+static float get__Vy() { return fgGetFloat("/velocities/vBody-fps"); }
+static float get__Vz() { return fgGetFloat("/velocities/wBody-fps"); }
+static float get__Ax() { return fgGetFloat("/accelerations/pilot/x-accel-fps_sec"); }
+static float get__Ay() { return fgGetFloat("/accelerations/pilot/y-accel-fps_sec"); }
+static float get__Az() { return fgGetFloat("/accelerations/pilot/z-accel-fps_sec"); }
+static float get__alpha() { return fgGetFloat("/orientation/alpha-deg"); }
+static float get__beta() { return fgGetFloat("/orientation/side-slip-deg"); }
#undef ENABLE_SP_FDM
#include "HUD.hxx"
+static const float TICK_OFFSET = 2.f;
+
HUD::Tape::Tape(HUD *hud, const SGPropertyNode *n, float x, float y) :
Scale(hud, n, x, y),
_draw_cap_right(n->getBoolValue("cap-right", false)),
_draw_cap_left(n->getBoolValue("cap-left", false)),
_marker_offset(n->getFloatValue("marker-offset")),
+ _label_offset(n->getFloatValue("label-offset", 3.0)),
_label_gap(n->getFloatValue("label-gap-width") / 2.0),
_pointer(n->getBoolValue("enable-pointer", true)),
_format(n->getStringValue("format", "%d"))
float y = _y + (v - vmin) * factor();
- if (y < _y + 0)
+ if (y < _y + TICK_OFFSET)
continue;
- if (y > top - 0)
+ if (y > top - TICK_OFFSET)
break;
if (_div_ratio && i % _div_ratio) { // minor div
draw_bullet(marker_xs + 4, y, 5.0);
if (option_left())
- x = marker_xs, align = RIGHT|VCENTER;
+ x = marker_xs - _label_offset, align = RIGHT|VCENTER;
else
- x = marker_xe, align = LEFT|VCENTER;
+ x = marker_xe + _label_offset, align = LEFT|VCENTER;
}
if (!option_notext()) {
float x = _x + (v - vmin) * factor();
- if (x < _x + 0)
+ if (x < _x + TICK_OFFSET)
continue;
- if (x > right - 0)
+ if (x > right - TICK_OFFSET)
break;
if (_div_ratio && i % _div_ratio) { // minor div
draw_line(x, marker_ys, x, marker_ye);
if (option_top())
- y = top, align = TOP|HCENTER;
+ y = top - _label_offset, align = TOP|HCENTER;
else
- y = _y, align = BOTTOM|HCENTER;
+ y = _y + _label_offset, align = BOTTOM|HCENTER;
}
if (!option_notext()) {