From: Holger Schemel Date: Tue, 22 Mar 2016 09:15:43 +0000 (+0100) Subject: changed drawing of global borders to more generic approach (again) X-Git-Tag: 4.0.0.0-rc1~34 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a56f43284d320b60cbeb1ebd097ec6d21d4f4ff1;p=rocksndiamonds.git changed drawing of global borders to more generic approach (again) --- diff --git a/src/init.c b/src/init.c index 54bdb1e6..149b4ef2 100644 --- a/src/init.c +++ b/src/init.c @@ -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; diff --git a/src/libgame/system.h b/src/libgame/system.h index c4882637..7e6bcc1f 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -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 diff --git a/src/tools.c b/src/tools.c index 053409c6..d72c99d0 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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); } diff --git a/src/tools.h b/src/tools.h index d208383a..041a2d1d 100644 --- a/src/tools.h +++ b/src/tools.h @@ -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();