diff options
author | hackykid <hackykid@openttd.org> | 2005-06-14 10:59:05 +0000 |
---|---|---|
committer | hackykid <hackykid@openttd.org> | 2005-06-14 10:59:05 +0000 |
commit | 6533db736c7a898211e9955a214a651b43ef712c (patch) | |
tree | 4f8e6c8d621ea904fb32189b1ad812d960808f4d /viewport.c | |
parent | 89bd0b50b6cdac2436f47e7c3854e9291d5967d4 (diff) | |
download | openttd-6533db736c7a898211e9955a214a651b43ef712c.tar.xz |
(svn r2438) - Feature: New display option, 'transparent station signs', makes station signs transparent instead of using a solid bar to draw text on (peter1138)
Diffstat (limited to 'viewport.c')
-rw-r--r-- | viewport.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/viewport.c b/viewport.c index 1cd6a4f5c..b58d5da98 100644 --- a/viewport.c +++ b/viewport.c @@ -1155,13 +1155,16 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, StringSpriteToDraw *ss) w -= 3; } - DrawFrameRect(x,y, x+w, bottom, ss->color, (_display_opt & DO_TRANS_BUILDINGS) ? 0x9 : 0); + /* Draw the rectangle if 'tranparent station signs' is off, or if we are drawing a general text sign (STR_2806) */ + if(!(_display_opt & DO_TRANS_SIGNS) || ss->string == STR_2806) + DrawFrameRect(x,y, x+w, bottom, ss->color, (_display_opt & DO_TRANS_BUILDINGS) ? 0x9 : 0); } SetDParam(0, ss->params[0]); SetDParam(1, ss->params[1]); SetDParam(2, ss->params[2]); - if (_display_opt & DO_TRANS_BUILDINGS && ss->width != 0) { + /* if we didnt draw a rectangle, or if transparant building is on, draw the text in the color the rectangle would have */ + if (((_display_opt & DO_TRANS_BUILDINGS) || (_display_opt & DO_TRANS_SIGNS && ss->string != STR_2806)) && ss->width != 0) { /* Real colors need the IS_PALETTE_COLOR flag, otherwise colors from _string_colormap are assumed. */ DrawString(ss->x >> zoom, (ss->y >> zoom) - (ss->width&0x8000?2:0), ss->string, (_color_list[ss->color].window_color_bgb | IS_PALETTE_COLOR)); |