X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=552eef2fbb5faa9234f13d0dda57b0cc117a22e5;hb=5ba8f1c1b0b33810e56f4a990ee6b813a51180d7;hp=cee9fae4b12280e7f050ae465b091e93e89550b0;hpb=ba9d6f7e29ac32c02daf3451316c6233a9bae1b5;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index cee9fae4..552eef2f 100644 --- a/src/tools.c +++ b/src/tools.c @@ -293,6 +293,9 @@ static void DrawMaskedBorderExt_Rect(int x, int y, int width, int height, { Bitmap *bitmap = getGlobalBorderBitmapFromGameStatus(); + if (x == -1 && y == -1) + return; + if (blit_to_screen) BlitToScreenMasked(bitmap, x, y, width, height, x, y); else @@ -503,8 +506,14 @@ static void PrintFrameTimeDebugging() void BackToFront() { + static int last_redraw_mask = REDRAW_NONE; + + // force screen redraw in every frame to continue drawing global animations + // (but always use the last redraw mask to prevent unwanted side effects) if (redraw_mask == REDRAW_NONE) - return; + redraw_mask = last_redraw_mask; + + last_redraw_mask = redraw_mask; #if 1 // masked border now drawn immediately when blitting backbuffer to window @@ -549,9 +558,6 @@ void BackToFront() redraw_mask = REDRAW_NONE; - // force screen redraw in every frame to continue drawing global animations - redraw_mask = REDRAW_ALL; - #if DEBUG_FRAME_TIME PrintFrameTimeDebugging(); #endif @@ -4228,7 +4234,7 @@ unsigned int MoveDoor(unsigned int door_state) { DX, DY, DXSIZE, DYSIZE }, { VX, VY, VXSIZE, VYSIZE } }; - static int door1 = DOOR_OPEN_1; + static int door1 = DOOR_CLOSE_1; static int door2 = DOOR_CLOSE_2; unsigned int door_delay = 0; unsigned int door_delay_value;