summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-03-27 14:10:09 +0000
committerrubidium <rubidium@openttd.org>2008-03-27 14:10:09 +0000
commit3d03eab9bc2cde29b3d7f9281e03c6a248b35735 (patch)
tree008f7f842155136ab300ae27836f769b9e11b4ac
parent67c1e00aeaff43585014b432d1389388e572a9df (diff)
downloadopenttd-3d03eab9bc2cde29b3d7f9281e03c6a248b35735.tar.xz
(svn r12439) -Fix [FS#1871]: do not 'disable' the drawing of autorail overlays when the tile is 'error'-marked (red pulsating selection). Patch by Icosikai.
-rw-r--r--src/viewport.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index cc7b7a519..ad9141b89 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -941,10 +941,8 @@ static void DrawAutorailSelection(const TileInfo *ti, uint autorail_type)
static void DrawTileSelection(const TileInfo *ti)
{
/* Draw a red error square? */
- if (_thd.redsq != 0 && _thd.redsq == ti->tile) {
- DrawTileSelectionRect(ti, PALETTE_TILE_RED_PULSATING);
- return;
- }
+ bool is_redsq = _thd.redsq != 0 && _thd.redsq == ti->tile;
+ if (is_redsq) DrawTileSelectionRect(ti, PALETTE_TILE_RED_PULSATING);
/* no selection active? */
if (_thd.drawstyle == 0) return;
@@ -953,7 +951,7 @@ static void DrawTileSelection(const TileInfo *ti)
if (IsInsideBS(ti->x, _thd.pos.x, _thd.size.x) &&
IsInsideBS(ti->y, _thd.pos.y, _thd.size.y)) {
if (_thd.drawstyle & HT_RECT) {
- DrawTileSelectionRect(ti, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE);
+ if (!is_redsq) DrawTileSelectionRect(ti, _thd.make_square_red ? PALETTE_SEL_TILE_RED : PAL_NONE);
} else if (_thd.drawstyle & HT_POINT) {
/* Figure out the Z coordinate for the single dot. */
byte z = 0;
@@ -994,7 +992,7 @@ static void DrawTileSelection(const TileInfo *ti)
}
/* Check if it's inside the outer area? */
- if (_thd.outersize.x &&
+ if (!is_redsq && _thd.outersize.x &&
_thd.size.x < _thd.size.x + _thd.outersize.x &&
IsInsideBS(ti->x, _thd.pos.x + _thd.offs.x, _thd.size.x + _thd.outersize.x) &&
IsInsideBS(ti->y, _thd.pos.y + _thd.offs.y, _thd.size.y + _thd.outersize.y)) {