mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r12853) -Fix: catenary on tunnel entrances and middle bridge pieces was drawn twice in some cases
This commit is contained in:
parent
ccfe024a2a
commit
459259aeec
@ -377,8 +377,13 @@ static void DrawCatenaryRailway(const TileInfo *ti)
|
||||
}
|
||||
}
|
||||
|
||||
static void DrawCatenaryOnBridge(const TileInfo *ti)
|
||||
void DrawCatenaryOnBridge(const TileInfo *ti)
|
||||
{
|
||||
if (_patches.disable_elrails) return;
|
||||
|
||||
/* Do not draw catenary if it is invisible */
|
||||
if (IsInvisibilitySet(TO_CATENARY)) return;
|
||||
|
||||
TileIndex end = GetSouthernBridgeEnd(ti->tile);
|
||||
TileIndex start = GetOtherBridgeEnd(end);
|
||||
|
||||
@ -437,14 +442,6 @@ void DrawCatenary(const TileInfo *ti)
|
||||
/* Do not draw catenary if it is invisible */
|
||||
if (IsInvisibilitySet(TO_CATENARY)) return;
|
||||
|
||||
if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile)) {
|
||||
TileIndex head = GetNorthernBridgeEnd(ti->tile);
|
||||
|
||||
if (GetTunnelBridgeTransportType(head) == TRANSPORT_RAIL && HasCatenary(GetRailType(head))) {
|
||||
DrawCatenaryOnBridge(ti);
|
||||
}
|
||||
}
|
||||
|
||||
switch (GetTileType(ti->tile)) {
|
||||
case MP_RAILWAY:
|
||||
if (IsRailDepot(ti->tile)) {
|
||||
|
@ -216,6 +216,7 @@ static inline bool HasCatenary(RailType rt)
|
||||
*/
|
||||
void DrawCatenary(const TileInfo *ti);
|
||||
void DrawCatenaryOnTunnel(const TileInfo *ti);
|
||||
void DrawCatenaryOnBridge(const TileInfo *ti);
|
||||
|
||||
Foundation GetRailFoundation(Slope tileh, TrackBits bits);
|
||||
|
||||
|
@ -886,8 +886,6 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
|
||||
}
|
||||
}
|
||||
} else if (!IsInvisibilitySet(TO_CATENARY) && HasCatenary(GetRailType(ti->tile))) {
|
||||
DrawCatenary(ti);
|
||||
|
||||
catenary = true;
|
||||
StartSpriteCombine();
|
||||
DrawCatenaryOnTunnel(ti);
|
||||
@ -1089,7 +1087,7 @@ void DrawBridgeMiddle(const TileInfo* ti)
|
||||
StartSpriteCombine();
|
||||
}
|
||||
} else if (HasCatenary(GetRailType(rampsouth))) {
|
||||
DrawCatenary(ti);
|
||||
DrawCatenaryOnBridge(ti);
|
||||
}
|
||||
|
||||
/* draw roof, the component of the bridge which is logically between the vehicle and the camera */
|
||||
|
Loading…
Reference in New Issue
Block a user