int max_lines_drawable = (SYSIZE - ypos) / font_height - 1;
return DrawTextBuffer(SX + xpos, SY + ypos, text_buffer, font_nr,
- max_chars_per_line, -1, max_lines_drawable, 0, -1,
+ max_chars_per_line, -1, max_lines_drawable, -1, -1, -1, 0, -1,
TRUE, FALSE, FALSE);
}
num_lines_printed =
DrawTextBufferVA(sx, sy, format, ap, font_2,
- line_length, line_length, max_lines,
+ line_length, line_length, max_lines, -1, -1, -1,
0, BLIT_ON_BACKGROUND, TRUE, TRUE, FALSE);
sy += (num_lines_printed + 3) * font_height;
num_lines_printed =
DrawTextBuffer(sx, sy, program.log_filename, font_2,
- line_length, line_length, max_lines,
+ line_length, line_length, max_lines, -1, -1, -1,
0, BLIT_ON_BACKGROUND, TRUE, TRUE, FALSE);
DrawTextSCentered(SYSIZE - 20, font_3, "Press any key or button to exit");
// gadget text value
DrawTextArea(x + border_x, y + border_y, gi->textarea.value,
- font_nr, xsize, -1, ysize, 0,
+ font_nr, xsize, -1, ysize, -1, -1, -1, 0,
BLIT_ON_BACKGROUND, FALSE, FALSE, FALSE);
cursor_letter = gi->textarea.value[gi->textarea.cursor_position];
static int DrawTextBufferExt(int x, int y, char *text_buffer, int base_font_nr,
int line_length, int cut_length, int max_lines,
+ int line_width_unused, int cut_width_unused, int max_height_unused,
int line_spacing, int mask_mode, boolean autowrap,
boolean centered, boolean parse_comments,
boolean is_text_area)
int DrawTextArea(int x, int y, char *text_buffer, int font_nr,
int line_length, int cut_length, int max_lines,
+ int line_width, int cut_width, int max_height,
int line_spacing, int mask_mode, boolean autowrap,
boolean centered, boolean parse_comments)
{
return DrawTextBufferExt(x, y, text_buffer, font_nr,
line_length, cut_length, max_lines,
+ line_width, cut_width, max_height,
line_spacing, mask_mode, autowrap,
centered, parse_comments, TRUE);
}
int DrawTextBuffer(int x, int y, char *text_buffer, int font_nr,
int line_length, int cut_length, int max_lines,
+ int line_width, int cut_width, int max_height,
int line_spacing, int mask_mode, boolean autowrap,
boolean centered, boolean parse_comments)
{
return DrawTextBufferExt(x, y, text_buffer, font_nr,
line_length, cut_length, max_lines,
+ line_width, cut_width, max_height,
line_spacing, mask_mode, autowrap,
centered, parse_comments, FALSE);
}
int DrawTextBufferS(int x, int y, char *text_buffer, int font_nr,
int line_length, int cut_length, int max_lines,
+ int line_width, int cut_width, int max_height,
int line_spacing, int mask_mode, boolean autowrap,
boolean centered, boolean parse_comments)
{
return DrawTextBuffer(gfx.sx + x, gfx.sy + y, text_buffer, font_nr,
line_length, cut_length, max_lines,
+ line_width, cut_width, max_height,
line_spacing, mask_mode, autowrap,
centered, parse_comments);
}
int DrawTextBufferVA(int x, int y, char *format, va_list ap, int font_nr,
int line_length, int cut_length, int max_lines,
+ int line_width, int cut_width, int max_height,
int line_spacing, int mask_mode, boolean autowrap,
boolean centered, boolean parse_comments)
{
int num_lines_printed = DrawTextBuffer(x, y, text_buffer, font_nr,
line_length, cut_length, max_lines,
+ line_width, cut_width, max_height,
line_spacing, mask_mode, autowrap,
centered, parse_comments);
return num_lines_printed;
int DrawTextFile(int x, int y, char *filename, int font_nr,
int line_length, int cut_length, int max_lines,
+ int line_width, int cut_width, int max_height,
int line_spacing, int mask_mode, boolean autowrap,
boolean centered, boolean parse_comments)
{
char *text_buffer = GetTextBufferFromFile(filename, MAX_OUTPUT_LINESIZE);
int num_lines_printed = DrawTextBuffer(x, y, text_buffer, font_nr,
line_length, cut_length, max_lines,
+ line_width, cut_width, max_height,
line_spacing, mask_mode, autowrap,
centered, parse_comments);
checked_free(text_buffer);
void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
char *GetTextBufferFromFile(char *, int);
-int DrawTextArea(int, int, char *, int, int, int, int, int, int,
+int DrawTextArea(int, int, char *, int, int, int, int, int, int, int, int, int,
boolean, boolean, boolean);
-int DrawTextBuffer(int, int, char *, int, int, int, int, int, int,
+int DrawTextBuffer(int, int, char *, int, int, int, int, int, int, int, int, int,
boolean, boolean, boolean);
-int DrawTextBufferS(int, int, char *, int, int, int, int, int, int,
+int DrawTextBufferS(int, int, char *, int, int, int, int, int, int, int, int, int,
boolean, boolean, boolean);
-int DrawTextBufferVA(int, int, char *, va_list, int, int, int, int, int, int,
+int DrawTextBufferVA(int, int, char *, va_list, int, int, int, int, int, int, int, int, int,
boolean, boolean, boolean);
-int DrawTextFile(int, int, char *, int, int, int, int, int, int,
+int DrawTextFile(int, int, char *, int, int, int, int, int, int, int, int, int,
boolean, boolean, boolean);
#endif // TEXT_H
int num_lines_spacing = (font_nr == FC_YELLOW ? 1 : 3);
int num_lines_printed = DrawTextBuffer(xpos, ypos, message, font_nr,
max_chars_per_line, -1,
- max_lines_per_text, 0, -1,
+ max_lines_per_text, -1, -1, -1, 0, -1,
TRUE, TRUE, FALSE);
ypos += (num_lines_printed + num_lines_spacing) * font_height;
ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE);
DrawTextFile(ALIGNED_TEXT_XPOS(tmi), ALIGNED_TEXT_YPOS(tmi),
- filename, tmi->font, tmi->chars, -1, tmi->lines, 0, -1,
+ filename, tmi->font, tmi->chars, -1, tmi->lines, -1, -1, -1, 0, -1,
tmi->autowrap, tmi->centered, tmi->parse_comments);
ResetFontStatus();
// first get number of text lines to calculate offset for centering text
int num_lines_printed =
DrawTextBuffer(0, 0, text, font_nr,
- max_chars_per_line, -1, max_lines_per_text, line_spacing, -1,
+ max_chars_per_line, -1, max_lines_per_text, -1, -1, -1, line_spacing, -1,
autowrap, centered, parse_comments);
EnableDrawingText();
int yoffset = (row_height - size_lines_printed) / 2;
DrawTextBuffer(xstart, ystart + ypos * ystep + yoffset, text, font_nr,
- max_chars_per_line, -1, max_lines_per_text, line_spacing, -1,
+ max_chars_per_line, -1, max_lines_per_text, -1, -1, -1, line_spacing, -1,
autowrap, centered, parse_comments);
}
boolean parse_comments = TRUE;
DrawTextFile(xstart, ystart,
- filename, font_text, chars, -1, lines, line_spacing, -1,
+ filename, font_text, chars, -1, lines, -1, -1, -1, line_spacing, -1,
autowrap, centered, parse_comments);
}
else if (info_mode == INFO_MODE_LEVELSET ||
tmi->height = tmi->lines * getFontHeight(tmi->font);
DrawTextFile(mSX + ALIGNED_TEXT_XPOS(tmi), mSY + ALIGNED_TEXT_YPOS(tmi),
- filename, font, tmi->chars, -1, tmi->lines, 0, -1,
+ filename, font, tmi->chars, -1, tmi->lines, -1, -1, -1, 0, -1,
tmi->autowrap, tmi->centered, tmi->parse_comments);
}
DrawTextF(xstart1, ystart, font_head, "Level Set");
lines = DrawTextBufferS(xstart2, ystart, leveldir_current->name, font_text,
- max_chars_per_line, -1, max_lines_per_text, 0, -1,
+ max_chars_per_line, -1, max_lines_per_text, -1, -1, -1, 0, -1,
TRUE, FALSE, FALSE);
ystart += ystep_line + (lines > 0 ? lines - 1 : 0) * font_height;
DrawTextF(xstart1, ystart, font_head, "Level");
lines = DrawTextBufferS(xstart2, ystart, level.name, font_text,
- max_chars_per_line, -1, max_lines_per_text, 0, -1,
+ max_chars_per_line, -1, max_lines_per_text, -1, -1, -1, 0, -1,
TRUE, FALSE, FALSE);
ystart += ystep_para + (lines > 0 ? lines - 1 : 0) * font_height;
DrawTextF(xstart1, ystart, font_head, "Country");
lines = DrawTextBufferS(xstart2, ystart, entry->country_name, font_text,
- max_chars_per_line, -1, max_lines_per_text, 0, -1,
+ max_chars_per_line, -1, max_lines_per_text, -1, -1, -1, 0, -1,
TRUE, FALSE, FALSE);
ystart += ystep_line;
DrawTextArea(sx + font_width, sy + font_height,
level.envelope[envelope_nr].text, font_nr, max_xsize,
- xsize - 2, ysize - 2, 0, mask_mode,
+ xsize - 2, ysize - 2, -1, -1, -1, 0, mask_mode,
level.envelope[envelope_nr].autowrap,
level.envelope[envelope_nr].centered, FALSE);
}
DrawTextBuffer(sx + sx_offset, sy + sy_offset, text_final, font_nr,
- line_length, -1, max_lines, line_spacing, mask_mode,
+ line_length, -1, max_lines, -1, -1, -1, line_spacing, mask_mode,
request.autowrap, request.centered, FALSE);
if (text_door_style)