added also fading in/out global animations to be started/stopped
[rocksndiamonds.git] / src / tools.c
index 9d7e5c7482906558affecfadbd1dce7d5e838f39..ac83cfd51c1e54d470f2745512ed5209ede7b620 100644 (file)
@@ -717,6 +717,14 @@ static void FadeExt(int fade_mask, int fade_mode, int fade_type)
 
 static void SetScreenStates_BeforeFadingIn()
 {
+  // temporarily set screen mode for animations to screen after fading in
+  global.anim_status = global.anim_status_next;
+
+  // store backbuffer with all animations that will be started after fading in
+  PrepareFadeBitmap(DRAW_TO_FADE_TARGET);
+
+  // set screen mode for animations back to fading
+  global.anim_status = GAME_MODE_PSEUDO_FADING;
 }
 
 static void SetScreenStates_AfterFadingIn()
@@ -736,7 +744,11 @@ static void SetScreenStates_BeforeFadingOut()
   // store new target screen (to use correct masked border for fading)
   gfx.fade_border_target_status = game_status;
 
+  // set screen mode for animations to fading
   global.anim_status = GAME_MODE_PSEUDO_FADING;
+
+  // store backbuffer with all animations that will be stopped for fading out
+  PrepareFadeBitmap(DRAW_TO_FADE_SOURCE);
 }
 
 static void SetScreenStates_AfterFadingOut()