From d94e691f1e8c428a3f567ba3f0689d881fefd481 Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 11 Jul 2006 16:09:35 +0000 Subject: [PATCH] - read new HUD from /sim/hud/path[1] (was: /hud) - cosmetics --- src/Instrumentation/HUD/HUD.cxx | 2 +- src/Instrumentation/HUD/HUD.hxx | 7 +++---- src/Instrumentation/HUD/HUD_ladder.cxx | 9 ++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Instrumentation/HUD/HUD.cxx b/src/Instrumentation/HUD/HUD.cxx index 8a6e04916..35562ccea 100644 --- a/src/Instrumentation/HUD/HUD.cxx +++ b/src/Instrumentation/HUD/HUD.cxx @@ -134,7 +134,7 @@ void HUD::init() _font_renderer->setPointSize(_font_size); _text_list.setFont(_font_renderer); - load(fgGetString("/hud", "Huds/default.xml")); + load(fgGetString("/sim/hud/path[1]", "Huds/default.xml")); } diff --git a/src/Instrumentation/HUD/HUD.hxx b/src/Instrumentation/HUD/HUD.hxx index 42e334f12..1a6a72a0c 100644 --- a/src/Instrumentation/HUD/HUD.hxx +++ b/src/Instrumentation/HUD/HUD.hxx @@ -561,12 +561,11 @@ private: _locStippleLineList.add(LineSegment(x1, y1, x2, y2)); } + enum Type { PITCH, CLIMB_DIVE } _type; Input _pitch; Input _roll; - enum Type { PITCH, CLIMB_DIVE } _type; - float _width_units; - int div_units; - unsigned int label_pos; + float _width_units; + int _div_units; unsigned int _scr_hole; float _vmax; float _vmin; diff --git a/src/Instrumentation/HUD/HUD_ladder.cxx b/src/Instrumentation/HUD/HUD_ladder.cxx index 9cb0a4baf..544ff23c2 100644 --- a/src/Instrumentation/HUD/HUD_ladder.cxx +++ b/src/Instrumentation/HUD/HUD_ladder.cxx @@ -45,8 +45,7 @@ HUD::Ladder::Ladder(HUD *hud, const SGPropertyNode *n, float x, float y) : _pitch(n->getNode("pitch-input", false)), _roll(n->getNode("roll-input", false)), _width_units(int(n->getFloatValue("display-span"))), - div_units(int(fabs(n->getFloatValue("divisions")))), - label_pos(n->getIntValue("lbl-pos")), + _div_units(int(fabs(n->getFloatValue("divisions")))), _scr_hole(n->getIntValue("screen-hole")), _compression(n->getFloatValue("compression-factor")), _frl(n->getBoolValue("enable-fuselage-ref-line", false)), @@ -433,7 +432,7 @@ void HUD::Ladder::draw(void) glRotatef(roll_value * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0); // FRL marker not rotated - this line shifted below - if (div_units) { + if (_div_units) { const int BUFSIZE = 8; char buf[BUFSIZE]; float label_length; @@ -468,7 +467,7 @@ void HUD::Ladder::draw(void) for (; i < last; i++) { y = (i - pitch_value) * _compression + .5f; - if (!(i % div_units)) { // At integral multiple of div + if (!(i % _div_units)) { // At integral multiple of div snprintf(buf, BUFSIZE, "%d", i); font->getBBox(buf, pointsize, italic, &left, &right, &bot, &top); label_length = right + left; @@ -513,7 +512,7 @@ void HUD::Ladder::draw(void) else // _type == CLIMB_DIVE y = float(i - actslope) * _compression + .5; - if (!(i % div_units)) { // At integral multiple of div + if (!(i % _div_units)) { // At integral multiple of div snprintf(buf, BUFSIZE, "%d", i); font->getBBox(buf, pointsize, italic, &left, &right, &bot, &top); label_length = right + left;