]> git.mxchange.org Git - flightgear.git/commitdiff
Harald JOHSNEN:
authorehofman <ehofman>
Sun, 22 May 2005 08:08:22 +0000 (08:08 +0000)
committerehofman <ehofman>
Sun, 22 May 2005 08:08:22 +0000 (08:08 +0000)
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

src/Environment/environment_ctrl.cxx
src/Environment/environment_mgr.cxx
src/Environment/fgclouds.cxx
src/Environment/fgclouds.hxx
src/Main/renderer.cxx

index 9872c6d0c5f16d157c894961e26c27264eb7cddc..db86125899cf699aebe0de949659dca76b53d483 100644 (file)
@@ -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() );
index cab4ec5c5f5da940ce5b01c5c2e990affd441004..46070066cae7387c28864cda2c135b0341bab51e 100644 (file)
@@ -49,7 +49,7 @@ FGEnvironmentMgr::FGEnvironmentMgr ()
 
   _controller->setEnvironment(_environment);
   set_subsystem("controller", _controller, 0.5);
-  fgClouds = new FGClouds;
+  fgClouds = new FGClouds( _controller );
 }
 
 FGEnvironmentMgr::~FGEnvironmentMgr ()
index 022a1a4bc8da4cdae30fac5f704937819704d9b6..b61a5510147dcb78993ce8cbb42861d4738dbd4b 100644 (file)
@@ -33,6 +33,7 @@
 #include <Airports/simple.hxx>
 #include <Main/util.hxx>
 
+#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();
        }
index dee821c1dea47ef911524c44760541bbe243c732..2dff644271c0cca62269b6d3fc4158a6dc9a54dc 100644 (file)
@@ -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
index afc92a537d90e462cfe26b71ef980e1c52327513..5712986078ec1b0d9e425c1ac699d9621a949939 100644 (file)
@@ -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 ) {