From: Holger Schemel Date: Thu, 5 Apr 2018 22:45:20 +0000 (+0200) Subject: added always redrawing global border when redrawing playfield area X-Git-Tag: 4.1.0.0~3 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=fad8edb03b7e296b5f2df0cfb3a46cb014cf0c27;p=rocksndiamonds.git 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). --- 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);