]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/util.cxx
Depreciate NetworkOLK. A big thanks goes to Oliver Delise for implementing it in...
[flightgear.git] / src / Main / util.cxx
index 61e0681654dde59ba06a15967d8b7f67b7740ba8..308ac756ab645cae078edfb6ed8fefb2df906e0d 100644 (file)
 // $Id$
 
 
+#include <simgear/compiler.h>
+
 #include <math.h>
+
+#include <vector>
+SG_USING_STD(vector);
+
+#include <simgear/debug/logstream.hxx>
+
+#include "fg_io.hxx"
+#include "fg_props.hxx"
+#include "globals.hxx"
 #include "util.hxx"
 
 
+void
+fgDefaultWeatherValue (const char * propname, double value)
+{
+    unsigned int i;
+
+    SGPropertyNode * branch = fgGetNode("/environment/config/boundary", true);
+    vector<SGPropertyNode_ptr> entries = branch->getChildren("entry");
+    for (i = 0; i < entries.size(); i++) {
+        entries[i]->setDoubleValue(propname, value);
+    }
+
+    branch = fgGetNode("/environment/config/aloft", true);
+    entries = branch->getChildren("entry");
+    for (i = 0; i < entries.size(); i++) {
+        entries[i]->setDoubleValue(propname, value);
+    }
+}
+
+
+void
+fgExit (int status)
+{
+    SG_LOG(SG_GENERAL, SG_INFO, "Exiting FlightGear with status " << status);
+
+    globals->get_io()->shutdown_all();
+    exit(status);
+}
+
+
 // Originally written by Alex Perry.
 double
 fgGetLowPass (double current, double target, double timeratio)