File diff r17654:f28c4b7b0c47 → r17655:f7dac14deedf
src/elrail.cpp
Show inline comments
 
@@ -312,13 +312,12 @@ static void DrawCatenaryRailway(const Ti
 
			1 << CORNER_S | 1 << CORNER_E, // DIAGDIR_SE
 
			1 << CORNER_S | 1 << CORNER_W, // DIAGDIR_SW
 
			1 << CORNER_N | 1 << CORNER_W, // DIAGDIR_NW
 
		};
 
		SpriteID pylon_base = (halftile_corner != CORNER_INVALID && HasBit(edge_corners[i], halftile_corner)) ? pylon_halftile : pylon_normal;
 
		TileIndex neighbour = ti->tile + TileOffsByDiagDir(i);
 
		Foundation foundation = FOUNDATION_NONE;
 
		byte elevation = GetPCPElevation(ti->tile, i);
 

	
 
		/* Here's one of the main headaches. GetTileSlope does not correct for possibly
 
		 * existing foundataions, so we do have to do that manually later on.*/
 
		tileh[TS_NEIGHBOUR] = GetTileSlope(neighbour, NULL);
 
		trackconfig[TS_NEIGHBOUR] = GetRailTrackBitsUniversal(neighbour, NULL);
 
@@ -363,14 +362,16 @@ static void DrawCatenaryRailway(const Ti
 
		/* Deactivate all PPPs if PCP is not used */
 
		if (!HasBit(PCPstatus, i)) {
 
			PPPpreferred[i] = 0;
 
			PPPallowed[i] = 0;
 
		}
 

	
 
		/* A station is always "flat", so adjust the tileh accordingly */
 
		if (IsTileType(neighbour, MP_STATION)) tileh[TS_NEIGHBOUR] = SLOPE_FLAT;
 
		Foundation foundation = FOUNDATION_NONE;
 

	
 
		/* Station and road crossings are always "flat", so adjust the tileh accordingly */
 
		if (IsTileType(neighbour, MP_STATION) || IsTileType(neighbour, MP_ROAD)) tileh[TS_NEIGHBOUR] = SLOPE_FLAT;
 

	
 
		/* Read the foundataions if they are present, and adjust the tileh */
 
		if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && HasCatenary(GetRailType(neighbour))) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
 
		if (IsBridgeTile(neighbour)) {
 
			foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour)));
 
		}