X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Ftext.c;h=f0cdb01adaecedd75fb3325b440ba40dd840b1dd;hb=56814df201c2d86273cf54e0e94c0448ce9bdd0f;hp=d5d67cda8bbc95cb76af0256851912018ca2456a;hpb=c6b89ec21b03182c40ae2eda40d861c09f179daf;p=rocksndiamonds.git diff --git a/src/libgame/text.c b/src/libgame/text.c index d5d67cda..f0cdb01a 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -192,9 +192,18 @@ 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.draw_init_text && gfx.num_fonts > 0 && gfx.font_bitmap_info[font_nr].bitmap != NULL) { @@ -211,6 +220,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];