From: Holger Schemel Date: Mon, 14 Oct 2024 21:23:42 +0000 (+0200) Subject: added first and last visible line to wrapped text structure X-Git-Tag: 4.4.0.0-test-4~131 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=f954b602db07260bd38d957ea728d6ab70b3a518;p=rocksndiamonds.git added first and last visible line to wrapped text structure --- diff --git a/src/libgame/text.c b/src/libgame/text.c index 88a9c248..0f1c05f9 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -768,6 +768,8 @@ int DrawWrappedText(int x, int y, struct WrappedTextInfo *wrapped_text, int star if (start_pos >= wrapped_text->num_lines) return 0; + wrapped_text->line_visible_first = start_pos; + for (i = start_pos; i < wrapped_text->num_lines; i++) { int font_nr = wrapped_text->line[i].font_nr; @@ -786,6 +788,8 @@ int DrawWrappedText(int x, int y, struct WrappedTextInfo *wrapped_text, int star current_line++; } + wrapped_text->line_visible_last = start_pos + current_line - 1; + return current_line; } diff --git a/src/libgame/text.h b/src/libgame/text.h index 06b2a439..2beecb18 100644 --- a/src/libgame/text.h +++ b/src/libgame/text.h @@ -111,6 +111,8 @@ struct WrappedTextInfo // internal info for processing lines int line_width, cut_length, max_height; int line_spacing, mask_mode; + int line_visible_first; + int line_visible_last; };