diff options
author | rubidium <rubidium@openttd.org> | 2007-07-26 16:51:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-26 16:51:10 +0000 |
commit | d624f66c794109a22787685a3aa53d6cf35a02ba (patch) | |
tree | 4b6a986aa841f12efff161e45aacd1a023cff71d /src/elrail.cpp | |
parent | 5bd241eb5b151dd9a5ebda0a93aff8740713ce62 (diff) | |
download | openttd-d624f66c794109a22787685a3aa53d6cf35a02ba.tar.xz |
(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.
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r-- | src/elrail.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp index a0a0bbdf9..69aa9259f 100644 --- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -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]); |