From: Holger Schemel Date: Sun, 28 Jan 2018 22:37:41 +0000 (+0100) Subject: fixed bug with not redrawing level and author name when changing levels X-Git-Tag: 4.0.1.1~8 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e17be9bfe390fb729e8f8ffca38bf0049004bb17;p=rocksndiamonds.git fixed bug with not redrawing level and author name when changing levels --- diff --git a/src/tools.c b/src/tools.c index 8eff2cd2..209c4e23 100644 --- a/src/tools.c +++ b/src/tools.c @@ -3046,9 +3046,8 @@ static int getMaxTextLength(struct TextPosInfo *pos, int font_nr) return max_text_width / font_width; } -static void DrawPreviewLevelLabel(int mode) +static void DrawPreviewLevelLabelExt(int mode, struct TextPosInfo *pos) { - struct TextPosInfo *pos = &menu.main.text.level_info_2; char label_text[MAX_OUTPUT_LINESIZE + 1]; int max_len_label_text; int font_nr = pos->font; @@ -3091,6 +3090,19 @@ static void DrawPreviewLevelLabel(int mode) redraw_mask |= REDRAW_FIELD; } +static void DrawPreviewLevelLabel(int mode) +{ + DrawPreviewLevelLabelExt(mode, &menu.main.text.level_info_2); +} + +static void DrawPreviewLevelInfo(int mode) +{ + if (mode == MICROLABEL_LEVEL_NAME) + DrawPreviewLevelLabelExt(mode, &menu.main.text.level_name); + else if (mode == MICROLABEL_LEVEL_AUTHOR) + DrawPreviewLevelLabelExt(mode, &menu.main.text.level_author); +} + static void DrawPreviewLevelExt(boolean restart) { static unsigned int scroll_delay = 0; @@ -3125,6 +3137,9 @@ static void DrawPreviewLevelExt(boolean restart) DrawPreviewLevelPlayfield(from_x, from_y); DrawPreviewLevelLabel(label_state); + DrawPreviewLevelInfo(MICROLABEL_LEVEL_NAME); + DrawPreviewLevelInfo(MICROLABEL_LEVEL_AUTHOR); + /* initialize delay counters */ DelayReached(&scroll_delay, 0); DelayReached(&label_delay, 0);