From 29125c0e68ffc3d4627212f33bce39ba108cd341 Mon Sep 17 00:00:00 2001 From: smatz Date: Mon, 18 Feb 2008 16:11:31 +0000 Subject: (svn r12177) -Codechange: use 'side' parameter in GetTileTrackStatus so there can be less checks in pathfinders for depots/stations/tunnels/bridges --- src/landscape.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/landscape.cpp') diff --git a/src/landscape.cpp b/src/landscape.cpp index 8745fa19f..5641c8924 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -437,9 +437,18 @@ void DoClearSquare(TileIndex tile) MarkTileDirtyByTile(tile); } -uint32 GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode) +/** Returns trackdirbits in lower two bytes and additional info about track status in upper two bytes + * If there is any trackbit at 'side', return all trackdirbits. + * For TRANSPORT_ROAD, return 0 if there is no roadbit (of given subtype) at given side. + * @param tile tile to get info about + * @param mode transport type + * @param sub_mode for TRANSPORT_ROAD, roadtypes to check + * @param side side we are entering from, INVALID_DIAGDIR to return all trackbits + * @return trackdirbits and other info depending on 'mode' + */ +uint32 GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side) { - return _tile_type_procs[GetTileType(tile)]->get_tile_track_status_proc(tile, mode, sub_mode); + return _tile_type_procs[GetTileType(tile)]->get_tile_track_status_proc(tile, mode, sub_mode, side); } void ChangeTileOwner(TileIndex tile, PlayerID old_player, PlayerID new_player) -- cgit v1.2.3-54-g00ecf