(svn r10698) -Codechange [FS#1082]: simplify the code related to foundations. Primarily removal of (duplicated|magic) code and introduction of few helper functions to ease foundation determination. Patch by frosch.

This commit is contained in:
rubidium
2007-07-26 16:51:10 +00:00
parent 5bd241eb5b
commit d624f66c79
23 changed files with 274 additions and 246 deletions

View File

@@ -176,7 +176,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
for (i = DIAGDIR_NE; i < DIAGDIR_END; i++) {
TileIndex neighbour = ti->tile + TileOffsByDiagDir(i);
uint foundation = 0;
Foundation foundation = FOUNDATION_NONE;
int k;
/* Here's one of the main headaches. GetTileSlope does not correct for possibly
@@ -225,9 +225,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetBridgeRampDirection(neighbour)));
}
if (foundation != 0) {
tileh[TS_NEIGHBOUR] = foundation < 15 ? SLOPE_FLAT : _inclined_tileh[foundation - 15];
}
ApplyFoundationToSlope(foundation, &tileh[TS_NEIGHBOUR]);
AdjustTileh(neighbour, &tileh[TS_NEIGHBOUR]);