|
@@ -416,49 +416,49 @@ static void DrawCatenaryRailway(const Ti
|
|
|
if (HasBit(PPPallowed[i], temp)) {
|
|
|
uint x = ti->x + x_pcp_offsets[i] + x_ppp_offsets[temp];
|
|
|
uint y = ti->y + y_pcp_offsets[i] + y_ppp_offsets[temp];
|
|
|
|
|
|
/* Don't build the pylon if it would be outside the tile */
|
|
|
if (!HasBit(OwnedPPPonPCP[i], temp)) {
|
|
|
/* We have a neighour that will draw it, bail out */
|
|
|
if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE) break;
|
|
|
continue; // No neighbour, go looking for a better position
|
|
|
}
|
|
|
|
|
|
AddSortableSpriteToDraw(pylon_base + pylon_sprites[temp], PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE,
|
|
|
elevation, IsTransparencySet(TO_CATENARY), -1, -1);
|
|
|
|
|
|
break; // We already have drawn a pylon, bail out
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* The wire above the tunnel is drawn together with the tunnel-roof (see DrawCatenaryOnTunnel()) */
|
|
|
if (IsTunnelTile(ti->tile)) return;
|
|
|
|
|
|
/* Don't draw a wire under a low bridge */
|
|
|
if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !IsTransparencySet(TO_CATENARY)) {
|
|
|
if (MayHaveBridgeAbove(ti->tile) && IsBridgeAbove(ti->tile) && !IsTransparencySet(TO_BRIDGES)) {
|
|
|
int height = GetBridgeHeight(GetNorthernBridgeEnd(ti->tile));
|
|
|
|
|
|
if (height <= GetTileMaxZ(ti->tile) + 1) return;
|
|
|
}
|
|
|
|
|
|
/* Don't draw a wire if the station tile does not want any */
|
|
|
if (IsRailStationTile(ti->tile) && !CanStationTileHaveWires(ti->tile)) return;
|
|
|
|
|
|
SpriteID wire_normal = GetWireBase(ti->tile);
|
|
|
SpriteID wire_halftile = (halftile_corner != CORNER_INVALID) ? GetWireBase(ti->tile, TCX_UPPER_HALFTILE) : wire_normal;
|
|
|
Track halftile_track;
|
|
|
switch (halftile_corner) {
|
|
|
case CORNER_W: halftile_track = TRACK_LEFT; break;
|
|
|
case CORNER_S: halftile_track = TRACK_LOWER; break;
|
|
|
case CORNER_E: halftile_track = TRACK_RIGHT; break;
|
|
|
case CORNER_N: halftile_track = TRACK_UPPER; break;
|
|
|
default: halftile_track = INVALID_TRACK; break;
|
|
|
}
|
|
|
|
|
|
/* Drawing of pylons is finished, now draw the wires */
|
|
|
Track t;
|
|
|
FOR_EACH_SET_TRACK(t, wireconfig[TS_HOME]) {
|
|
|
SpriteID wire_base = (t == halftile_track) ? wire_halftile : wire_normal;
|
|
|
byte PCPconfig = HasBit(PCPstatus, PCPpositions[t][0]) +
|