summaryrefslogtreecommitdiff
path: root/src/road_map.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-18 23:09:43 +0000
committerrubidium <rubidium@openttd.org>2011-01-18 23:09:43 +0000
commit9ca4b629cd91c2749d9efafd752fc5175ebce5fd (patch)
tree24da99d42f3e33eb7f4109462dcced5adc6eab15 /src/road_map.cpp
parent7efd7e19ed046a4a0c03077f27930291ba5b9725 (diff)
downloadopenttd-9ca4b629cd91c2749d9efafd752fc5175ebce5fd.tar.xz
(svn r21846) -Codechange: move documentation towards the code to make it more likely to be updated [o-s].
Diffstat (limited to 'src/road_map.cpp')
-rw-r--r--src/road_map.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/road_map.cpp b/src/road_map.cpp
index e995f17f2..2c24582ee 100644
--- a/src/road_map.cpp
+++ b/src/road_map.cpp
@@ -14,6 +14,22 @@
#include "tunnelbridge_map.h"
+/**
+ * Returns the RoadBits on an arbitrary tile
+ * Special behaviour:
+ * - road depots: entrance is treated as road piece
+ * - road tunnels: entrance is treated as road piece
+ * - bridge ramps: start of the ramp is treated as road piece
+ * - bridge middle parts: bridge itself is ignored
+ *
+ * If straight_tunnel_bridge_entrance is set a ROAD_X or ROAD_Y
+ * for bridge ramps and tunnel entrances is returned depending
+ * on the orientation of the tunnel or bridge.
+ * @param tile the tile to get the road bits for
+ * @param rt the road type to get the road bits form
+ * @param straight_tunnel_bridge_entrance whether to return straight road bits for tunnels/bridges.
+ * @return the road bits of the given tile
+ */
RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance)
{
if (!HasTileRoadType(tile, rt)) return ROAD_NONE;