summaryrefslogtreecommitdiff
path: root/gfx.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-07-19 22:12:04 +0000
committerDarkvater <darkvater@openttd.org>2005-07-19 22:12:04 +0000
commitf0c0c03c5f6eceafa0b10f40f413e893d02f34e8 (patch)
tree2510f3eedd1c2af25757fd24b0d1d4fd12437bc6 /gfx.c
parent7c694f25537097f380d7215082b42eea51e86815 (diff)
downloadopenttd-f0c0c03c5f6eceafa0b10f40f413e893d02f34e8.tar.xz
(svn r2644) - Fix: my name was mistyped ;p
- Add DoDrawStringCentered() and change the multiline strings in the about box to single-line ones
Diffstat (limited to 'gfx.c')
-rw-r--r--gfx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gfx.c b/gfx.c
index 232a8fb8e..8462b436c 100644
--- a/gfx.c
+++ b/gfx.c
@@ -365,6 +365,13 @@ int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 colo
return DoDrawString(buffer, (xl + xr - w) / 2, y, color);
}
+int DoDrawStringCentered(int x, int y, const char *str, uint16 color)
+{
+ int w = GetStringWidth(str);
+ DoDrawString(str, x - w / 2, y, color);
+ return w;
+}
+
void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color)
{
int w = DrawStringCentered(x, y, str, color);