File diff r4076:ac684fc44bc2 → r4077:259c4c4aacad
elrail.c
Show inline comments
 
@@ -84,6 +84,7 @@ static TrackBits GetRailTrackBitsUnivers
 
					return 0;
 
			}
 
			break;
 

	
 
		case MP_TUNNELBRIDGE:
 
			if (IsTunnel(t)) {
 
				if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
 
@@ -104,15 +105,18 @@ static TrackBits GetRailTrackBitsUnivers
 
					return DiagDirToAxis(GetBridgeRampDirection(t)) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y;
 
				}
 
			}
 

	
 
		case MP_STREET:
 
			if (GetRoadTileType(t) != ROAD_TILE_CROSSING) return 0;
 
			if (GetRailTypeCrossing(t) != RAILTYPE_ELECTRIC) return 0;
 
			return GetCrossingRailBits(t);
 

	
 
		case MP_STATION:
 
			if (!IsRailwayStation(t)) return 0;
 
			if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
 
			if (!IsStationTileElectrifiable(t)) return 0;
 
			return TrackToTrackBits(GetRailStationTrack(t));
 

	
 
		default:
 
			return 0;
 
	}
 
@@ -124,8 +128,11 @@ static TrackBits GetRailTrackBitsUnivers
 
  */
 
static void AdjustTileh(TileIndex tile, Slope* tileh)
 
{
 
	if (IsTunnelTile(tile)) *tileh = SLOPE_FLAT;
 
	if (IsBridgeTile(tile) && IsBridgeRamp(tile)) {
 
	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
 
		if (IsTunnel(tile)) {
 
			*tileh = SLOPE_FLAT;
 
		} else {
 
			if (IsBridgeRamp(tile)) {
 
		if (*tileh != SLOPE_FLAT) {
 
			*tileh = SLOPE_FLAT;
 
		} else {
 
@@ -139,6 +146,8 @@ static void AdjustTileh(TileIndex tile, 
 
		}
 
	}
 
}
 
	}
 
}
 

	
 
/** Draws wires and, if required, pylons on a given tile
 
  * @param ti The Tileinfo to draw the tile for
 
@@ -251,6 +260,7 @@ static void DrawCatenaryRailway(const Ti
 
		if (PPPallowed[i] != 0 && HASBIT(PCPstatus, i) && !HASBIT(OverridePCP, i)) {
 
			for (k = 0; k < DIR_END; k++) {
 
				byte temp = PPPorder[i][GetTLG(ti->tile)][k];
 

	
 
				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];