]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment_mgr.cxx
Harald JOHNSEN:
[flightgear.git] / src / Environment / environment_mgr.cxx
index 172c41f1c110e905baa6c236a3a6c0944921b33d..dc56ec0e82b77787ddd991d000340c3dabf9e579 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/scene/sky/sky.hxx>
+#include <simgear/environment/visual_enviro.hxx>
 
 #include <Main/main.hxx>
 #include <Main/fg_props.hxx>
 #include "environment.hxx"
 #include "environment_ctrl.hxx"
 #include "environment_mgr.hxx"
+#include "fgclouds.hxx"
+
+class SGSky;
+extern SGSky *thesky;
+
 
 
 FGEnvironmentMgr::FGEnvironmentMgr ()
@@ -43,12 +49,14 @@ FGEnvironmentMgr::FGEnvironmentMgr ()
 
   _controller->setEnvironment(_environment);
   set_subsystem("controller", _controller, 0.5);
+  fgClouds = new FGClouds;
 }
 
 FGEnvironmentMgr::~FGEnvironmentMgr ()
 {
   delete _environment;
   delete _controller;
+  delete fgClouds;
 }
 
 void
@@ -147,6 +155,33 @@ FGEnvironmentMgr::bind ()
          &FGEnvironmentMgr::set_cloud_layer_coverage);
     fgSetArchivable(buf);
   }
+  fgTie("/sim/rendering/clouds3d-enable", &sgEnviro,
+         &SGEnviro::get_clouds_enable_state,
+         &SGEnviro::set_clouds_enable_state);
+  fgTie("/sim/rendering/clouds3d-vis-range", &sgEnviro,
+         &SGEnviro::get_clouds_visibility,
+         &SGEnviro::set_clouds_visibility);
+  fgTie("/sim/rendering/clouds3d-density", &sgEnviro,
+         &SGEnviro::get_clouds_density,
+         &SGEnviro::set_clouds_density);
+  fgTie("/sim/rendering/clouds3d-cache-size", &sgEnviro,
+         &SGEnviro::get_clouds_CacheSize,
+         &SGEnviro::set_clouds_CacheSize);
+  fgTie("/sim/rendering/clouds3d-cache-resolution", &sgEnviro,
+         &SGEnviro::get_CacheResolution,
+         &SGEnviro::set_CacheResolution);
+  fgTie("/sim/rendering/precipitation-enable", &sgEnviro,
+         &SGEnviro::get_precipitation_enable_state,
+         &SGEnviro::set_precipitation_enable_state);
+  fgTie("/environment/rebuild_layers", fgClouds,
+      &FGClouds::get_update_event,
+      &FGClouds::set_update_event);
+  fgTie("/sim/rendering/lightning-enable", &sgEnviro,
+      &SGEnviro::get_lightning_enable_state,
+      &SGEnviro::set_lightning_enable_state);
+  fgTie("/environment/turbulence/use-cloud-turbulence", &sgEnviro,
+      &SGEnviro::get_turbulence_enable_state,
+      &SGEnviro::set_turbulence_enable_state);
 }
 
 void
@@ -176,6 +211,15 @@ FGEnvironmentMgr::unbind ()
     sprintf(buf, "/environment/clouds/layer[%d]/type", i);
     fgUntie(buf);
   }
+  fgUntie("/sim/rendering/clouds3d-enable");
+  fgUntie("/sim/rendering/clouds3d-vis-range");
+  fgUntie("/sim/rendering/clouds3d-density");
+  fgUntie("/sim/rendering/clouds3d-cache-size");
+  fgUntie("/sim/rendering/clouds3d-cache-resolution");
+  fgUntie("/sim/rendering/precipitation-enable");
+  fgUntie("/environment/rebuild_layers");
+  fgUntie("/sim/rendering/lightning-enable");
+  fgUntie("/environment/turbulence/use-cloud-turbulence");
 }
 
 void