summaryrefslogtreecommitdiff
path: root/src/viewport.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-10-06 20:18:53 +0000
committerfrosch <frosch@openttd.org>2013-10-06 20:18:53 +0000
commit3d99546107b01a25d6aeba4e8910a07b884c536d (patch)
tree1a2ed8bde1f6fc88f0b1e7219612914142ba7861 /src/viewport.cpp
parentb4609fd923a610f12971f06e9e7be76ad0549e57 (diff)
downloadopenttd-3d99546107b01a25d6aeba4e8910a07b884c536d.tar.xz
(svn r25823) -Codechange [FS#5780]: Simplify if-cases in ViewportDrawStrings. (Juanjo)
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r--src/viewport.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index da0474093..d2556bd8c 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1423,17 +1423,14 @@ static void ViewportDrawStrings(ZoomLevel zoom, const StringSpriteToDrawVector *
/* Do not draw signs nor station names if they are set invisible */
if (IsInvisibilitySet(TO_SIGNS) && ss->string != STR_WHITE_SIGN) continue;
- /* if we didn't draw a rectangle, or if transperant building is on,
- * draw the text in the colour the rectangle would have */
if (IsTransparencySet(TO_SIGNS) && ss->string != STR_WHITE_SIGN) {
- /* Real colours need the TC_IS_PALETTE_COLOUR flag
- * otherwise colours from _string_colourmap are assumed. */
+ /* Don't draw the rectangle.
+ * Real colours need the TC_IS_PALETTE_COLOUR flag.
+ * Otherwise colours from _string_colourmap are assumed. */
colour = (TextColour)_colour_gradient[ss->colour][6] | TC_IS_PALETTE_COLOUR;
- }
-
- /* Draw the rectangle if 'transparent station signs' is off,
- * or if we are drawing a general text sign (STR_WHITE_SIGN) */
- if (!IsTransparencySet(TO_SIGNS) || ss->string == STR_WHITE_SIGN) {
+ } else {
+ /* Draw the rectangle if 'transparent station signs' is off,
+ * or if we are drawing a general text sign (STR_WHITE_SIGN). */
DrawFrameRect(
x, y, x + w, y + h, ss->colour,
IsTransparencySet(TO_SIGNS) ? FR_TRANSPARENT : FR_NONE