X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Futil.cxx;h=308ac756ab645cae078edfb6ed8fefb2df906e0d;hb=e322c70f529eacbfa0460f8f10419657eee00675;hp=61e0681654dde59ba06a15967d8b7f67b7740ba8;hpb=84d2627236ffa2134378b9a66b0e5236df8b54eb;p=flightgear.git diff --git a/src/Main/util.cxx b/src/Main/util.cxx index 61e068165..308ac756a 100644 --- a/src/Main/util.cxx +++ b/src/Main/util.cxx @@ -18,10 +18,50 @@ // $Id$ +#include + #include + +#include +SG_USING_STD(vector); + +#include + +#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 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)