OpenTTD Source: src/road_internal.h File Reference

OpenTTD Source 14.0-RC3

Functions
road_internal.h File Reference
`#include "tile_cmd.h"`
`#include "road_type.h"`

Go to the source code of this file.

## Functions
RoadBits | CleanUpRoadBits (const TileIndex tile, RoadBits org_rb)
| Clean up unnecessary RoadBits of a planned tile. More...
CommandCost | CheckAllowRemoveRoad (TileIndex tile, RoadBits remove, Owner owner, RoadTramType rtt, DoCommandFlag flags, bool town_check=true)
| Is it allowed to remove the given road bits from the given tile? More...
void | DrawRoadCatenary (const TileInfo *ti)
| Draws the catenary for the given tile. More...

## Detailed Description

Functions used internally by the roads.

Definition in file road_internal.h.

## Function Documentation

## ◆ CheckAllowRemoveRoad()

CommandCost CheckAllowRemoveRoad | ( | TileIndex | tile,
|  | RoadBits | remove,
|  | Owner | owner,
|  | RoadTramType | rtt,
|  | DoCommandFlag | flags,
|  | bool | town_check
| ) |  |

Is it allowed to remove the given road bits from the given tile?

Parameters

  tile | the tile to remove the road from
  remove | the roadbits that are going to be removed
  owner | the actual owner of the roadbits of the tile
  rt | the road type to remove the bits from
  flags | command flags
  town_check | Shall the town rating checked/affected

Returns
  A succeeded command when it is allowed to remove the road bits, a failed command otherwise.

Definition at line 262 of file road_cmd.cpp.

## ◆ CleanUpRoadBits()

RoadBits CleanUpRoadBits | ( | const TileIndex | tile,
|  | RoadBits | org_rb
| ) |  |

Clean up unnecessary RoadBits of a planned tile.

Parameters

  tile | current tile
  org_rb | planned RoadBits

Returns
  optimised RoadBits

Definition at line 47 of file road.cpp.

References DIAGDIR_BEGIN, DIAGDIR_END, DiagDirToRoadBits(), GetAnyRoadBits(), GetTileType(), IsNormalRoadTile(), IsValidTile(), MirrorRoadBits(), MP_CLEAR, MP_ROAD, MP_STATION, MP_TREES, MP_TUNNELBRIDGE, ROAD_NONE, and TileAddByDiagDir().

## ◆ DrawRoadCatenary()

void DrawRoadCatenary | ( | const TileInfo * | ti | ) |

Draws the catenary for the given tile.

Parameters

  ti | information about the tile (slopes, height etc)

Definition at line 1451 of file road_cmd.cpp.

References GetRoadBits(), IsNormalRoad(), IsTileType(), MP_ROAD, ROAD_NONE, and TileInfo::tile.