491 |
} |
} |
492 |
} |
} |
493 |
|
|
494 |
void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, |
void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y, |
495 |
int y, int boxx, int boxy, int boxcx, int boxcy, |
int clipx, int clipy, int clipcx, int clipcy, |
496 |
|
int boxx, int boxy, int boxcx, int boxcy, |
497 |
int bgcolour, int fgcolour, uint8 *text, uint8 length) |
int bgcolour, int fgcolour, uint8 *text, uint8 length) |
498 |
{ |
{ |
499 |
FONTGLYPH *glyph; |
FONTGLYPH *glyph; |
503 |
{ |
{ |
504 |
ui_rect(boxx, boxy, boxcx, boxcy, bgcolour); |
ui_rect(boxx, boxy, boxcx, boxcy, bgcolour); |
505 |
} |
} |
506 |
|
else if (mixmode == MIX_OPAQUE) |
507 |
|
{ |
508 |
|
ui_rect(clipx, clipy, clipcx, clipcy, bgcolour); |
509 |
|
} |
510 |
|
|
511 |
/* Paint text, character by character */ |
/* Paint text, character by character */ |
512 |
for (i = 0; i < length; i++) |
for (i = 0; i < length; i++) |
513 |
{ |
{ |
514 |
glyph = cache_get_font(font, text[i]); |
glyph = cache_get_font(font, text[i]); |
515 |
|
|
516 |
|
if (!(flags & TEXT2_IMPLICIT_X)) |
517 |
|
x += text[++i]; |
518 |
|
|
519 |
if (glyph != NULL) |
if (glyph != NULL) |
520 |
{ |
{ |
521 |
ui_draw_glyph(mixmode, x, |
ui_draw_glyph(mixmode, x + (short)glyph->offset, |
522 |
y + (short)glyph->baseline, |
y + (short)glyph->baseline, |
523 |
glyph->width, glyph->height, |
glyph->width, glyph->height, |
524 |
glyph->pixmap, 0, 0, |
glyph->pixmap, 0, 0, |
526 |
|
|
527 |
if (flags & TEXT2_IMPLICIT_X) |
if (flags & TEXT2_IMPLICIT_X) |
528 |
x += glyph->width; |
x += glyph->width; |
|
else |
|
|
x += text[++i]; |
|
529 |
} |
} |
530 |
} |
} |
531 |
} |
} |