diff options
author | smatz <smatz@openttd.org> | 2008-04-03 19:55:40 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-04-03 19:55:40 +0000 |
commit | fcf4a7067d529d2f43d26be48cdc7daf395eddb1 (patch) | |
tree | 6e5ae7f6b1b5f40dbc7a0e75f50db327a96a8b37 /src/viewport.cpp | |
parent | b8e3bbe0396072f0574b3b335386762146fbff93 (diff) | |
download | openttd-fcf4a7067d529d2f43d26be48cdc7daf395eddb1.tar.xz |
(svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 934cd18c9..8f7a1df2d 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1230,8 +1230,8 @@ static void ViewportAddSigns(DrawPixelInfo *dpi) const Sign *si; int left, top, right, bottom; - if (!HasBit(_display_opt, DO_SHOW_SIGNS)) - return; + /* Signs are turned off or are invisible */ + if (!HasBit(_display_opt, DO_SHOW_SIGNS) || IsInvisibilitySet(TO_SIGNS)) return; left = dpi->left; top = dpi->top; @@ -1495,6 +1495,12 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, const StringSpriteToDraw *ss uint16 colour; if (ss->width != 0) { + /* Do not draw signs nor station names if they are set invisible */ + if (IsInvisibilitySet(TO_SIGNS) && ss->string != STR_2806) { + ss = ss->next; + continue; + } + int x = UnScaleByZoom(ss->x, zoom) - 1; int y = UnScaleByZoom(ss->y, zoom) - 1; int bottom = y + 11; @@ -1958,7 +1964,8 @@ static bool CheckClickOnSign(const ViewPort *vp, int x, int y) { const Sign *si; - if (!HasBit(_display_opt, DO_SHOW_SIGNS) || _current_player == PLAYER_SPECTATOR) return false; + /* Signs are turned off, or they are transparent and invisibility is ON, or player is a spectator */ + if (!HasBit(_display_opt, DO_SHOW_SIGNS) || IsInvisibilitySet(TO_SIGNS) || _current_player == PLAYER_SPECTATOR) return false; switch (vp->zoom) { case ZOOM_LVL_NORMAL: |