From: Holger Schemel Date: Mon, 13 Apr 2020 15:57:30 +0000 (+0200) Subject: fixed drawing old screens for one video frame when skipping fading X-Git-Tag: 4.2.0.0~52 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=55db5f2faedebfbcd21d6c9516af42ecb7d8d805;p=rocksndiamonds.git fixed drawing old screens for one video frame when skipping fading This fixes a problem that was introduced with the last commit: When skipping fading effects (like when changing screens by pressing the "Escape" key), the special bitmaps used for fading screens are not updated to the current source or target screens, which can result in displaying old screens (displayed before pressing "Escape") for one video frame. (For example, this happened when pressing "Escape" on a sub-screen of the setup menu, then pressing "Escape" again on the setup main screen, which then resulted in displaying the setup sub-screen in the main menu for a single video frame, causing "garbage flickering".) (This change effectively reverts commit 5eabbc4d. Negative effects on cross-fading were not observed during tests, but may still exist.) --- diff --git a/src/tools.c b/src/tools.c index 52fbded0..b4a60378 100644 --- a/src/tools.c +++ b/src/tools.c @@ -993,8 +993,7 @@ static void SetScreenStates_BeforeFadingIn(void) global.anim_status = global.anim_status_next; // store backbuffer with all animations that will be started after fading in - if (fade_type_skip != FADE_MODE_SKIP_FADE_IN) - PrepareFadeBitmap(DRAW_TO_FADE_TARGET); + PrepareFadeBitmap(DRAW_TO_FADE_TARGET); // set screen mode for animations back to fading global.anim_status = GAME_MODE_PSEUDO_FADING; @@ -1017,8 +1016,7 @@ static void SetScreenStates_BeforeFadingOut(void) global.anim_status = GAME_MODE_PSEUDO_FADING; // store backbuffer with all animations that will be stopped for fading out - if (fade_type_skip != FADE_MODE_SKIP_FADE_OUT) - PrepareFadeBitmap(DRAW_TO_FADE_SOURCE); + PrepareFadeBitmap(DRAW_TO_FADE_SOURCE); } static void SetScreenStates_AfterFadingOut(void)