summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-06-18 16:48:58 +0000
committersmatz <smatz@openttd.org>2008-06-18 16:48:58 +0000
commit29985b768c5c9f5a92dc67e9b70626f3e6b9ff06 (patch)
tree74ebc46ae805dadccfc1057266b9f5f85873da3f /src/newgrf_industrytiles.cpp
parentcc2f9187cced720c32f5d0000407f912af042b0b (diff)
downloadopenttd-29985b768c5c9f5a92dc67e9b70626f3e6b9ff06.tar.xz
(svn r13565) -Change [FS#2077]: when invisibility is set, sprite sequences are now drawn until first non-opaque sprite is found (bit 14 not set)
This is to balance performance, code complexity and NewGRF requirements
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index cf77736e6..7f0aa2b8b 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -187,15 +187,15 @@ void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte r
if (GB(image, 0, SPRITE_WIDTH) != 0) DrawGroundSprite(image, pal);
- /* End now if industries are invisible */
- if (IsInvisibilitySet(TO_INDUSTRIES)) return;
-
foreach_draw_tile_seq(dtss, dts->seq) {
if (GB(dtss->image.sprite, 0, SPRITE_WIDTH) == 0) continue;
image = dtss->image.sprite;
pal = dtss->image.pal;
+ /* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
+ if (IsInvisibilitySet(TO_INDUSTRIES) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
+
if (IS_CUSTOM_SPRITE(image)) image += stage;
if (HasBit(image, PALETTE_MODIFIER_COLOR)) {