]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/tmp.cxx
Currently, when the sim pauses, all IO is also halted. To me it generally
[flightgear.git] / src / Time / tmp.cxx
index c8e47b4132c507f2bacf90595e4e94b0993bfea6..b77e53435cbde48ad95260672f937474b1380b42 100644 (file)
 #  include <config.h>
 #endif
 
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
 #include <simgear/magvar/magvar.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <FDM/flight.hxx>
+#include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
-#include <Main/options.hxx>
 
 #include "light.hxx"
 #include "moonpos.hxx"
 
 // periodic time updater wrapper
 void fgUpdateLocalTime() {
-    FGPath zone( current_options.get_fg_root() );
+    static const SGPropertyNode *longitude
+       = fgGetNode("/position/longitude-deg");
+    static const SGPropertyNode *latitude
+       = fgGetNode("/position/latitude-deg");
+
+    SGPath zone( globals->get_fg_root() );
     zone.append( "Timezone" );
 
-    globals->get_time_params()->updateLocal( cur_fdm_state->get_Longitude(),
-                                            cur_fdm_state->get_Latitude(),
+    SG_LOG(SG_GENERAL, SG_INFO, "updateLocal("
+          << longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
+          << ", "
+          << latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
+          << ", " << zone.str() << ")");
+    globals->get_time_params()->updateLocal( longitude->getDoubleValue()
+                                              * SGD_DEGREES_TO_RADIANS, 
+                                            latitude->getDoubleValue()
+                                              * SGD_DEGREES_TO_RADIANS,
                                             zone.str() );
 }
 
-
-// update sky and lighting parameters
-void fgUpdateSkyAndLightingParams() {
-    fgUpdateSunPos();
-    fgUpdateMoonPos();
-    cur_light_params.Update();
-}