summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-04-08 21:28:47 +0000
committersmatz <smatz@openttd.org>2008-04-08 21:28:47 +0000
commit627322b9f7edfa0dd968a6856044258953dbc4c0 (patch)
tree684cb63f357d517403320fd5131c55ca5d471615 /src
parent3abf0eea7c3461632c252e91b557bd0f71dc5b2a (diff)
downloadopenttd-627322b9f7edfa0dd968a6856044258953dbc4c0.tar.xz
(svn r12632) -Fix (r12547): with invisible catenary, trams were be drawn over a bridge
Diffstat (limited to 'src')
-rw-r--r--src/tunnelbridge_cmd.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 5a934811d..2f4c7ac28 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -791,20 +791,28 @@ static void DrawBridgeTramBits(int x, int y, byte z, int offset, bool overlay, b
/* The sprites under the vehicles are drawn as SpriteCombine. StartSpriteCombine() has already been called
* The bounding boxes here are the same as for bridge front/roof */
if (head || !IsInvisibilitySet(TO_BRIDGES)) {
- AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, !head && IsTransparencySet(TO_BRIDGES));
+ AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE,
+ x, y, size_x[offset], size_y[offset], 0x28, z,
+ !head && IsTransparencySet(TO_BRIDGES));
}
/* Do not draw catenary if it is set invisible */
- if (IsInvisibilitySet(TO_CATENARY)) return;
-
- AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + back_offsets[offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, IsTransparencySet(TO_CATENARY));
+ if (!IsInvisibilitySet(TO_CATENARY)) {
+ AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + back_offsets[offset], PAL_NONE,
+ x, y, size_x[offset], size_y[offset], 0x28, z,
+ IsTransparencySet(TO_CATENARY));
+ }
/* Start a new SpriteCombine for the front part */
EndSpriteCombine();
StartSpriteCombine();
/* For sloped sprites the bounding box needs to be higher, as the pylons stop on a higher point */
- AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + front_offsets[offset], PAL_NONE, x, y, size_x[offset] + front_bb_offset_x[offset], size_y[offset] + front_bb_offset_y[offset], 0x28, z, IsTransparencySet(TO_CATENARY), front_bb_offset_x[offset], front_bb_offset_y[offset]);
+ if (!IsInvisibilitySet(TO_CATENARY)) {
+ AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + front_offsets[offset], PAL_NONE,
+ x, y, size_x[offset] + front_bb_offset_x[offset], size_y[offset] + front_bb_offset_y[offset], 0x28, z,
+ IsTransparencySet(TO_CATENARY), front_bb_offset_x[offset], front_bb_offset_y[offset]);
+ }
}
/**