fixed forced screen redraw in every frame (again)
authorHolger Schemel <info@artsoft.org>
Sun, 20 Mar 2016 15:22:54 +0000 (16:22 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 20 Mar 2016 15:22:54 +0000 (16:22 +0100)
src/tools.c

index 3948bcb1745ff83ad312b2ae5562cbf94af2bffe..552eef2fbb5faa9234f13d0dda57b0cc117a22e5 100644 (file)
@@ -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