From: Holger Schemel Date: Sun, 20 Mar 2016 15:22:54 +0000 (+0100) Subject: fixed forced screen redraw in every frame (again) X-Git-Tag: 4.0.0.0-rc1~40 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=5ba8f1c1b0b33810e56f4a990ee6b813a51180d7;p=rocksndiamonds.git fixed forced screen redraw in every frame (again) --- diff --git a/src/tools.c b/src/tools.c index 3948bcb1..552eef2f 100644 --- a/src/tools.c +++ b/src/tools.c @@ -506,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 @@ -552,9 +558,6 @@ void BackToFront() redraw_mask = REDRAW_NONE; - // force screen redraw in every frame to continue drawing global animations - redraw_mask = REDRAW_FIELD; - #if DEBUG_FRAME_TIME PrintFrameTimeDebugging(); #endif