summaryrefslogtreecommitdiff
path: root/src/gfx_func.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-25 20:01:34 +0000
committerrubidium <rubidium@openttd.org>2009-03-25 20:01:34 +0000
commite8d76e79ee8b58d9947c05eb9dcb53c3d0b4ec19 (patch)
tree18c01826c7b985207e18da3859c51953c551a3a8 /src/gfx_func.h
parent28d3123dfd7c8a981496e81fb1dc5996015563d9 (diff)
downloadopenttd-e8d76e79ee8b58d9947c05eb9dcb53c3d0b4ec19.tar.xz
(svn r15849) -Codechange: provide easy access to the real height of the used fonts
Diffstat (limited to 'src/gfx_func.h')
-rw-r--r--src/gfx_func.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gfx_func.h b/src/gfx_func.h
index 139056df3..ceecc45e8 100644
--- a/src/gfx_func.h
+++ b/src/gfx_func.h
@@ -158,14 +158,15 @@ byte GetCharacterWidth(FontSize size, uint32 key);
*/
static inline byte GetCharacterHeight(FontSize size)
{
- switch (size) {
- default: NOT_REACHED();
- case FS_NORMAL: return 10;
- case FS_SMALL: return 6;
- case FS_LARGE: return 18;
- }
+ assert(size < FS_END);
+ extern int _font_height[FS_END];
+ return _font_height[size];
}
+#define FONT_HEIGHT_SMALL (GetCharacterHeight(FS_SMALL))
+#define FONT_HEIGHT_NORMAL (GetCharacterHeight(FS_NORMAL))
+#define FONT_HEIGHT_LARGE (GetCharacterHeight(FS_LARGE))
+
extern DrawPixelInfo *_cur_dpi;
/**