]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.cxx
replace depreciated plib symbols with their new forms
[flightgear.git] / src / GUI / new_gui.cxx
index a7b1ddb2e9618d5388dace7165e3794f18a7ce8d..f45b17ba761e5c3ec3a2618336ba6b4b26ed119c 100644 (file)
@@ -142,6 +142,16 @@ NewGUI::closeDialog (const string& name)
     return false; // dialog wasn't open...
 }
 
+SGPropertyNode_ptr
+NewGUI::getDialog (const string &name)
+{
+    if(_dialog_props.find(name) != _dialog_props.end())
+        return _dialog_props[name];
+
+    SG_LOG(SG_GENERAL, SG_ALERT, "dialog '" << name << "' missing");
+    return 0;
+}
+
 void
 NewGUI::setActiveDialog (FGDialog * dialog)
 {
@@ -181,6 +191,9 @@ NewGUI::clear ()
     delete _menubar;
     _menubar = 0;
     _dialog_props.clear();
+    _itt_t it;
+    for (it = _colors.begin(); it != _colors.end(); ++it)
+      delete it->second;
     _colors.clear();
 }
 
@@ -265,6 +278,9 @@ NewGUI::readDir (const char * path)
 void
 NewGUI::setStyle (void)
 {
+    _itt_t it;
+    for (it = _colors.begin(); it != _colors.end(); ++it)
+      delete it->second;
     _colors.clear();
 
     // set up the traditional colors as default
@@ -379,17 +395,17 @@ FGColor::merge(const SGPropertyNode *node)
 }
 
 bool
-FGColor::merge(const FGColorcolor)
+FGColor::merge(const FGColor *color)
 {
     bool dirty = false;
-    if (color._red >= 0.0)
-        _red = color._red, dirty = true;
-    if (color._green >= 0.0)
-        _green = color._green, dirty = true;
-    if (color._blue >= 0.0)
-        _blue = color._blue, dirty = true;
-    if (color._alpha >= 0.0)
-        _alpha = color._alpha, dirty = true;
+    if (color && color->_red >= 0.0)
+        _red = color->_red, dirty = true;
+    if (color && color->_green >= 0.0)
+        _green = color->_green, dirty = true;
+    if (color && color->_blue >= 0.0)
+        _blue = color->_blue, dirty = true;
+    if (color && color->_alpha >= 0.0)
+        _alpha = color->_alpha, dirty = true;
     return dirty;
 }