summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-10-18 17:21:56 +0000
committerfrosch <frosch@openttd.org>2008-10-18 17:21:56 +0000
commit5a1df325e288f817cf6e24f642485dae444f8f8e (patch)
tree9039e308f0d1ea5cf472eeac69885f8c155b5db8 /src/rail_cmd.cpp
parent2e6894b7bbaeab6296676ad182d200489aa10216 (diff)
downloadopenttd-5a1df325e288f817cf6e24f642485dae444f8f8e.tar.xz
(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.
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp13
1 files changed, 9 insertions, 4 deletions
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));
}
}
}