]> git.mxchange.org Git - flightgear.git/commitdiff
- fix alpha handling (hopefully)
authormfranz <mfranz>
Wed, 13 Jul 2005 06:37:39 +0000 (06:37 +0000)
committermfranz <mfranz>
Wed, 13 Jul 2005 06:37:39 +0000 (06:37 +0000)
- remove another leftover debugging line

src/GUI/dialog.cxx
src/GUI/new_gui.cxx
src/GUI/new_gui.hxx

index 8d8f141851d0abaabad71ccc5b1d89d4b48ec7e9..3b2484150391344f7ca852462b2ee0a05dd6580e 100644 (file)
@@ -667,7 +667,6 @@ void
 FGDialog::setColor(puObject * object, SGPropertyNode * props, int which)
 {
     string type = props->getName();
-    string watch = "button";
     FGColor c(_gui->getColor("background"));
     c.merge(_gui->getColor(type));
     c.merge(props->getNode("color"));
index 5a9f6ee0a6f0aaf76965ee840b71b67e13872daf..e9f19e29e9eab026ad42aa1713755d982ae5e555 100644 (file)
@@ -372,8 +372,6 @@ FGColor::merge(const SGPropertyNode *node)
         _blue = n->getFloatValue(), dirty = true;
     if ((n = node->getNode("alpha")))
         _alpha = n->getFloatValue(), dirty = true;
-    else
-        _alpha = 1.0;
     return dirty;
 }
 
@@ -389,8 +387,6 @@ FGColor::merge(const FGColor& color)
         _blue = color._blue, dirty = true;
     if (color._alpha >= 0.0)
         _alpha = color._alpha, dirty = true;
-    else
-        _alpha = 1.0;
     return dirty;
 }
 
index e0c46837f1ea6c7db8cded6c422269404592ab05..081970f7066a369025eea92d9dad13ac53283f48 100644 (file)
@@ -220,8 +220,7 @@ public:
         return true;
     }
     bool isValid() const {
-        return _red >= 0.0 && _green >= 0.0 && _blue >= 0.0
-                && _alpha >= 0.0;
+        return _red >= 0.0 && _green >= 0.0 && _blue >= 0.0;
     }
     void print() const {
         std::cerr << "red=" << _red << ", green=" << _green
@@ -236,7 +235,7 @@ public:
     inline float red() const { return clamp(_red); }
     inline float green() const { return clamp(_green); }
     inline float blue() const { return clamp(_blue); }
-    inline float alpha() const { return clamp(_alpha); }
+    inline float alpha() const { return _alpha < 0.0 ? 1.0 : clamp(_alpha); }
 
 protected:
     float _red, _green, _blue, _alpha;