diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-18 01:49:47 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-18 01:49:47 +0000 |
| commit | 3fb0a02954fd427f760afe29ef71591dba542454 (patch) | |
| tree | 2fdf45d83ca16dca0a372b5b149cbbe79719decf /src/engine | |
| parent | 4ad19387e4d91af5d85953bcc45096f2618f6887 (diff) | |
| download | zcatch-3fb0a02954fd427f760afe29ef71591dba542454.tar.gz zcatch-3fb0a02954fd427f760afe29ef71591dba542454.zip | |
fixed chat rendering
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/client/ec_gfx.c | 5 | ||||
| -rw-r--r-- | src/engine/e_if_gfx.h | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/client/ec_gfx.c b/src/engine/client/ec_gfx.c index d7a0733a..c1bf4112 100644 --- a/src/engine/client/ec_gfx.c +++ b/src/engine/client/ec_gfx.c @@ -1017,8 +1017,9 @@ float gfx_text_raw(void *font_set_v, float x, float y, float size, const char *t return draw_x; } -void gfx_text(void *font_set_v, float x, float y, float size, const char *text, int max_width) +int gfx_text(void *font_set_v, float x, float y, float size, const char *text, int max_width) { + int lines = 1; if(max_width == -1) gfx_text_raw(font_set_v, x, y, size, text, -1); else @@ -1030,6 +1031,7 @@ void gfx_text(void *font_set_v, float x, float y, float size, const char *text, float w = gfx_text_width(font_set_v, size, text, wlen); if(x+w-startx > max_width) { + lines++; y += size; x = startx; } @@ -1040,6 +1042,7 @@ void gfx_text(void *font_set_v, float x, float y, float size, const char *text, } } gfx_text_raw(font_set_v, x, y, size, text, -1); + return lines; } float gfx_text_width(void *font_set_v, float size, const char *text, int length) diff --git a/src/engine/e_if_gfx.h b/src/engine/e_if_gfx.h index d49a3cda..71a9628e 100644 --- a/src/engine/e_if_gfx.h +++ b/src/engine/e_if_gfx.h @@ -243,11 +243,11 @@ void gfx_lines_end(); arg1 - desc Returns: - + returns the number of lines written See Also: <other_func> */ -void gfx_text(void *font, float x, float y, float size, const char *text, int max_width); +int gfx_text(void *font, float x, float y, float size, const char *text, int max_width); /* Function: gfx_text_width |