]> git.mxchange.org Git - flightgear.git/commitdiff
A small fix to have a smoot transition of cloud colors when in time warp mode
authorehofman <ehofman>
Sat, 20 Sep 2003 11:05:12 +0000 (11:05 +0000)
committerehofman <ehofman>
Sat, 20 Sep 2003 11:05:12 +0000 (11:05 +0000)
src/Main/main.cxx
src/Time/light.cxx

index beab15df0097ddf5a89b43213e21417324561318..f2de09b4fcf379ea6ac74b632fae84daf43c47fe 100644 (file)
@@ -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,
index 7f5bf61d6b48ae0f397e37cae64f93a689f80519..9bd861531cb9f01ef415e399c146bb284f36730c 100644 (file)
@@ -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;
     }
 }