From cc17cc4af754197c504f61abbbef1b4ec8c7263a Mon Sep 17 00:00:00 2001 From: timoore Date: Fri, 31 Oct 2008 09:46:23 +0000 Subject: [PATCH] Respect precipitation-enable property MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit From Csaba Halász --- simgear/environment/precipitation.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/simgear/environment/precipitation.cxx b/simgear/environment/precipitation.cxx index b5467a60..05b1b447 100644 --- a/simgear/environment/precipitation.cxx +++ b/simgear/environment/precipitation.cxx @@ -25,6 +25,7 @@ */ #include "precipitation.hxx" +#include "visual_enviro.hxx" #include @@ -146,7 +147,8 @@ bool SGPrecipitation::update(void) this->_snow_intensity = this->_rain_intensity; } - if (this->_snow_intensity > 0) { + bool enabled = sgEnviro.get_precipitation_enable_state(); + if (enabled && this->_snow_intensity > 0) { _precipitationEffect->setWind(_wind_vec); _precipitationEffect->setParticleSpeed( -0.75f - 0.25f*_snow_intensity); @@ -158,7 +160,7 @@ bool SGPrecipitation::update(void) _precipitationEffect->setFarTransition(100.0f - 60.0f*sqrtf(_snow_intensity)); _precipitationEffect->setParticleColor(osg::Vec4(0.85, 0.85, 0.85, 1.0) - osg::Vec4(0.1, 0.1, 0.1, 1.0) * _snow_intensity); - } else if (this->_rain_intensity > 0){ + } else if (enabled && this->_rain_intensity > 0) { _precipitationEffect->setWind(_wind_vec); _precipitationEffect->setParticleSpeed( -2.0f + -5.0f*_rain_intensity); -- 2.39.5