Item(hud, n, x, y),
_pitch(n->getNode("pitch-input", false)),
_roll(n->getNode("roll-input", false)),
- width_units(int(n->getFloatValue("display-span"))),
+ _width_units(int(n->getFloatValue("display-span"))),
div_units(int(fabs(n->getFloatValue("divisions")))),
- minor_div(0 /* hud.cxx: static float minor_division = 0 */),
label_pos(n->getIntValue("lbl-pos")),
_scr_hole(n->getIntValue("screen-hole")),
_compression(n->getFloatValue("compression-factor")),
_drift_marker(n->getBoolValue("enable-drift-marker", false)),
_alpha_bracket(n->getBoolValue("enable-alpha-bracket", false)),
_energy_marker(n->getBoolValue("enable-energy-marker", false)),
- _climb_dive_marker(n->getBoolValue("enable-climb-dive-marker", false)), // WTF FIXME
+ _climb_dive_marker(n->getBoolValue("enable-climb-dive-marker", false)),
_glide_slope_marker(n->getBoolValue("enable-glide-slope-marker",false)),
_glide_slope(n->getFloatValue("glide-slope", -4.0)),
_energy_worm(n->getBoolValue("enable-energy-marker", false)),
const char *t = n->getStringValue("type");
_type = strcmp(t, "climb-dive") ? PITCH : CLIMB_DIVE;
- if (!width_units)
- width_units = 45;
+ if (!_width_units)
+ _width_units = 45;
- _vmax = width_units / 2;
+ _vmax = _width_units / 2;
_vmin = -_vmax;
}
GLdouble eqn_right[4] = {1.0, 0.0, 0.0, 100.0};
Point centroid = get_centroid();
- Rect box = get_location();
- float half_span = box.right / 2.0;
+ float half_span = _w / 2.0;
float roll_value = _roll.getFloatValue() * SGD_DEGREES_TO_RADIANS; // FIXME rad/deg conversion
alpha = get__aoa();
pla = get__throttleval();
//****************************************************************
if (climb_dive_ladder) { // CONFORMAL_HUD
- _vmin = pitch_value - (float)width_units;
- _vmax = pitch_value + (float)width_units;
+ _vmin = pitch_value - _width_units;
+ _vmax = pitch_value + _width_units;
glTranslatef(vel_x, vel_y, 0);
} else { // pitch_ladder - Default Hud
- _vmin = pitch_value - (float)width_units * 0.5f;
- _vmax = pitch_value + (float)width_units * 0.5f;
+ _vmin = pitch_value - _width_units * 0.5f;
+ _vmax = pitch_value + _width_units * 0.5f;
}
glRotatef(roll_value * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0);
if (!_scr_hole) {
x_end = half_span;
- for (; i<last; i++) {
- y = (((float)(i - pitch_value) * _compression) + .5f);
+ for (; i < last; i++) {
+ y = (i - pitch_value) * _compression + .5f;
if (!(i % div_units)) { // At integral multiple of div
snprintf(buf, BUFSIZE, "%d", i);
} else { // if (_scr_hole)
// Draw ladder with space in the middle of the lines
- float hole = (float)((_scr_hole) / 2.0f);
+ float hole = _scr_hole / 2.0f;
x_end = -half_span + hole;
x_ini2 = half_span - hole;
for (; i < last; i++) {
if (_type == PITCH)
- y = (((float)(i - pitch_value) * _compression) + .5);
+ y = float(i - pitch_value) * _compression + .5;
else // _type == CLIMB_DIVE
- y = (((float)(i - actslope) * _compression) + .5);
+ y = float(i - actslope) * _compression + .5;
if (!(i % div_units)) { // At integral multiple of div
snprintf(buf, BUFSIZE, "%d", i);
glBegin(GL_POINTS);
for (int count = 0; count <= 200; count++) {
- float temp = count * 3.142 * 3 / (200.0 * 2.0);
+ float temp = count * SG_PI * 3 / (200.0 * 2.0);
float temp1 = temp - (45.0 * SGD_DEGREES_TO_RADIANS);
x1 = x + r * cos(temp1);
y1 = y + r * sin(temp1);
ycent1 = ycentre;
for (int count = 1; count <= 400; count++) {
- float temp = count * 2 * 3.142 / 400.0;
+ float temp = count * 2 * SG_PI / 400.0;
xcent2 = xcentre + r * cos(temp);
ycent2 = ycentre + r * sin(temp);
//line in the middle of circle
draw_line(xcentre - 7.5, ycentre, xcentre + 7.5, ycentre);
- float theta = asin (2.5 / 7.5);
+ float theta = asin(2.5 / 7.5);
float theta1 = asin(5.0 / 7.5);
x1 = xcentre + r * cos(theta);