From e0dda6ad5283f1752556dd3838e1c65292eccab3 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 20 Sep 2003 11:05:12 +0000 Subject: [PATCH] A small fix to have a smoot transition of cloud colors when in time warp mode --- src/Main/main.cxx | 5 +++++ src/Time/light.cxx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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; } } -- 2.39.5