From: Holger Schemel Date: Sat, 9 Sep 2023 14:37:26 +0000 (+0200) Subject: fixed bug with forced restart of global animations when restarting game X-Git-Tag: 4.3.7.0~21 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=0771dc28227f57049bd4ef0958c95fc024b34f00 fixed bug with forced restart of global animations when restarting game This fixes a bug which occured if the game was restarted (by loading a tape during the game, or by playing again after a game was lost) and if a custom artwork set was active that used cross-fading for the game screen. In this case, global animations displayed during the game were stopped, but not restarted again, --- diff --git a/src/anim.c b/src/anim.c index 710383f3..bd1847a9 100644 --- a/src/anim.c +++ b/src/anim.c @@ -2164,6 +2164,11 @@ void RestartGlobalAnimsByStatus(int status) global.anim_status = anim_status_last; } +void SetAnimStatusBeforeFading(int status) +{ + anim_status_last_before_fading = status; +} + boolean HandleGlobalAnimClicks(int mx, int my, int button, boolean force_click) { static boolean click_consumed = FALSE; diff --git a/src/anim.h b/src/anim.h index 0bde9a0b..992f5010 100644 --- a/src/anim.h +++ b/src/anim.h @@ -20,6 +20,7 @@ void InitGlobalAnimations(void); void DrawGlobalAnimations(int, int); void RestartGlobalAnimsByStatus(int); +void SetAnimStatusBeforeFading(int); boolean HandleGlobalAnimClicks(int, int, int, boolean); void HandleGlobalAnimEventByElementChange(int, int, int, int); diff --git a/src/game.c b/src/game.c index 8cb99586..a025b4b9 100644 --- a/src/game.c +++ b/src/game.c @@ -3629,6 +3629,10 @@ void InitGame(void) // force restarting global animations displayed during game play RestartGlobalAnimsByStatus(GAME_MODE_PSEUDO_RESTARTING); + // this is required for "transforming" fade modes like cross-fading + // (else global animations will be stopped, but not restarted here) + SetAnimStatusBeforeFading(GAME_MODE_PSEUDO_RESTARTING); + SetGameStatus(GAME_MODE_PLAYING); }