]> git.mxchange.org Git - flightgear.git/commitdiff
treat colors like the other parameters: only copy them from the palette
authormfranz <mfranz>
Sat, 10 Jun 2006 09:22:27 +0000 (09:22 +0000)
committermfranz <mfranz>
Sat, 10 Jun 2006 09:22:27 +0000 (09:22 +0000)
color group /sim/hud/palette/color[*]/ to the active group /sim/hud/color/
if they really exist. (Parameters like <antialiased> can be set in the
active group and be left alone, or set by each <palette> color group.)

src/Cockpit/hud.cxx

index b0db049ad1ec0d19c001eba728c80ac0f9870138..4f51572896fb2f6f8888d90d46799c0ab8f6715a 100644 (file)
@@ -1114,9 +1114,12 @@ void HUD_Properties::valueChanged(SGPropertyNode *node)
             i = 0;
         SGPropertyNode *n = fgGetNode("/sim/hud/palette", true);
         if ((n = n->getChild("color", i, false))) {
-            _red->setFloatValue(n->getFloatValue("red", 1.0));
-            _green->setFloatValue(n->getFloatValue("green", 1.0));
-            _blue->setFloatValue(n->getFloatValue("blue", 1.0));
+            if (n->hasValue("red"))
+                _red->setFloatValue(n->getFloatValue("red", 1.0));
+            if (n->hasValue("green"))
+                _green->setFloatValue(n->getFloatValue("green", 1.0));
+            if (n->hasValue("blue"))
+                _blue->setFloatValue(n->getFloatValue("blue", 1.0));
             if (n->hasValue("alpha"))
                 _alpha->setFloatValue(n->getFloatValue("alpha", 0.67));
             if (n->hasValue("alpha-clamp"))