improved forced restart of global animations when restarting game
[rocksndiamonds.git] / src / anim.c
index 8b307ea4482f1c54d0a892ea4250b689cc04ec37..710383f3c608c03e4e3832fea3b13e6ab6cc3bbf 100644 (file)
@@ -857,6 +857,10 @@ static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage)
     }
   }
 
+  // when restarting global animations, do not redraw them, but stop here
+  if (drawing_stage == DRAW_GLOBAL_ANIM_STAGE_RESTART)
+    return;
+
   if (global.anim_status == GAME_MODE_LOADING)
     return;
 
@@ -2155,7 +2159,7 @@ void RestartGlobalAnimsByStatus(int status)
   global.anim_status = status;
 
   // force restarting global animations by changed global animation status
-  SDLRedrawWindow();
+  DrawGlobalAnimationsExt(DRAW_TO_SCREEN, DRAW_GLOBAL_ANIM_STAGE_RESTART);
 
   global.anim_status = anim_status_last;
 }