From 5a1df325e288f817cf6e24f642485dae444f8f8e Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 18 Oct 2008 17:21:56 +0000 Subject: (svn r14488) -Fix: Synchronize drawing of spritelayouts in DrawTileLayout (Houses), IndustryDrawTileLayout, DrawStationTile, DrawTile_Station and DrawTile_Track (Waypoint). Now transparency options, PALETTE_MODIFIER_TRANSPARENT and SPRITE_MODIFIER_OPAQUE should work for all of them. --- src/rail_cmd.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/rail_cmd.cpp') diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index f08a613a4..61beff3bf 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2014,10 +2014,14 @@ default_waypoint: image += relocation; } - if (!(!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)) && HasBit(image, PALETTE_MODIFIER_COLOR)) { - pal = _drawtile_track_palette; + if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOR)) { + if (dtss->image.pal != 0) { + pal = dtss->image.pal; + } else { + pal = _drawtile_track_palette; + } } else { - pal = dtss->image.pal; + pal = PAL_NONE; } if ((byte)dtss->delta_z != 0x80) { @@ -2029,7 +2033,8 @@ default_waypoint: !HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS) ); } else { - AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y); + /* For stations and original spritelayouts delta_x and delta_y are signed */ + AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y, !HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)); } } } -- cgit v1.2.3-54-g00ecf