From: Holger Schemel Date: Sun, 17 Nov 2024 23:08:47 +0000 (+0100) Subject: moved code to separate function X-Git-Tag: 4.4.0.0-test-4~50 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c7b786cfed072fffbf69bd7ffb7849e8a3b86d04;p=rocksndiamonds.git moved code to separate function --- diff --git a/src/screens.c b/src/screens.c index 944c7880..c3629605 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1892,11 +1892,9 @@ static void drawChooseTreeEdit(int ypos_raw, boolean active) DrawText(sx, sy, STR_CHOOSE_TREE_EDIT, font_nr); } -static void DrawInfoScreen_Headline(int screen_nr, int num_screens, - int use_global_screens) +static char *getInfoScreenSubtitle(int screen_nr, int num_screens, int use_global_screens) { - char *info_text_title_1 = getInfoScreenTitle_Generic(); - char info_text_title_2[MAX_LINE_LEN + 1]; + static char info_text_title_2[MAX_LINE_LEN + 1]; boolean draw_story_headline = (info_mode == INFO_MODE_STORY && hasLevelStory()); if (num_screens > 1) @@ -1925,6 +1923,15 @@ static void DrawInfoScreen_Headline(int screen_nr, int num_screens, snprintf(info_text_title_2, max_text_len, text_format, name_cut); } + return info_text_title_2; +} + +static void DrawInfoScreen_Headline(int screen_nr, int num_screens, int use_global_screens) +{ + char *info_text_title_1 = getInfoScreenTitle_Generic(); + char *info_text_title_2 = getInfoScreenSubtitle(screen_nr, num_screens, use_global_screens); + boolean draw_story_headline = (info_mode == INFO_MODE_STORY && hasLevelStory()); + if (draw_story_headline) { DrawTextSCentered(MENU_TITLE_STORY_YPOS, FONT_TITLE_STORY, info_text_title_2);