summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-08-06 11:14:07 +0000
committerfrosch <frosch@openttd.org>2011-08-06 11:14:07 +0000
commit0625c9007f520cd9bdcd7f11377416bcae930a4c (patch)
treeb9ccad7b0b21d70ac6bf03ea6ee602f214a8021f
parent2e466cc184230cf9bce32391b63e5f26670625f0 (diff)
downloadopenttd-0625c9007f520cd9bdcd7f11377416bcae930a4c.tar.xz
(svn r22722) -Fix: Skip invisible parent and child sprites due to transparency settings using the same logic as skipping due to grf-defined invisibility.
-rw-r--r--src/sprite.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/sprite.cpp b/src/sprite.cpp
index ee051dc7e..a991d315f 100644
--- a/src/sprite.cpp
+++ b/src/sprite.cpp
@@ -43,14 +43,12 @@ void DrawCommonTileSeq(const TileInfo *ti, const DrawTileSprites *dts, Transpare
}
/* TTD sprite 0 means no sprite */
- if (GB(image, 0, SPRITE_WIDTH) == 0 && !HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) {
+ if ((GB(image, 0, SPRITE_WIDTH) == 0 && !HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) ||
+ (IsInvisibilitySet(to) && !HasBit(image, SPRITE_MODIFIER_OPAQUE))) {
skip_childs = dtss->IsParentSprite();
continue;
}
- /* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
- if (IsInvisibilitySet(to) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
-
image += (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? newgrf_offset : orig_offset);
if (HasBit(pal, SPRITE_MODIFIER_CUSTOM_SPRITE)) pal += newgrf_offset;