summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2007-02-13 16:36:38 +0000
committercelestar <celestar@openttd.org>2007-02-13 16:36:38 +0000
commitd9385f27986a59fa6b4a557e9bd6a04dc80752d8 (patch)
tree95900e955779b893062a6fbfbae3fa7fcf8323d1 /src/station_cmd.cpp
parent5e880a6a75d5fb3e9d9b90d30ebd720c9dce2a6e (diff)
downloadopenttd-d9385f27986a59fa6b4a557e9bd6a04dc80752d8.tar.xz
(svn r8709) -Fix/Codechange: Rename the function GetStationPlatforms into GetPlatformLength because that is what it really does. Overload it because there is already a GetPlatformLength (one gives the length of the whole platform, the other gives the remaining length in a given direction). Turned both functions into methods of Station. While messing around with it, fix a problem where loading times for overhanging trains are miscomputed.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index be67f3712..5ab33781e 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1140,57 +1140,6 @@ int32 CmdRemoveFromRailroadStation(TileIndex tile, uint32 flags, uint32 p1, uint
return _price.remove_rail_station;
}
-// determine the number of platforms for the station
-uint GetStationPlatforms(const Station *st, TileIndex tile)
-{
- TileIndex t;
- TileIndexDiff delta;
- Axis axis;
- uint len;
- assert(st->TileBelongsToRailStation(tile));
-
- len = 0;
- axis = GetRailStationAxis(tile);
- delta = (axis == AXIS_X ? TileDiffXY(1, 0) : TileDiffXY(0, 1));
-
- // find starting tile..
- t = tile;
- do {
- t -= delta;
- len++;
- } while (st->TileBelongsToRailStation(t) && GetRailStationAxis(t) == axis);
-
- // find ending tile
- t = tile;
- do {
- t += delta;
- len++;
- } while (st->TileBelongsToRailStation(t) && GetRailStationAxis(t) == axis);
-
- return len - 1;
-}
-
-/** Determines the REMAINING length of a platform, starting at (and including)
- * the given tile.
- * @param tile the tile from which to start searching. Must be a railway station tile
- * @param dir The direction in which to search.
- * @return The platform length
- */
-uint GetPlatformLength(TileIndex tile, DiagDirection dir)
-{
- TileIndex start_tile = tile;
- uint length = 0;
- assert(IsRailwayStationTile(tile));
- assert(dir < DIAGDIR_END);
-
- do {
- length ++;
- tile += TileOffsByDiagDir(dir);
- } while (IsCompatibleTrainStationTile(tile, start_tile));
-
- return length;
-}
-
static int32 RemoveRailroadStation(Station *st, TileIndex tile, uint32 flags)
{