]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment_mgr.cxx
NasalCanvas: Clean up and expose Element node ghost
[flightgear.git] / src / Environment / environment_mgr.cxx
index a1e22555d6fc72fa00899e6aab19a9f9f7f1ebc9..e7688d793b993b38b6d0c5efd51929561b0ad8f0 100644 (file)
@@ -132,23 +132,26 @@ FGEnvironmentMgr::~FGEnvironmentMgr ()
   delete _3dCloudsEnableListener;
 }
 
-void
-FGEnvironmentMgr::init ()
+SGSubsystem::InitStatus FGEnvironmentMgr::incrementalInit()
 {
-  SG_LOG( SG_ENVIRONMENT, SG_INFO, "Initializing environment subsystem");
-  SGSubsystemGroup::init();
-  fgClouds->Init();
-
-  // FIXME: is this really part of the environment_mgr?
-  // Initialize the longitude, latitude and altitude to the initial position
-  // of the aircraft so that the atmospheric properties (pressure, temperature
-  // and density) can be initialized accordingly.
-  _altitude_n->setDoubleValue(fgGetDouble("/sim/presets/altitude-ft"));
-  _longitude_n->setDoubleValue(fgGetDouble("/sim/presets/longitude-deg"));
-  _latitude_n->setDoubleValue(fgGetDouble("/sim/presets/latitude-deg"));
   
-  globals->get_event_mgr()->addTask("updateClosestAirport", this,
-                                    &FGEnvironmentMgr::updateClosestAirport, 30 );
+  InitStatus r = SGSubsystemGroup::incrementalInit();
+  if (r == INIT_DONE) {
+    fgClouds->Init();
+    
+    // FIXME: is this really part of the environment_mgr?
+    // Initialize the longitude, latitude and altitude to the initial position
+    // of the aircraft so that the atmospheric properties (pressure, temperature
+    // and density) can be initialized accordingly.
+    _altitude_n->setDoubleValue(fgGetDouble("/sim/presets/altitude-ft"));
+    _longitude_n->setDoubleValue(fgGetDouble("/sim/presets/longitude-deg"));
+    _latitude_n->setDoubleValue(fgGetDouble("/sim/presets/latitude-deg"));
+    
+    globals->get_event_mgr()->addTask("updateClosestAirport", this,
+                                      &FGEnvironmentMgr::updateClosestAirport, 30 );
+  }
+  
+  return r;
 }
 
 void