version number set to 4.2.0.0
[rocksndiamonds.git] / src / libgame / sdl.c
index 457f567ad59f461b3b90266785d9ec014bfa969d..d271951eb5dc84cdab120c47ce9d30510012f7c9 100644 (file)
@@ -1033,6 +1033,17 @@ void SDLFadeRectangle(int x, int y, int width, int height,
 
   time_current = SDL_GetTicks();
 
+  if (fade_delay <= 0)
+  {
+    // immediately draw final target frame without delay
+    fade_mode &= (FADE_MODE_FADE | FADE_MODE_TRANSFORM);
+    fade_delay = 1;
+    time_current -= 1;
+
+    // when fading without delay, also skip post delay
+    post_delay = 0;
+  }
+
   if (fade_mode == FADE_MODE_MELT)
   {
     boolean done = FALSE;
@@ -2529,7 +2540,7 @@ static void setJoystickButton(int nr, int button_id_raw, int button_state)
 
 void HandleJoystickEvent(Event *event)
 {
-  switch(event->type)
+  switch (event->type)
   {
     case SDL_CONTROLLERDEVICEADDED:
 #if DEBUG_JOYSTICKS