X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Ftext.c;h=f5e9c0666d504c6b5917b5f96c303626506caf4b;hp=d5d67cda8bbc95cb76af0256851912018ca2456a;hb=ddd58a300bd5996f69a8ec41d1fd140fe7a46f18;hpb=6b9be0de63f8e031e8400b829fd2dc9b125bb0b4 diff --git a/src/libgame/text.c b/src/libgame/text.c index d5d67cda..f5e9c066 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -192,8 +192,16 @@ void getFontCharSource(int font_nr, char c, Bitmap **bitmap, int *x, int *y) /* simple text drawing functions */ /* ========================================================================= */ -void DrawInitText(char *text, int ypos, int font_nr) +void DrawInitTextExt(char *text, int ypos, int font_nr, boolean force) { + static unsigned long progress_delay = 0; + unsigned long progress_delay_value = 100; /* (in milliseconds) */ + + UPDATE_BUSY_STATE(); + + if (!force && !DelayReached(&progress_delay, progress_delay_value)) + return; + if (window != NULL && gfx.num_fonts > 0 && gfx.font_bitmap_info[font_nr].bitmap != NULL) @@ -211,6 +219,16 @@ void DrawInitText(char *text, int ypos, int font_nr) } } +void DrawInitText(char *text, int ypos, int font_nr) +{ + DrawInitTextExt(text, ypos, font_nr, TRUE); +} + +void DrawInitTextIfNeeded(char *text, int ypos, int font_nr) +{ + DrawInitTextExt(text, ypos, font_nr, FALSE); +} + void DrawTextF(int x, int y, int font_nr, char *format, ...) { char buffer[MAX_OUTPUT_LINESIZE + 1];