diff options
author | peter1138 <peter1138@openttd.org> | 2006-10-23 18:13:24 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-10-23 18:13:24 +0000 |
commit | 61611711e39630308b0742fb890a2fc240d6ddc7 (patch) | |
tree | 16abfe336e37ba9af9b92ca92f778be77e7c68a0 /gfx.c | |
parent | ba60e4ac3428f20f74e635ea9ac1f729e1aa16a9 (diff) | |
download | openttd-61611711e39630308b0742fb890a2fc240d6ddc7.tar.xz |
(svn r6908) - Codechange: Modify DrawStringMultiLine() to return the number of pixel lines used, and use it for drawing NewGRF additional text (mart3p)
Diffstat (limited to 'gfx.c')
-rw-r--r-- | gfx.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -500,11 +500,13 @@ void DrawStringMultiCenter(int x, int y, StringID str, int maxw) } } -void DrawStringMultiLine(int x, int y, StringID str, int maxw) + +uint DrawStringMultiLine(int x, int y, StringID str, int maxw) { char buffer[512]; uint32 tmp; int num, mt; + uint total_height; const char *src; byte c; @@ -514,6 +516,7 @@ void DrawStringMultiLine(int x, int y, StringID str, int maxw) num = GB(tmp, 0, 16); mt = GetCharacterHeight(GB(tmp, 16, 16)); + total_height = (num + 1) * mt; src = buffer; @@ -527,7 +530,7 @@ void DrawStringMultiLine(int x, int y, StringID str, int maxw) y += mt; if (--num < 0) { _cur_fontsize = FS_NORMAL; - return; + return total_height; } break; } else if (c == ASCII_SETX) { |