diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 6a8982499..35394f0f5 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.7: +- Popup windows for "Really Exit?" and Game Pause are immune to fades + and crossfades (Bug #455) - Michael - No longer depend on SDLK_LAST statically; key input should now be safe if compiled with a different version of SDL than the one running the program (Bug #936, possibly also #883) - Michael diff --git a/sc2/src/sc2code/confirm.c b/sc2/src/sc2code/confirm.c index abdda7517..cb2c0c0ed 100644 --- a/sc2/src/sc2code/confirm.c +++ b/sc2/src/sc2code/confirm.c @@ -119,6 +119,8 @@ DoConfirmExit (void) s.origin = r.corner; F = CaptureDrawable (LoadDisplayPixmap (&r, (FRAME)0)); + SetSystemRect (&r); + DrawConfirmationWindow (response); // Releasing the lock lets the rotate_planet_task @@ -159,6 +161,7 @@ DoConfirmExit (void) s.frame = F; DrawStamp (&s); DestroyDrawable (ReleaseDrawable (s.frame)); + ClearSystemRect (); if (response) { result = TRUE; diff --git a/sc2/src/sc2code/libs/gfxlib.h b/sc2/src/sc2code/libs/gfxlib.h index 20947decc..2d13f4f6d 100644 --- a/sc2/src/sc2code/libs/gfxlib.h +++ b/sc2/src/sc2code/libs/gfxlib.h @@ -275,6 +275,8 @@ extern void FlushColorXForms (void); #define GetColorMapAddress GetStringAddress #define GetColorMapContents GetStringContents +void SetSystemRect (PRECT pRect); +void ClearSystemRect (void); #endif /* _GFX_PROTOS */ diff --git a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c index ef81daf21..b4ee9134b 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c +++ b/sc2/src/sc2code/libs/graphics/sdl/sdl_common.c @@ -214,6 +214,25 @@ TFB_ProcessEvents () #endif /* DEBUG */ } +static BOOLEAN system_box_active = 0; +static SDL_Rect system_box; + +void +SetSystemRect (PRECT r) +{ + system_box_active = TRUE; + system_box.x = r->corner.x; + system_box.y = r->corner.y; + system_box.w = r->extent.width; + system_box.h = r->extent.height; +} + +void +ClearSystemRect (void) +{ + system_box_active = FALSE; +} + void TFB_SwapBuffers (int force_full_redraw) { @@ -259,6 +278,11 @@ TFB_SwapBuffers (int force_full_redraw) } } + if (system_box_active) + { + graphics_backend->screen (TFB_SCREEN_MAIN, 255, &system_box); + } + graphics_backend->postprocess (); } diff --git a/sc2/src/sc2code/util.c b/sc2/src/sc2code/util.c index 6e508f75c..e689a51a9 100644 --- a/sc2/src/sc2code/util.c +++ b/sc2/src/sc2code/util.c @@ -178,6 +178,7 @@ PauseGame (void) s.origin = r.corner; s.frame = ActivityFrame; F = CaptureDrawable (LoadDisplayPixmap (&r, (FRAME)0)); + SetSystemRect (&r); DrawStamp (&s); // Releasing the lock lets the rotate_planet_task @@ -201,6 +202,7 @@ PauseGame (void) s.frame = F; DrawStamp (&s); DestroyDrawable (ReleaseDrawable (s.frame)); + ClearSystemRect (); SetContextClipRect (&OldRect); SetFrameHot (Screen, OldHot);