]> git.mxchange.org Git - flightgear.git/commitdiff
- don't hide HUD only because the color index is invalid
authormfranz <mfranz>
Wed, 7 Jun 2006 21:41:32 +0000 (21:41 +0000)
committermfranz <mfranz>
Wed, 7 Jun 2006 21:41:32 +0000 (21:41 +0000)
- initialize color components

src/Cockpit/hud.cxx

index 5ff98efa4853d20aee75fee0862b17e1cc740d76..491e9ad5379e2db55ec737b87057b40874cb8461 100644 (file)
@@ -1048,7 +1048,10 @@ void drawHUD()
 
 // HUD property listener class
 //
-HUD_Properties::HUD_Properties()
+HUD_Properties::HUD_Properties() :
+    _r(1.0),
+    _g(1.0),
+    _b(1.0)
 {
     _colors = fgGetNode("/sim/hud/colors", true)->getChildren("color");
     _which = fgGetNode("/sim/hud/current-color", true);
@@ -1071,9 +1074,7 @@ void HUD_Properties::valueChanged(SGPropertyNode *n)
     _antialiased = _antialiasing->getBoolValue();
     float brt = _brightness->getFloatValue();
     int w = _which->getIntValue();
-    if (w < 0 || w >= int(_colors.size()))
-        _visible = false;
-    else {
+    if (w >= 0 && w < int(_colors.size())) {
         _r = clamp(brt * _colors[w]->getFloatValue("red", 1.0));
         _g = clamp(brt * _colors[w]->getFloatValue("green", 1.0));
         _b = clamp(brt * _colors[w]->getFloatValue("blue", 1.0));