X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=5bd1569946b0db561d25fd28cd54818677bc4eb8;hb=ea925ed1065e3211c36c9bb2a56a5dbe760c208d;hp=2fa69f1151f8656702b3e6993645b243a81b095a;hpb=be789d9a341f5d7369f4aa2f74e2f85f3e004a4c;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 2fa69f11..5bd15699 100644 --- a/src/tools.c +++ b/src/tools.c @@ -628,6 +628,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 +657,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 +8199,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()