summaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-09-13 21:39:01 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-09-13 21:39:01 (GMT)
commit5b52ac3675f08f9f16f44f530df8877ad6c64f2e (patch)
treed1b087ac413010f4248ddb4f6cb07a9f3f7ebbe3 /src/graphics
parenta11cd592cb9b985298dd16be78dec10226bf3e47 (diff)
downloadpowder-5b52ac3675f08f9f16f44f530df8877ad6c64f2e.zip
powder-5b52ac3675f08f9f16f44f530df8877ad6c64f2e.tar.gz
Save history and new multiline formatter
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/Graphics.cpp5
-rw-r--r--src/graphics/Graphics.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp
index fef4b45..dde2701 100644
--- a/src/graphics/Graphics.cpp
+++ b/src/graphics/Graphics.cpp
@@ -489,6 +489,11 @@ int Graphics::textwidth(const char *s)
return x-1;
}
+int Graphics::CharWidth(char c)
+{
+ return font_data[font_ptrs[(int)c]];
+}
+
int Graphics::textnwidth(char *s, int n)
{
int x = 0;
diff --git a/src/graphics/Graphics.h b/src/graphics/Graphics.h
index a51ed02..0bb6cb6 100644
--- a/src/graphics/Graphics.h
+++ b/src/graphics/Graphics.h
@@ -129,6 +129,7 @@ public:
//Font/text metrics
static int CharIndexAtPosition(char *s, int positionX, int positionY);
static int PositionAtCharIndex(char *s, int charIndex, int & positionX, int & positionY);
+ static int CharWidth(char c);
static int textnwidth(char *s, int n);
static void textnpos(char *s, int n, int w, int *cx, int *cy);
static int textwidthx(char *s, int w);