mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-01-06 00:43:35 +01:00
a086510885
This parameter controls the maximum number of glyphs to print. For backwards compatibility, it is automatically inserted by a macro in older calls with only 7 parameters.
25 lines
664 B
C
25 lines
664 B
C
#include <gint/gray.h>
|
|
#include "../render/render.h"
|
|
#include "../render-fx/topti-asm.h"
|
|
|
|
/* gtext_opt(): Display a string of text */
|
|
void gtext_opt(int x, int y, int fg, int bg, int halign, int valign,
|
|
char const *str, int size)
|
|
{
|
|
uint32_t *light, *dark;
|
|
dgray_getvram(&light, &dark);
|
|
|
|
if(halign != DTEXT_LEFT || valign != DTEXT_TOP)
|
|
{
|
|
int w, h;
|
|
dsize(str, topti_font, &w, &h);
|
|
|
|
if(halign == DTEXT_RIGHT) x -= w;
|
|
if(halign == DTEXT_CENTER) x -= ((w+1) >> 1);
|
|
if(valign == DTEXT_BOTTOM) y -= h;
|
|
if(valign == DTEXT_MIDDLE) y -= ((h+1) >> 1);
|
|
}
|
|
|
|
topti_render(x, y, str, topti_font, topti_asm_text[fg],
|
|
topti_asm_text[bg], light, dark, size);
|
|
}
|