From fad8edb03b7e296b5f2df0cfb3a46cb014cf0c27 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 6 Apr 2018 00:45:20 +0200 Subject: [PATCH] added always redrawing global border when redrawing playfield area Before, the global border was only redrawn if its graphics had changed or if any of the viewport areas (playfield or doors) had changed their position or size. Now, it is always redrawn if the playfield area is cleared (to redraw its content). This has the advantage that accidentally damaged global border areas (caused by buggy graphics definitions from custom artwork sets) are redrawn much earlier than before (where it could require loading a different level set with different graphics to "repair" the damaged global border). --- src/tools.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools.c b/src/tools.c index 695a5362..96ce7f50 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1327,16 +1327,22 @@ void RedrawGlobalBorder() redraw_mask = REDRAW_ALL; } +#define ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED 0 + static void RedrawGlobalBorderIfNeeded() { +#if ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED if (game_status == game_status_last) return; +#endif // copy current draw buffer to later copy back areas that have not changed if (game_status_last != GAME_MODE_TITLE) BlitBitmap(backbuffer, bitmap_db_store_1, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); +#if ONLY_REDRAW_GLOBAL_BORDER_IF_NEEDED if (CheckIfGlobalBorderRedrawIsNeeded()) +#endif { // redraw global screen border (or clear, if defined to be empty) RedrawGlobalBorderFromBitmap(global_border_bitmap); -- 2.34.1