From c07edd0d1039f45e515417a9d80c411935fca41f Mon Sep 17 00:00:00 2001 From: anyc Date: Mon, 26 May 2014 11:46:38 +0200 Subject: [PATCH 1/2] fix warning --- src/window_options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window_options.c b/src/window_options.c index fbb9897940..62939efcef 100644 --- a/src/window_options.c +++ b/src/window_options.c @@ -309,7 +309,7 @@ static void window_options_mousedown() // populate the list with the sound devices for (i = 0; i < gAudioDeviceCount; i++) { gDropdownItemsFormat[i] = 1142; - gDropdownItemsArgs[i] = 1170 | ((uint64)gAudioDevices[i].name << 16); + gDropdownItemsArgs[i] = 1170 | ((uint64)(intptr_t)gAudioDevices[i].name << 16); } gDropdownItemsChecked |= (1 << RCT2_GLOBAL(0x9AF280, uint32)); break; From fafc8083acda0040114c8d99e1078a57429efa24 Mon Sep 17 00:00:00 2001 From: anyc Date: Mon, 26 May 2014 22:22:05 +0200 Subject: [PATCH 2/2] don't show confirmation prompt for loading on title screen, fixes #145 --- src/window.h | 2 +- src/window_save_prompt.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/window.h b/src/window.h index be464a82b3..b46ff6fe59 100644 --- a/src/window.h +++ b/src/window.h @@ -286,7 +286,7 @@ enum { } WINDOW_CLASS; enum PROMPT_MODE { - PM_SAVE_BEFORE_LOAD, + PM_SAVE_BEFORE_LOAD = 0, PM_SAVE_BEFORE_QUIT, PM_SAVE_BEFORE_QUIT2, PM_QUIT diff --git a/src/window_save_prompt.c b/src/window_save_prompt.c index e4893c6414..a941875889 100644 --- a/src/window_save_prompt.c +++ b/src/window_save_prompt.c @@ -117,6 +117,12 @@ void window_save_prompt_open() prompt_mode = RCT2_GLOBAL(RCT2_ADDRESS_SAVE_PROMPT_MODE, uint16); + // do not show save prompt if we're in the title demo and click on load game + if (prompt_mode != PM_QUIT && RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TITLE_DEMO) { + game_load_or_quit_no_save_prompt(); + return; + } + // Check if window is already open window = window_bring_to_front_by_id(WC_SAVE_PROMPT, 0); if (window == NULL) { @@ -146,14 +152,13 @@ void window_save_prompt_open() y, (uint32*)window_save_prompt_events, WC_SAVE_PROMPT, - 0 + WF_TRANSPARENT | WF_STICK_TO_FRONT ); window->widgets = widgets; window->enabled_widgets = enabled_widgets; window_init_scroll_widgets(window); window->colours[0] = 154; - window->flags |= WF_TRANSPARENT; // Pause the game RCT2_GLOBAL(0x009DEA6E, uint8) |= 2; @@ -170,6 +175,12 @@ void window_save_prompt_open() window_save_prompt_widgets[WIDX_LABEL].image = prompt_mode + STR_SAVE_BEFORE_LOADING; if (!gGeneral_config.confirmation_prompt) { + /* game_load_or_quit_no_save_prompt() will exec requested task and close this window + * immediately again. + * TODO restructure these functions when we're sure game_load_or_quit_no_save_prompt() + * and game_load_or_quit() are not called by the original binary anymore. + */ + if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0D) { game_load_or_quit_no_save_prompt(); return;