9 #include <simgear/props/props.hxx>
10 #include <simgear/math/SGMath.hxx>
12 ////////////////////////////////////////////////////////////////////////
14 ////////////////////////////////////////////////////////////////////////
17 FGColor::print() const {
18 std::cerr << "red=" << _red << ", green=" << _green
19 << ", blue=" << _blue << ", alpha=" << _alpha << std::endl;
23 FGColor::merge(const SGPropertyNode *node)
29 const SGPropertyNode * n;
30 if ((n = node->getNode("red")))
31 _red = n->getFloatValue(), dirty = true;
32 if ((n = node->getNode("green")))
33 _green = n->getFloatValue(), dirty = true;
34 if ((n = node->getNode("blue")))
35 _blue = n->getFloatValue(), dirty = true;
36 if ((n = node->getNode("alpha")))
37 _alpha = n->getFloatValue(), dirty = true;
42 FGColor::merge(const FGColor *color)
45 if (color && color->_red >= 0.0)
46 _red = color->_red, dirty = true;
47 if (color && color->_green >= 0.0)
48 _green = color->_green, dirty = true;
49 if (color && color->_blue >= 0.0)
50 _blue = color->_blue, dirty = true;
51 if (color && color->_alpha >= 0.0)
52 _alpha = color->_alpha, dirty = true;