summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-22 09:43:00 +0000
committerrubidium <rubidium@openttd.org>2009-03-22 09:43:00 +0000
commit4eaf4e6182a50b86570266c76f45a464a7e6cdd6 (patch)
tree981e816b735dc5dcd71c5f79ca8e806d772095eb /src
parente74dc1e1d6dc57b2d6b79ef921888c0204855139 (diff)
downloadopenttd-4eaf4e6182a50b86570266c76f45a464a7e6cdd6.tar.xz
(svn r15804) -Fix (r15796): viewport strings weren't properly 'rendered'.
-Codechange: use the new string drawing API for the viewport.
Diffstat (limited to 'src')
-rw-r--r--src/viewport.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 60cecb03c..666708b71 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1457,8 +1457,13 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, const StringSpriteToDrawVect
} else {
colour = TC_BLACK;
}
+
+ /* The maximum width of the string */
+ int w = GB(ss->width, 0, 15);
+ if (w == 0) w = UINT16_MAX;
+
DrawString(
- UnScaleByZoom(ss->x, zoom), UnScaleByZoom(ss->y, zoom) - (ss->width & 0x8000 ? 2 : 0),
+ UnScaleByZoom(ss->x, zoom), UnScaleByZoom(ss->x, zoom) + w, UnScaleByZoom(ss->y, zoom) - (ss->width & 0x8000 ? 2 : 0),
ss->string, colour
);
}