(svn r7644) [cbh] - Codechange: For custombridgeheads (those that have more than just one straight piece of track) use a foundation and the normal track drawing code custombridgeheads
authorcelestar
Sat, 30 Dec 2006 12:05:05 +0000
branchcustombridgeheads
changeset 5599 a18b0c2587f7
parent 5598 166345600ba9
child 5600 bac9ab186cab
(svn r7644) [cbh] - Codechange: For custombridgeheads (those that have more than just one straight piece of track) use a foundation and the normal track drawing code
bridge_cmd.c
rail.h
rail_cmd.c
--- a/bridge_cmd.c	Sat Dec 30 11:57:57 2006 +0000
+++ b/bridge_cmd.c	Sat Dec 30 12:05:05 2006 +0000
@@ -611,6 +611,10 @@
 	bool ice = HasBridgeSnowOrDesert(ti->tile);
 
 	if (GetBridgeTransportType(ti->tile) == TRANSPORT_RAIL) {
+		if (GetTrackBits(ti->tile) != TRACK_BIT_X && GetTrackBits(ti->tile) != TRACK_BIT_Y) {
+			DrawTile_Track(ti);
+			return;
+		}
 		base_offset = GetRailTypeInfo(GetRailType(ti->tile))->bridge_offset;
 		assert(base_offset != 8); /* This one is used for roads */
 	} else {
--- a/rail.h	Sat Dec 30 11:57:57 2006 +0000
+++ b/rail.h	Sat Dec 30 12:05:05 2006 +0000
@@ -465,6 +465,7 @@
 void DrawCatenary(const TileInfo *ti);
 
 uint GetRailFoundation(Slope tileh, TrackBits bits);
+void DrawTile_Track(TileInfo *ti);
 uint32 GetTileTrackStatus_Track(TileIndex tile, TransportType mode);
 
 int32 SettingsDisableElrail(int32 p1); ///< _patches.disable_elrail callback
--- a/rail_cmd.c	Sat Dec 30 11:57:57 2006 +0000
+++ b/rail_cmd.c	Sat Dec 30 12:05:05 2006 +0000
@@ -1212,7 +1212,7 @@
 	(image++, true);
 
 	if (ti->tileh != SLOPE_FLAT) {
-		uint foundation = GetRailFoundation(ti->tileh, track);
+		uint foundation = IsTileType(ti->tile, MP_RAILWAY_BRIDGE) ? ti->tileh : GetRailFoundation(ti->tileh, track);
 
 		if (foundation != 0) DrawFoundation(ti, foundation);
 
@@ -1276,7 +1276,7 @@
 	}
 }
 
-static void DrawTile_Track(TileInfo *ti)
+void DrawTile_Track(TileInfo *ti)
 {
 	const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
 	PalSpriteID image;