From 8369cc75f560eae4cf0576694911521059051253 Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 7 Jun 2006 21:41:32 +0000 Subject: [PATCH] - don't hide HUD only because the color index is invalid - initialize color components --- src/Cockpit/hud.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index 5ff98efa4..491e9ad53 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -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)); -- 2.39.5