summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-10-21 22:49:45 (GMT)
committer Simon <simon@hardwired.org.uk>2010-10-21 22:59:56 (GMT)
commitf88bb0f246c7c7130b44d8b4b1b63012fadef94e (patch)
treebb0eaface9db804cdaa31f366e5de497e4402807 /src/graphics.c
parentfdd3d240316086fdfd37840a828dc2111f5c70e2 (diff)
downloadpowder-f88bb0f246c7c7130b44d8b4b1b63012fadef94e.zip
powder-f88bb0f246c7c7130b44d8b4b1b63012fadef94e.tar.gz
Changes for open_ui
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/graphics.c b/src/graphics.c
index b63e384..d6604a3 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1002,6 +1002,19 @@ int textnwidth(char *s, int n)
}
return x-1;
}
+int textnheight(char *s, int n, int w)
+{
+ int x = 0;
+ //TODO: Implement Textnheight for wrapped text
+ for(; *s; s++)
+ {
+ if(!n)
+ break;
+ x += font_data[font_ptrs[(int)(*(unsigned char *)s)]];
+ n--;
+ }
+ return x-1;
+}
int textwidthx(char *s, int w)
{