]> git.mxchange.org Git - flightgear.git/commitdiff
Remove unused class SGEnviro
authorTorsten Dreyer <Torsten@t3r.de>
Fri, 6 May 2011 12:12:17 +0000 (14:12 +0200)
committerTorsten Dreyer <Torsten@t3r.de>
Fri, 6 May 2011 12:12:17 +0000 (14:12 +0200)
This class and their source files visual_enviro.[h|c]xx were
unused since OSG transition. It's only functionality was to
keep a variable for the enable-state of rendering of precipitation.
This has now been moved to SGPrecipitation.
This patch also removes all references to this class and
visual_enviro.hxx. Wxradar needs a new implementation for cloud
echoes which probably should be part of fgclouds.

See also SimGear commit 4e6159aa07f2817c09fad72db64d713e47f6f3da

src/Environment/environment_mgr.cxx
src/Environment/fgclouds.cxx
src/Environment/fgclouds.hxx
src/Environment/precipitation_mgr.cxx
src/Environment/precipitation_mgr.hxx
src/Instrumentation/wxradar.cxx
src/Instrumentation/wxradar.hxx
src/Main/renderer.cxx

index c6451eef1690f14b0727d6568273d9c7d6cb1fc9..e4803902987ffbe03b3f819cd0bbf7e2048ed714 100644 (file)
@@ -27,7 +27,6 @@
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/scene/sky/sky.hxx>
-#include <simgear/environment/visual_enviro.hxx>
 #include <simgear/scene/model/particles.hxx>
 
 #include <Main/main.hxx>
@@ -122,9 +121,9 @@ FGEnvironmentMgr::bind ()
           &FGClouds::get_update_event,
           &FGClouds::set_update_event);
 
-  _tiedProperties.Tie("turbulence/use-cloud-turbulence", &sgEnviro,
-          &SGEnviro::get_turbulence_enable_state,
-          &SGEnviro::set_turbulence_enable_state);
+//  _tiedProperties.Tie("turbulence/use-cloud-turbulence", &sgEnviro,
+//          &SGEnviro::get_turbulence_enable_state,
+//          &SGEnviro::set_turbulence_enable_state);
 
   for (int i = 0; i < MAX_CLOUD_LAYERS; i++) {
       SGPropertyNode_ptr layerNode = fgGetNode("/environment/clouds",true)->getChild("layer", i, true );
@@ -176,15 +175,10 @@ FGEnvironmentMgr::bind ()
           &SGSky::get_3dCloudVisRange,
           &SGSky::set_3dCloudVisRange);
 
-  _tiedProperties.Tie("precipitation-enable", &sgEnviro,
-          &SGEnviro::get_precipitation_enable_state,
-          &SGEnviro::set_precipitation_enable_state);
+//  _tiedProperties.Tie("lightning-enable", &sgEnviro,
+//          &SGEnviro::get_lightning_enable_state,
+//          &SGEnviro::set_lightning_enable_state);
 
-  _tiedProperties.Tie("lightning-enable", &sgEnviro,
-          &SGEnviro::get_lightning_enable_state,
-          &SGEnviro::set_lightning_enable_state);
-
-  sgEnviro.config(fgGetNode("/sim/rendering/precipitation"));
 }
 
 void
index c57c4ee1d55b2409a1803b05f13a111426696773..d5d9fbbc0302951e69d7149ddd68ca4b6c9e4946 100644 (file)
@@ -30,7 +30,7 @@
 #include <simgear/constants.h>
 #include <simgear/sound/soundmgr_openal.hxx>
 #include <simgear/scene/sky/sky.hxx>
-#include <simgear/environment/visual_enviro.hxx>
+//#include <simgear/environment/visual_enviro.hxx>
 #include <simgear/scene/sky/cloudfield.hxx>
 #include <simgear/scene/sky/newcloud.hxx>
 #include <simgear/structure/commands.hxx>
@@ -47,7 +47,9 @@ extern SGSky *thesky;
 
 
 FGClouds::FGClouds() :
+#if 0
     snd_lightning(0),
