From: ehofman Date: Sun, 22 May 2005 08:08:22 +0000 (+0000) Subject: Harald JOHSNEN: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e59d38bf00cf598309695f764580c8dfe552eee2;p=flightgear.git Harald JOHSNEN: Changes ======= - correct the transparency probleme when old 3d clouds were enabled (rendering context with an alpha channel) - changed rain cone orientation, it can now be viewed from helicopter or chase view (still not tower view) - clouds are a bit more yellow/red at dawn/dusk - weather data is now correctly propagated to the interpolator, this correct visibility, wind, etc - the 'metar' weather scenario now immedialty reuse the real metar data - real metar no more overwrite custom weather scenario --- diff --git a/src/Environment/environment_ctrl.cxx b/src/Environment/environment_ctrl.cxx index 9872c6d0c..db8612589 100644 --- a/src/Environment/environment_ctrl.cxx +++ b/src/Environment/environment_ctrl.cxx @@ -494,7 +494,6 @@ FGMetarEnvironmentCtrl::update(double delta_time_sec) result_queue.pop(); if ( result.m != NULL ) { update_metar_properties( result.m ); - fgSetString("/environment/metar/last-metar", result.m->getData()); delete result.m; update_env_config(); env->reinit(); @@ -579,6 +578,11 @@ FGMetarEnvironmentCtrl::update_metar_properties( FGMetar *m ) double d; char s[128]; + fgSetString("/environment/metar/real-metar", m->getData()); + // don't update with real weather when we use a custom weather scenario + if( strcmp(fgGetString("/environment/weather-scenario", "METAR"), "METAR") ) + return; + fgSetString("/environment/metar/last-metar", m->getData()); fgSetString("/environment/metar/station-id", m->getId()); fgSetDouble("/environment/metar/min-visibility-m", m->getMinVisibility().getVisibility_m() ); diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index cab4ec5c5..46070066c 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -49,7 +49,7 @@ FGEnvironmentMgr::FGEnvironmentMgr () _controller->setEnvironment(_environment); set_subsystem("controller", _controller, 0.5); - fgClouds = new FGClouds; + fgClouds = new FGClouds( _controller ); } FGEnvironmentMgr::~FGEnvironmentMgr () diff --git a/src/Environment/fgclouds.cxx b/src/Environment/fgclouds.cxx index 022a1a4bc..b61a55101 100644 --- a/src/Environment/fgclouds.cxx +++ b/src/Environment/fgclouds.cxx @@ -33,6 +33,7 @@ #include #include
+#include "environment_ctrl.hxx" #include "environment_mgr.hxx" #include "fgmetar.hxx" #include "fgclouds.hxx" @@ -40,8 +41,9 @@ extern SGSky *thesky; -FGClouds::FGClouds() : +FGClouds::FGClouds(FGEnvironmentCtrl * controller) : station_elevation_ft(0.0), + _controller( controller ), snd_lightning(NULL) { update_event = 0; @@ -413,6 +415,9 @@ void FGClouds::buildScenario( string scenario ) { FGMetar *m = new FGMetar( station + fakeMetar ); update_metar_properties( m ); update_env_config(); + // propagate aloft tables + _controller->reinit(); + fgSetString("/environment/metar/last-metar", m->getData()); // TODO:desactivate real metar updates if( scenario == "Fair weather" ) { @@ -425,11 +430,14 @@ void FGClouds::build(void) { string scenario = fgGetString("/environment/weather-scenario", "METAR"); if( scenario == "METAR" ) { - string realMetar = fgGetString("/environment/metar/last-metar", ""); + string realMetar = fgGetString("/environment/metar/real-metar", ""); if( realMetar != "" ) { + fgSetString("/environment/metar/last-metar", realMetar.c_str()); FGMetar *m = new FGMetar( realMetar ); update_metar_properties( m ); update_env_config(); + // propagate aloft tables + _controller->reinit(); } buildMETAR(); } diff --git a/src/Environment/fgclouds.hxx b/src/Environment/fgclouds.hxx index dee821c1d..2dff64427 100644 --- a/src/Environment/fgclouds.hxx +++ b/src/Environment/fgclouds.hxx @@ -37,6 +37,7 @@ SG_USING_STD(string); class SGNewCloud; class SGCloudField; class FGMetar; +class FGEnvironmentCtrl; class FGClouds { @@ -56,11 +57,11 @@ private: int update_event; SGSoundSample *snd_lightning; - + FGEnvironmentCtrl * _controller; float station_elevation_ft; public: - FGClouds(); + FGClouds(FGEnvironmentCtrl * controller); ~FGClouds(); void build(void); @@ -72,4 +73,4 @@ public: }; -#endif // _FGCLOUDS_HXX \ No newline at end of file +#endif // _FGCLOUDS_HXX diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index afc92a537..571298607 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -731,8 +731,9 @@ FGRenderer::update( bool refresh_camera_settings ) { fgGetDouble("/environment/metar/rain-norm", 0.0), fgGetDouble("/environment/metar/snow-norm", 0.0), fgGetDouble("/environment/metar/hail-norm", 0.0), - fgGetDouble("/orientation/pitch-deg", 0.0), - fgGetDouble("/orientation/roll-deg", 0.0), + current__view->getPitch_deg() - current__view->getPitchOffset_deg(), + current__view->getRoll_deg() + current__view->getRollOffset_deg(), + - current__view->getHeadingOffset_deg(), fgGetDouble("/velocities/airspeed-kt", 0.0)); if ( draw_otw ) {