about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-18 01:49:47 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-18 01:49:47 +0000
commit3fb0a02954fd427f760afe29ef71591dba542454 (patch)
tree2fdf45d83ca16dca0a372b5b149cbbe79719decf /src/engine/client
parent4ad19387e4d91af5d85953bcc45096f2618f6887 (diff)
downloadzcatch-3fb0a02954fd427f760afe29ef71591dba542454.tar.gz
zcatch-3fb0a02954fd427f760afe29ef71591dba542454.zip
fixed chat rendering
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/ec_gfx.c5
1 files changed, 4 insertions, 1 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)