+#endif
     clouds_3d_enabled(false),
     index(0)
 {
@@ -68,6 +70,7 @@ void FGClouds::set_update_event(int count) {
 }
 
 void FGClouds::Init(void) {
+#if 0
        if( snd_lightning == NULL ) {
                snd_lightning = new SGSoundSample("Sounds/thunder.wav", SGPath());
                snd_lightning->set_max_dist(7000.0f);
@@ -75,8 +78,8 @@ void FGClouds::Init(void) {
                SGSoundMgr *smgr = globals->get_soundmgr();
                SGSampleGroup *sgr = smgr->find("weather", true);
                sgr->add( snd_lightning, "thunder" );
-               sgEnviro.set_sampleGroup( sgr );
        }
+#endif
 
        globals->get_commands()->addCommand("add-cloud", do_add_3Dcloud);
        globals->get_commands()->addCommand("del-cloud", do_delete_3Dcloud);
index 9d26419ffe627f036c86d5969ecdaf45b6eba0f9..61ccaccfef6e8774bccd33703cc16dd9475be807 100644 (file)
@@ -45,7 +45,9 @@ private:
        void buildCloudLayers(void);
 
        int update_event;
+#if 0
        SGSoundSample *snd_lightning;
+#endif
        bool clouds_3d_enabled;
   int index;
 
index 727087f835b62e274ebb85fe6b02dd199017c91d..1f3140547432715c514ff94dc63afddd3492011c 100644 (file)
@@ -36,7 +36,6 @@
 #include <simgear/math/SGMath.hxx>
 #include <simgear/scene/sky/sky.hxx>
 #include <simgear/scene/sky/cloud.hxx>
-#include <simgear/environment/visual_enviro.hxx>
 
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
@@ -93,6 +92,19 @@ void FGPrecipitationMgr::init()
     fgGetNode("environment/params/precipitation-level-ft", true);
 }
 
+void FGPrecipitationMgr::bind ()
+{
+  _tiedProperties.setRoot( fgGetNode("/sim/rendering", true ) );
+  _tiedProperties.Tie("precipitation-enable", precipitation.get(),
+          &SGPrecipitation::getEnabled,
+          &SGPrecipitation::setEnabled);
+}
+
+void FGPrecipitationMgr::unbind ()
+{
+  _tiedProperties.Untie();
+}
+
 void FGPrecipitationMgr::setPrecipitationLevel(double a)
 {
     fgSetDouble("environment/params/precipitation-level-ft",a);
@@ -206,7 +218,7 @@ void FGPrecipitationMgr::update(double dt)
     setPrecipitationLevel(altitudeCloudLayer);
 
        // Does the user enable the precipitation ?
-       if (!sgEnviro.get_precipitation_enable_state()) {
+       if (!precipitation->getEnabled() ) {
                // Disable precipitations
            precipitation->setRainIntensity(0);
            precipitation->setSnowIntensity(0);
index 69a0ecfaa223d237379229cdf79b13473c6dfabe..449f7f47c332a60bdc6c6a63e75d854c8550da08 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/environment/precipitation.hxx>
-
+#include <simgear/props/tiedpropertylist.hxx>
 
 class FGPrecipitationMgr : public SGSubsystem
 {
@@ -40,12 +40,15 @@ private:
     osg::ref_ptr<osg::MatrixTransform> transform;
     osg::ref_ptr<SGPrecipitation> precipitation;
     float getPrecipitationAtAltitudeMax(void);
+    simgear::TiedPropertyList _tiedProperties;
 
 public:
     FGPrecipitationMgr();
     virtual ~FGPrecipitationMgr();
 
     // SGSubsystem methods
+    virtual void bind ();
+    virtual void unbind ();
     virtual void init ();
     virtual void update (double dt);
     
index d88d0cde98b77b13a349a0ed90d6dabd178c5dc6..84d9f84fe4ec7adaac3308ad185cc50c3ffcee53 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <simgear/constants.h>
 #include <simgear/misc/sg_path.hxx>
-#include <simgear/environment/visual_enviro.hxx>
 #include <simgear/scene/model/model.hxx>
 #include <simgear/structure/exception.hxx>
 #include <simgear/misc/sg_path.hxx>
@@ -137,7 +136,7 @@ wxRadarBg::init ()
     SGPath tpath = globals->resolve_aircraft_path(path);
 
     // no mipmap or else alpha will mix with pixels on the border of shapes, ruining the effect
-    _wxEcho = SGLoadTexture2D(tpath, false, false);
+    _wxEcho = SGLoadTexture2D(tpath, NULL, false, false);
 
 
     _Instrument->setFloatValue("trk", 0.0);
@@ -472,13 +471,16 @@ void
 wxRadarBg::update_weather()
 {
     string modeButton = _Instrument->getStringValue("mode", "WX");
-    _radarEchoBuffer = *sgEnviro.get_radar_echo();
+// FIXME: implementation of radar echoes missing
+//    _radarEchoBuffer = *sgEnviro.get_radar_echo();
 
     // pretend we have a scan angle bigger then the FOV
     // TODO:check real fov, enlarge if < nn, and do clipping if > mm
 //    const float fovFactor = 1.45f;
     _Instrument->setStringValue("status", modeButton.c_str());
 
+// FIXME: implementation of radar echoes missing
+#if 0
     list_of_SGWxRadarEcho *radarEcho = &_radarEchoBuffer;
     list_of_SGWxRadarEcho::iterator iradarEcho, end = radarEcho->end();
     const float LWClevel[] = { 0.1f, 0.5f, 2.1f };
@@ -558,6 +560,7 @@ wxRadarBg::update_weather()
             addQuad(_vertices, _texCoords, m, texBase);
         }
     }
+#endif
 }
 
 
index f962045e14e1a996f342ae957db9290121df1e3f..2b696430a7f8baf65d5f59ec8d8df3c5f3585dd1 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
-#include <simgear/environment/visual_enviro.hxx>
 
 #include <vector>
 #include <string>
@@ -148,7 +147,8 @@ private:
     float _font_size;
     float _font_spacing;
 
-    list_of_SGWxRadarEcho _radarEchoBuffer;
+// FIXME: implementation of radar echoes missing
+//    list_of_SGWxRadarEcho _radarEchoBuffer;
 
     void update_weather();
     void update_aircraft();
index c88003f1eba6286dfd608ab34f455e377369dcbe..fe713ab623984fb917862e9263b7683e85f7d8dd 100644 (file)
@@ -82,8 +82,6 @@
 #include <simgear/screen/jpgfactory.hxx>
 #endif
 
-#include <simgear/environment/visual_enviro.hxx>
-
 #include <Time/light.hxx>
 #include <Time/light.hxx>
 #include <Cockpit/panel.hxx>