#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>
&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 );
&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
#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>
FGClouds::FGClouds() :
+#if 0
snd_lightning(0),
+#endif
clouds_3d_enabled(false),
index(0)
{
}
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);
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);
void buildCloudLayers(void);
int update_event;
+#if 0
SGSoundSample *snd_lightning;
+#endif
bool clouds_3d_enabled;
int index;
#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>
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);
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);
#include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/environment/precipitation.hxx>
-
+#include <simgear/props/tiedpropertylist.hxx>
class FGPrecipitationMgr : public SGSubsystem
{
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);
#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>
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);
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 };
addQuad(_vertices, _texCoords, m, texBase);
}
}
+#endif
}
#include <simgear/props/props.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
-#include <simgear/environment/visual_enviro.hxx>
#include <vector>
#include <string>
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();
#include <simgear/screen/jpgfactory.hxx>
#endif
-#include <simgear/environment/visual_enviro.hxx>
-
#include <Time/light.hxx>
#include <Time/light.hxx>
#include <Cockpit/panel.hxx>