road_map.cpp File Reference

Complex road accessors. More...

#include "stdafx.h"
#include "station_map.h"
#include "tunnelbridge_map.h"
#include "safeguards.h"

Go to the source code of this file.


RoadBits GetAnyRoadBits (TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance)
 Returns the RoadBits on an arbitrary tile Special behaviour: More...

Detailed Description

Complex road accessors.

Definition in file road_map.cpp.

Function Documentation

◆ GetAnyRoadBits()

RoadBits GetAnyRoadBits ( TileIndex  tile,
RoadType  rt,
bool  straight_tunnel_bridge_entrance 

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.

tilethe tile to get the road bits for
rtthe road type to get the road bits form
straight_tunnel_bridge_entrancewhether to return straight road bits for tunnels/bridges.
the road bits of the given tile

Definition at line 35 of file road_map.cpp.

References AxisToRoadBits(), DIAGDIR_NE, DiagDirToAxis(), DiagDirToRoadBits(), GetCrossingRoadBits(), GetRoadBits(), GetRoadDepotDirection(), GetRoadStopDir(), GetRoadTileType(), GetTileType(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), HasTileRoadType(), IsDriveThroughStopTile(), IsRoadStopTile(), MP_ROAD, MP_STATION, MP_TUNNELBRIDGE, ReverseDiagDir(), ROAD_NONE, ROAD_TILE_CROSSING, ROAD_TILE_DEPOT, ROAD_TILE_NORMAL, ROAD_X, ROAD_Y, and TRANSPORT_ROAD.

Referenced by CanConnectToRoad(), CanRemoveRoadWithStop(), CleanUpRoadBits(), and GetTownRoadBits().