- read new HUD from /sim/hud/path[1] (was: /hud)
- cosmetics
This commit is contained in:
parent
7ae6dd709a
commit
d94e691f1e
3 changed files with 8 additions and 10 deletions
|
@ -134,7 +134,7 @@ void HUD::init()
|
||||||
_font_renderer->setPointSize(_font_size);
|
_font_renderer->setPointSize(_font_size);
|
||||||
_text_list.setFont(_font_renderer);
|
_text_list.setFont(_font_renderer);
|
||||||
|
|
||||||
load(fgGetString("/hud", "Huds/default.xml"));
|
load(fgGetString("/sim/hud/path[1]", "Huds/default.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -561,12 +561,11 @@ private:
|
||||||
_locStippleLineList.add(LineSegment(x1, y1, x2, y2));
|
_locStippleLineList.add(LineSegment(x1, y1, x2, y2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum Type { PITCH, CLIMB_DIVE } _type;
|
||||||
Input _pitch;
|
Input _pitch;
|
||||||
Input _roll;
|
Input _roll;
|
||||||
enum Type { PITCH, CLIMB_DIVE } _type;
|
|
||||||
float _width_units;
|
float _width_units;
|
||||||
int div_units;
|
int _div_units;
|
||||||
unsigned int label_pos;
|
|
||||||
unsigned int _scr_hole;
|
unsigned int _scr_hole;
|
||||||
float _vmax;
|
float _vmax;
|
||||||
float _vmin;
|
float _vmin;
|
||||||
|
|
|
@ -45,8 +45,7 @@ HUD::Ladder::Ladder(HUD *hud, const SGPropertyNode *n, float x, float y) :
|
||||||
_pitch(n->getNode("pitch-input", false)),
|
_pitch(n->getNode("pitch-input", false)),
|
||||||
_roll(n->getNode("roll-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")))),
|
_div_units(int(fabs(n->getFloatValue("divisions")))),
|
||||||
label_pos(n->getIntValue("lbl-pos")),
|
|
||||||
_scr_hole(n->getIntValue("screen-hole")),
|
_scr_hole(n->getIntValue("screen-hole")),
|
||||||
_compression(n->getFloatValue("compression-factor")),
|
_compression(n->getFloatValue("compression-factor")),
|
||||||
_frl(n->getBoolValue("enable-fuselage-ref-line", false)),
|
_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);
|
glRotatef(roll_value * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0);
|
||||||
// FRL marker not rotated - this line shifted below
|
// FRL marker not rotated - this line shifted below
|
||||||
|
|
||||||
if (div_units) {
|
if (_div_units) {
|
||||||
const int BUFSIZE = 8;
|
const int BUFSIZE = 8;
|
||||||
char buf[BUFSIZE];
|
char buf[BUFSIZE];
|
||||||
float label_length;
|
float label_length;
|
||||||
|
@ -468,7 +467,7 @@ void HUD::Ladder::draw(void)
|
||||||
for (; i < last; i++) {
|
for (; i < last; i++) {
|
||||||
y = (i - pitch_value) * _compression + .5f;
|
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);
|
snprintf(buf, BUFSIZE, "%d", i);
|
||||||
font->getBBox(buf, pointsize, italic, &left, &right, &bot, &top);
|
font->getBBox(buf, pointsize, italic, &left, &right, &bot, &top);
|
||||||
label_length = right + left;
|
label_length = right + left;
|
||||||
|
@ -513,7 +512,7 @@ void HUD::Ladder::draw(void)
|
||||||
else // _type == CLIMB_DIVE
|
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
|
if (!(i % _div_units)) { // At integral multiple of div
|
||||||
snprintf(buf, BUFSIZE, "%d", i);
|
snprintf(buf, BUFSIZE, "%d", i);
|
||||||
font->getBBox(buf, pointsize, italic, &left, &right, &bot, &top);
|
font->getBBox(buf, pointsize, italic, &left, &right, &bot, &top);
|
||||||
label_length = right + left;
|
label_length = right + left;
|
||||||
|
|
Loading…
Reference in a new issue