summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-08-09 07:30:50 +0000
committerfrosch <frosch@openttd.org>2010-08-09 07:30:50 +0000
commitb6cf38a9123bc560fe8b4dfcbfe492f5577c64ce (patch)
treebed7186cf77bf2e56ea04cdfc7147ca9a12cd877
parentc2b1c624dd0d7909c69ddfba1eb2cf611b22cd25 (diff)
downloadopenttd-b6cf38a9123bc560fe8b4dfcbfe492f5577c64ce.tar.xz
(svn r20422) -Change [FS#3947]: Resolve tracksprites on bridges always using the southern bridgehead as tile.
-rw-r--r--src/elrail.cpp4
-rw-r--r--src/newgrf_spritegroup.h2
-rw-r--r--src/tunnelbridge_cmd.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp
index 3a2ca3d94..9743507c5 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -503,14 +503,14 @@ void DrawCatenaryOnBridge(const TileInfo *ti)
height = GetBridgeHeight(end);
- SpriteID wire_base = GetWireBase(start);
+ SpriteID wire_base = GetWireBase(end);
AddSortableSpriteToDraw(wire_base + sss->image_offset, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
sss->x_size, sss->y_size, sss->z_size, height + sss->z_offset,
IsTransparencySet(TO_CATENARY)
);
- SpriteID pylon_base = GetPylonBase(start);
+ SpriteID pylon_base = GetPylonBase(end);
/* Finished with wires, draw pylons
* every other tile needs a pylon on the northern end */
diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h
index 468754244..7f220f7c5 100644
--- a/src/newgrf_spritegroup.h
+++ b/src/newgrf_spritegroup.h
@@ -346,7 +346,7 @@ struct ResolverObject {
uint8 station_size;
} generic;
struct {
- TileIndex tile;
+ TileIndex tile; ///< Tracktile. For track on a bridge this is the southern bridgehead.
TileContext context; ///< Are we resolving sprites for the upper halftile, or on a bridge?
} routes;
struct {
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index adb399af8..0c08fd11d 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1253,7 +1253,7 @@ void DrawBridgeMiddle(const TileInfo *ti)
} else if (transport_type == TRANSPORT_RAIL) {
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(rampsouth));
if (rti->UsesOverlay()) {
- SpriteID surface = GetCustomRailSprite(rti, ti->tile, RTSG_BRIDGE);
+ SpriteID surface = GetCustomRailSprite(rti, rampsouth, RTSG_BRIDGE);
if (surface != 0) {
AddSortableSpriteToDraw(surface + axis, PAL_NONE, x, y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES));
}