// (c) 1995-2014 by Artsoft Entertainment
// Holger Schemel
// info@artsoft.org
-// http://www.artsoft.org/
+// https://www.artsoft.org/
// ----------------------------------------------------------------------------
// text.c
// ============================================================================
void DrawInitText(char *text, int ypos, int font_nr)
{
- LimitScreenUpdates(TRUE);
-
- UPDATE_BUSY_STATE();
-
if (window != NULL &&
gfx.draw_init_text &&
gfx.num_fonts > 0 &&
}
}
+void DrawInitTextHead(char *text)
+{
+ // always draw headlines when loading initial stuff
+ LimitScreenUpdates(FALSE);
+
+ UPDATE_BUSY_STATE();
+
+ DrawInitText(text, 120, FC_GREEN);
+}
+
+void DrawInitTextItem(char *text)
+{
+ // limit drawing (potentially many) loading items
+ LimitScreenUpdates(TRUE);
+
+ UPDATE_BUSY_STATE();
+
+ DrawInitText(text, 150, FC_YELLOW);
+}
+
void DrawTextF(int x, int y, int font_nr, char *format, ...)
{
char buffer[MAX_OUTPUT_LINESIZE + 1];
va_end(ap);
if (strlen(buffer) > MAX_OUTPUT_LINESIZE)
- Error(ERR_EXIT, "string too long in DrawTextF() -- aborting");
+ Fail("string too long in DrawTextF() -- aborting");
DrawText(gfx.sx + x, gfx.sy + y, buffer, font_nr);
}
va_end(ap);
if (strlen(buffer) > MAX_OUTPUT_LINESIZE)
- Error(ERR_EXIT, "string too long in DrawTextFCentered() -- aborting");
+ Fail("string too long in DrawTextFCentered() -- aborting");
DrawText(gfx.sx + (gfx.sxsize - getTextWidth(buffer, font_nr)) / 2,
gfx.sy + y, buffer, font_nr);
int text_length = vsnprintf(text_buffer, MAX_OUTPUT_LINESIZE, format, ap);
if (text_length >= MAX_OUTPUT_LINESIZE)
- Error(ERR_WARN, "string too long in DrawTextBufferVA() -- truncated");
+ Warn("string too long in DrawTextBufferVA() -- truncated");
int num_lines_printed = DrawTextBuffer(x, y, text_buffer, font_nr,
line_length, cut_length, max_lines,