added drawing global borders when fading screens
[rocksndiamonds.git] / src / libgame / sdl.c
index 2fd019ce624e2070fa9e9f40641ad835d6505eb9..2e03378df85eb285caff378748294fed1ba59d41 100644 (file)
@@ -95,7 +95,7 @@ static void UpdateScreen(SDL_Rect *rect)
 
     // copy global masked border to render target buffer, if defined
     if (gfx.draw_global_border_function != NULL)
-      gfx.draw_global_border_function(REDRAW_ALL);
+      gfx.draw_global_border_function(DRAW_BORDER_TO_SCREEN);
 
     // copy global animations to render target buffer, if defined (above border)
     if (gfx.draw_global_anim_function != NULL)
@@ -140,7 +140,7 @@ static void UpdateScreen(SDL_Rect *rect)
 
   // copy global masked border to render target buffer, if defined
   if (gfx.draw_global_border_function != NULL)
-    gfx.draw_global_border_function(REDRAW_ALL);
+    gfx.draw_global_border_function(DRAW_BORDER_TO_SCREEN);
 
   // copy global animations to render target buffer, if defined (above border)
   if (gfx.draw_global_anim_function != NULL)
@@ -1148,16 +1148,23 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
   {
     SDL_BlitSurface(surface_cross,  &src_rect, surface_source, &src_rect);
     SDL_BlitSurface(surface_screen, &dst_rect, surface_target, &src_rect);
+
+    draw_global_border_function(DRAW_BORDER_TO_FADE_SOURCE);
+    draw_global_border_function(DRAW_BORDER_TO_FADE_TARGET);
   }
   else if (fade_mode & FADE_TYPE_FADE_IN)
   {
     SDL_BlitSurface(surface_black,  &src_rect, surface_source, &src_rect);
     SDL_BlitSurface(surface_screen, &dst_rect, surface_target, &src_rect);
+
+    draw_global_border_function(DRAW_BORDER_TO_FADE_TARGET);
   }
   else         /* FADE_TYPE_FADE_OUT */
   {
     SDL_BlitSurface(surface_screen, &dst_rect, surface_source, &src_rect);
     SDL_BlitSurface(surface_black,  &src_rect, surface_target, &src_rect);
+
+    draw_global_border_function(DRAW_BORDER_TO_FADE_SOURCE);
   }
 
   time_current = SDL_GetTicks();