rnd-20061230-1-src
[rocksndiamonds.git] / src / libgame / x11.c
index 4626324fe82bb526c2507b04d2f2b19c9d1a08b5..2bbf76d558e01c1761c82734dd1acdb9ad3edef3 100644 (file)
@@ -1,7 +1,7 @@
 /***********************************************************
 * Artsoft Retro-Game Library                               *
 *----------------------------------------------------------*
-* (c) 1994-2002 Artsoft Entertainment                      *
+* (c) 1994-2006 Artsoft Entertainment                      *
 *               Holger Schemel                             *
 *               Detmolder Strasse 189                      *
 *               33604 Bielefeld                            *
@@ -363,15 +363,18 @@ void X11FillRectangle(Bitmap *bitmap, int x, int y,
 }
 
 void X11FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
-                     int fade_mode, int fade_delay, int post_delay)
+                     int fade_mode, int fade_delay, int post_delay,
+                     void (*draw_border_function)(void))
 {
-  /* fading currently not supported -- simply copy target image to screen */
+  /* fading currently not supported -- simply copy backbuffer to screen */
 
   if (fade_mode == FADE_MODE_FADE_OUT)
-    X11FillRectangle(window, x, y, width, height, BLACK_PIXEL);
-  else
-    X11CopyArea(bitmap_cross != NULL ? bitmap_cross : backbuffer, window,
-               x, y, width, height, 0, 0, BLIT_OPAQUE);
+    X11FillRectangle(backbuffer, x, y, width, height, BLACK_PIXEL);
+
+  if (draw_border_function != NULL)
+    draw_border_function();
+
+  X11CopyArea(backbuffer, window, x, y, width, height, 0, 0, BLIT_OPAQUE);
 
   /* as we currently cannot use the fade delay, also do not use post delay */
 }