changed drawing of global borders to more generic approach (again)
authorHolger Schemel <info@artsoft.org>
Tue, 22 Mar 2016 09:15:43 +0000 (10:15 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 22 Mar 2016 09:15:43 +0000 (10:15 +0100)
src/init.c
src/libgame/system.h
src/tools.c
src/tools.h

index 54bdb1e6b381d085818c513f01f39326270b0330..149b4ef2709e0ef6d6d26cf17cf798c897f85b88 100644 (file)
@@ -5323,7 +5323,9 @@ void InitGfx()
 
   InitGfxDrawBusyAnimFunction(DrawInitAnim);
   InitGfxDrawGlobalAnimFunction(DrawGlobalAnim);
-  InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToScreen);
+  InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToTarget);
+
+  gfx.masked_border_bitmap_ptr = backbuffer;
 
   /* use copy of busy animation to prevent change while reloading artwork */
   init_last = init;
index c48826373f810021bc18b9df6f663454a5035364..7e6bcc1f812150d0d2ea611f80951871f5be0b85 100644 (file)
@@ -819,6 +819,8 @@ struct GfxInfo
   Bitmap *fade_bitmap_target;
   Bitmap *fade_bitmap_black;
 
+  Bitmap *masked_border_bitmap_ptr;
+
 #if USE_FINAL_SCREEN_BITMAP
   Bitmap *final_screen_bitmap;
 #endif
index 053409c67ae6c09e139aa62d22617149e29cdc12..d72c99d09329fd1081e3ce962909089b4ca2fe85 100644 (file)
@@ -291,15 +291,16 @@ void RedrawPlayfield()
 static void DrawMaskedBorderExt_Rect(int x, int y, int width, int height,
                                     int draw_target)
 {
-  Bitmap *bitmap = getGlobalBorderBitmapFromStatus(global.border_status);
+  Bitmap *src_bitmap = getGlobalBorderBitmapFromStatus(global.border_status);
+  Bitmap *dst_bitmap = gfx.masked_border_bitmap_ptr;
 
   if (x == -1 && y == -1)
     return;
 
   if (draw_target == DRAW_BORDER_TO_SCREEN)
-    BlitToScreenMasked(bitmap, x, y, width, height, x, y);
+    BlitToScreenMasked(src_bitmap, x, y, width, height, x, y);
   else
-    BlitBitmapMasked(bitmap, backbuffer, x, y, width, height, x, y);
+    BlitBitmapMasked(src_bitmap, dst_bitmap, x, y, width, height, x, y);
 }
 
 static void DrawMaskedBorderExt_FIELD(int draw_target)
@@ -381,7 +382,7 @@ void DrawMaskedBorder(int redraw_mask)
   DrawMaskedBorderExt(redraw_mask, DRAW_BORDER_TO_BACKBUFFER);
 }
 
-void DrawMaskedBorderToScreen(int draw_target)
+void DrawMaskedBorderToTarget(int draw_target)
 {
   DrawMaskedBorderExt(REDRAW_ALL, draw_target);
 }
index d208383ac27f2ce9faee47e3248b68316d9f3f06..041a2d1d0a510d995a16544d2ed9abb503ea6bc7 100644 (file)
@@ -76,7 +76,7 @@ void DrawMaskedBorder_DOOR_2();
 void DrawMaskedBorder_DOOR_3();
 void DrawMaskedBorder_ALL();
 void DrawMaskedBorder(int);
-void DrawMaskedBorderToScreen(int);
+void DrawMaskedBorderToTarget(int);
 
 void SetDrawtoField(int);
 void RedrawPlayfield();