changeset 17917:3eed52b7ef72 draft

(svn r22722) -Fix: Skip invisible parent and child sprites due to transparency settings using the same logic as skipping due to grf-defined invisibility.
author frosch <frosch@openttd.org>
date Sat, 06 Aug 2011 11:14:07 +0000
parents 7ef2094e2f4e
children 05fc8b355294
files src/sprite.cpp
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/sprite.cpp
+++ b/src/sprite.cpp
@@ -43,14 +43,12 @@
 		}
 
 		/* 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;