From: ehofman Date: Sat, 20 Sep 2003 11:05:12 +0000 (+0000) Subject: A small fix to have a smoot transition of cloud colors when in time warp mode X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e0dda6ad5283f1752556dd3838e1c65292eccab3;p=flightgear.git A small fix to have a smoot transition of cloud colors when in time warp mode --- diff --git a/src/Main/main.cxx b/src/Main/main.cxx index beab15df0..f2de09b4f 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1103,6 +1103,11 @@ static void fgMainLoop( void ) { cur_time_override->getLongValue(), globals->get_warp() ); + if (globals->get_warp_delta() != 0) { + FGLight *l = (FGLight *)(globals->get_subsystem("lighting")); + l->update( 0.5 ); + } + // update magvar model globals->get_mag()->update( longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS, diff --git a/src/Time/light.cxx b/src/Time/light.cxx index 7f5bf61d6..9bd861531 100644 --- a/src/Time/light.cxx +++ b/src/Time/light.cxx @@ -129,15 +129,15 @@ void FGLight::update( double dt ) { update_adj_fog_color(); _dt_total += dt; - if (_dt_total > 0.5) { + if (_dt_total >= 0.5) { _dt_total -= 0.5; fgUpdateSunPos(); fgUpdateMoonPos(); } if (_prev_sun_angle != _sun_angle) { + _prev_sun_angle = _sun_angle; update_sky_color(); - _prev_sun_angle = _sun_angle; } }