From: Holger Schemel Date: Sat, 7 Nov 2015 12:57:26 +0000 (+0100) Subject: fixed broken border redraw of info screen after viewing title screen X-Git-Tag: 4.0.0.0-rc1~127 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9eacc6f4e47b05a7c4942f205faac1d62b0fc289;p=rocksndiamonds.git fixed broken border redraw of info screen after viewing title screen --- diff --git a/src/main.c b/src/main.c index 5de7b263..6f1559b5 100644 --- a/src/main.c +++ b/src/main.c @@ -31,6 +31,7 @@ DrawBuffer *fieldbuffer; DrawBuffer *drawto_field; int game_status = -1; +boolean game_status_last_screen = -1; boolean level_editor_test_game = FALSE; boolean network_playing = FALSE; diff --git a/src/main.h b/src/main.h index 10859071..da66e67c 100644 --- a/src/main.h +++ b/src/main.h @@ -886,7 +886,6 @@ #define BUTTON_ACTIVE(b) (ActiveButton[b]) #define FONT_ACTIVE(f) (ActiveFont[f]) - /* fundamental game speed values */ #define MICROLEVEL_SCROLL_DELAY 50 /* delay for scrolling micro level */ #define MICROLEVEL_LABEL_DELAY 250 /* delay for micro level label */ @@ -2889,6 +2888,7 @@ extern DrawBuffer *fieldbuffer; extern DrawBuffer *drawto_field; extern int game_status; +extern boolean game_status_last_screen; extern boolean level_editor_test_game; extern boolean network_playing; diff --git a/src/screens.c b/src/screens.c index 8ec78ee6..c51e140f 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1434,6 +1434,7 @@ void DrawMainMenu() if (CheckTitleScreen(levelset_has_changed)) { + game_status_last_screen = GAME_MODE_MAIN; game_status = GAME_MODE_TITLE; DrawTitleScreen(); @@ -1557,7 +1558,7 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) last_sound = SND_UNDEFINED; last_music = MUS_UNDEFINED; - if (game_status == GAME_MODE_INFO) + if (game_status_last_screen == GAME_MODE_INFO) { if (num_title_screens == 0) { @@ -1570,6 +1571,9 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) FadeSoundsAndMusic(); FadeOut(REDRAW_ALL); + + /* only required to update logic for redrawing global border */ + ClearField(); } if (tci->is_image) @@ -1619,11 +1623,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) } else if (button == MB_MENU_CHOICE) { - if (game_status == GAME_MODE_INFO && num_title_screens == 0) + if (game_status_last_screen == GAME_MODE_INFO && num_title_screens == 0) { FadeSetEnterScreen(); + game_status = GAME_MODE_INFO; info_mode = INFO_MODE_MAIN; + DrawInfoScreen(); return; @@ -1688,8 +1694,9 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) /* force full menu screen redraw after displaying title screens */ redraw_mask = REDRAW_ALL; - if (game_status == GAME_MODE_INFO) + if (game_status_last_screen == GAME_MODE_INFO) { + game_status = GAME_MODE_INFO; info_mode = INFO_MODE_MAIN; DrawInfoScreen(); @@ -2662,6 +2669,9 @@ void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos) void DrawInfoScreen_TitleScreen() { + game_status_last_screen = GAME_MODE_INFO; + game_status = GAME_MODE_TITLE; + DrawTitleScreen(); } diff --git a/src/tools.c b/src/tools.c index 84e79b3a..52a562fb 100644 --- a/src/tools.c +++ b/src/tools.c @@ -826,6 +826,10 @@ boolean CheckIfGlobalBorderRedrawIsNeeded() if (game_status == game_status_last) return FALSE; + // redraw if last screen was title screen + if (game_status_last == GAME_MODE_TITLE) + return TRUE; + // redraw if global screen border has changed if (CheckIfGlobalBorderHasChanged()) return TRUE;