mirror of https://github.com/OpenTTD/OpenTTD
(svn r27209) -Add: Draw path reservation on the whole bridge, not only on the bridge heads.
parent
8f03a02efc
commit
beb213f9ee
|
@ -85,8 +85,12 @@ bool TryReserveRailTrack(TileIndex tile, Track t, bool trigger_stations)
|
||||||
|
|
||||||
if (_settings_client.gui.show_track_reservation) {
|
if (_settings_client.gui.show_track_reservation) {
|
||||||
/* show the reserved rail if needed */
|
/* show the reserved rail if needed */
|
||||||
|
if (IsBridgeTile(tile)) {
|
||||||
|
MarkBridgeDirty(tile);
|
||||||
|
} else {
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (GetTileType(tile)) {
|
switch (GetTileType(tile)) {
|
||||||
case MP_RAILWAY:
|
case MP_RAILWAY:
|
||||||
|
@ -141,8 +145,12 @@ void UnreserveRailTrack(TileIndex tile, Track t)
|
||||||
assert((GetTileTrackStatus(tile, TRANSPORT_RAIL, 0) & TrackToTrackBits(t)) != 0);
|
assert((GetTileTrackStatus(tile, TRANSPORT_RAIL, 0) & TrackToTrackBits(t)) != 0);
|
||||||
|
|
||||||
if (_settings_client.gui.show_track_reservation) {
|
if (_settings_client.gui.show_track_reservation) {
|
||||||
|
if (IsBridgeTile(tile)) {
|
||||||
|
MarkBridgeDirty(tile);
|
||||||
|
} else {
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (GetTileType(tile)) {
|
switch (GetTileType(tile)) {
|
||||||
case MP_RAILWAY:
|
case MP_RAILWAY:
|
||||||
|
|
|
@ -2216,11 +2216,15 @@ static void ClearPathReservation(const Train *v, TileIndex tile, Trackdir track_
|
||||||
SetTunnelBridgeReservation(end, false);
|
SetTunnelBridgeReservation(end, false);
|
||||||
|
|
||||||
if (_settings_client.gui.show_track_reservation) {
|
if (_settings_client.gui.show_track_reservation) {
|
||||||
|
if (IsBridge(tile)) {
|
||||||
|
MarkBridgeDirty(tile);
|
||||||
|
} else {
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
MarkTileDirtyByTile(end);
|
MarkTileDirtyByTile(end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (IsRailStationTile(tile)) {
|
} else if (IsRailStationTile(tile)) {
|
||||||
TileIndex new_tile = TileAddByDiagDir(tile, dir);
|
TileIndex new_tile = TileAddByDiagDir(tile, dir);
|
||||||
/* If the new tile is not a further tile of the same station, we
|
/* If the new tile is not a further tile of the same station, we
|
||||||
|
|
|
@ -1481,6 +1481,16 @@ void DrawBridgeMiddle(const TileInfo *ti)
|
||||||
AddSortableSpriteToDraw(surface + axis, PAL_NONE, x, y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES));
|
AddSortableSpriteToDraw(surface + axis, PAL_NONE, x, y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && !IsInvisibilitySet(TO_BRIDGES) && HasTunnelBridgeReservation(rampnorth)) {
|
||||||
|
if (rti->UsesOverlay()) {
|
||||||
|
SpriteID overlay = GetCustomRailSprite(rti, ti->tile, RTSG_OVERLAY);
|
||||||
|
AddSortableSpriteToDraw(overlay + RTO_X + axis, PALETTE_CRASH, ti->x, ti->y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES));
|
||||||
|
} else {
|
||||||
|
AddSortableSpriteToDraw(axis == AXIS_X ? rti->base_sprites.single_x : rti->base_sprites.single_y, PALETTE_CRASH, ti->x, ti->y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EndSpriteCombine();
|
EndSpriteCombine();
|
||||||
|
|
||||||
if (HasCatenaryDrawn(GetRailType(rampsouth))) {
|
if (HasCatenaryDrawn(GetRailType(rampsouth))) {
|
||||||
|
|
Loading…
Reference in New Issue