added initial window size to default program config (using <program>.conf)
[rocksndiamonds.git] / src / tools.c
index 2fa69f1151f8656702b3e6993645b243a81b095a..a2184cc19036eebf9f5fd9ad8fb78c51e998a327 100644 (file)
@@ -509,6 +509,9 @@ void BackToFront()
   }
 
   redraw_mask = REDRAW_NONE;
+
+  // force screen redraw in every frame to continue drawing global animations
+  redraw_mask = REDRAW_ALL;
 }
 
 static void FadeCrossSaveBackbuffer()
@@ -628,6 +631,20 @@ static void FadeExt(int fade_mask, int fade_mode, int fade_type)
   redraw_mask &= ~fade_mask;
 }
 
+static void SetAnimStatus_BeforeFadingOut()
+{
+  global.anim_status = GAME_MODE_PSEUDO_FADING;
+}
+
+static void SetAnimStatus_AfterFadingIn()
+{
+  global.anim_status = global.anim_status_next;
+
+  // force update of global animation status in case of rapid screen changes
+  redraw_mask = REDRAW_ALL;
+  BackToFront();
+}
+
 void FadeIn(int fade_mask)
 {
 #if 1
@@ -643,10 +660,14 @@ void FadeIn(int fade_mask)
   FADE_SY = REAL_SY;
   FADE_SXSIZE = FULL_SXSIZE;
   FADE_SYSIZE = FULL_SYSIZE;
+
+  SetAnimStatus_AfterFadingIn();
 }
 
 void FadeOut(int fade_mask)
 {
+  SetAnimStatus_BeforeFadingOut();
+
 #if 0
   DrawMaskedBorder(REDRAW_ALL);
 #endif
@@ -8181,6 +8202,8 @@ void JoinRectangles(int *x, int *y, int *width, int *height,
 void SetGameStatus(int game_status_new)
 {
   game_status = game_status_new;
+
+  global.anim_status_next = game_status;
 }
 
 void ChangeViewportPropertiesIfNeeded()