1
0
Fork 0

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
This commit is contained in:
ehofman 2005-05-22 08:08:22 +00:00
parent 56a9034d95
commit e59d38bf00
5 changed files with 23 additions and 9 deletions

View 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() );

View 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 ()

View 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();
}

View 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
#endif // _FGCLOUDS_HXX

View 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 ) {