From c34763b0703c62b2e5d546e7122ab64cda2766b8 Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Tue, 30 Nov 2010 23:40:27 +0800 Subject: [PATCH] Turn fullscreen off when showing a messagebox for Mac; move songs_play_song(SONG_TITLE) from inferno.c to titles.c --- CHANGELOG.txt | 1 + arch/carbon/messagebox.c | 15 +++++++++++---- main/inferno.c | 1 - main/titles.c | 2 ++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fa35e8ffe..ffdc2f93e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D1X-Rebirth Changelog -------- include/hmp.h, misc/hmp.c: Little fixes for rev939 - changed definition from WIN32 to _WIN32, added little hack for incorrectly set HMP loop in Descent2-version of descent.hmp SConstruct, arch/include/messagebox.h, arch/win32/messagebox.c, main/inferno.c, misc/error.c: Add support for Windows native error/warning boxes; Only print to stdout on Linux/other *nix; Fixed redundant printing of Error and Warning via stdout +arch/carbon/messagebox.c, main/inferno.c, main/titles.c: Turn fullscreen off when showing a messagebox for Mac; move songs_play_song(SONG_TITLE) from inferno.c to titles.c 20101128 -------- diff --git a/arch/carbon/messagebox.c b/arch/carbon/messagebox.c index 394235363..1adee067d 100644 --- a/arch/carbon/messagebox.c +++ b/arch/carbon/messagebox.c @@ -18,17 +18,21 @@ void display_mac_alert(char *message, int error) { - int16_t itemHit; - uint response; - bool osX = FALSE; - d_event event = { EVENT_WINDOW_DEACTIVATED }; window *wind; + d_event event = { EVENT_WINDOW_DEACTIVATED }; + int fullscreen; + bool osX = FALSE; + uint response; + int16_t itemHit; // Handle Descent's windows properly if ((wind = window_get_front())) window_send_event(window_get_front(), &event); event.type = EVENT_WINDOW_ACTIVATED; + if ((fullscreen = gr_check_fullscreen())) + gr_toggle_fullscreen(); + osX = ( Gestalt(gestaltSystemVersion, (long *) &response) == noErr) && (response >= 0x01000 ); @@ -72,6 +76,9 @@ void display_mac_alert(char *message, int error) if (wind) window_send_event(window_get_front(), &event); + + if (!error && fullscreen) + gr_toggle_fullscreen(); } void msgbox_warning(char *message) diff --git a/main/inferno.c b/main/inferno.c index 48dde892b..55db60525 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -373,7 +373,6 @@ int main(int argc, char *argv[]) set_default_handler(standard_handler); - songs_play_song( SONG_TITLE, 1 ); show_titles(); set_screen_mode(SCREEN_MENU); diff --git a/main/titles.c b/main/titles.c index c1595de9a..a3c0a2da4 100644 --- a/main/titles.c +++ b/main/titles.c @@ -181,6 +181,8 @@ void show_titles(void) { char publisher[16]; + songs_play_song( SONG_TITLE, 1 ); + if (GameArg.SysNoTitles) return;