]> git.mxchange.org Git - flightgear.git/blobdiff - src/Environment/environment_mgr.cxx
Don't restore initial screen geometry because there is nothing in fg_os* to resize...
[flightgear.git] / src / Environment / environment_mgr.cxx
index f63beedb4c9144a8aa86aeab0e018ab468822ac0..c0d7ae5f902b435ee23514a65a06a83fea6ec68b 100644 (file)
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #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 <Main/renderer.hxx>
 #include <Aircraft/aircraft.hxx>
 
 #include "environment.hxx"
 #include "environment_ctrl.hxx"
 #include "environment_mgr.hxx"
+#include "fgclouds.hxx"
+
+class SGSky;
+extern SGSky *thesky;
+
 
 
 FGEnvironmentMgr::FGEnvironmentMgr ()
@@ -45,12 +53,15 @@ FGEnvironmentMgr::FGEnvironmentMgr ()
 
   _controller->setEnvironment(_environment);
   set_subsystem("controller", _controller, 0.5);
+  fgClouds = new FGClouds( _controller );
 }
 
 FGEnvironmentMgr::~FGEnvironmentMgr ()
 {
   delete _environment;
+  remove_subsystem("controller");
   delete _controller;
+  delete fgClouds;
 }
 
 void
@@ -81,6 +92,8 @@ FGEnvironmentMgr::bind ()
   fgSetArchivable("/environment/temperature-sea-level-degc");
   fgTie("/environment/temperature-degc", _environment,
        &FGEnvironment::get_temperature_degc); // FIXME: read-only for now
+  fgTie("/environment/temperature-degf", _environment,
+       &FGEnvironment::get_temperature_degf); // FIXME: read-only for now
   fgTie("/environment/dewpoint-sea-level-degc", _environment,
        &FGEnvironment::get_dewpoint_sea_level_degc,
        &FGEnvironment::set_dewpoint_sea_level_degc);
@@ -161,9 +174,22 @@ FGEnvironmentMgr::bind ()
   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);
+  sgEnviro.config(fgGetNode("/sim/rendering/precipitation"));
 }
 
 void
@@ -193,6 +219,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