# elrail_func.h File Reference

header file for electrified rail specific functions More...

`#include "rail.h"`
`#include "transparency.h"`
`#include "tile_cmd.h"`
`#include "settings_type.h"`

Go to the source code of this file.

## Functions
static bool | HasCatenary (RailType rt)
| Test if a rail type has catenary.
static bool | HasCatenaryDrawn (RailType rt)
| Test if we should draw rail catenary.
void | DrawCatenary (const TileInfo *ti)
| Draws overhead wires and pylons for electric railways.
void | DrawCatenaryOnTunnel (const TileInfo *ti)
| Draws wires on a tunnel tile.
void | DrawCatenaryOnBridge (const TileInfo *ti)
bool | SettingsDisableElrail (int32 p1)
| _settings_game.disable_elrail callback

## Detailed Description

header file for electrified rail specific functions

Definition in file elrail_func.h.

## Function Documentation

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

Draws overhead wires and pylons for electric railways.

Parameters:

  | ti | The TileInfo struct of the tile being drawn

See also:
  DrawCatenaryRailway

Definition at line 503 of file elrail.cpp.

References AddSortableSpriteToDraw(), DrawCatenaryRailway(), GetRailDepotDirection(), GetTileMaxZ(), GetTileType(), GetWireBase(), IsRailDepot(), IsTransparencySet(), MP_RAILWAY, MP_ROAD, MP_STATION, MP_TUNNELBRIDGE, TileInfo::tile, TO_CATENARY, TileInfo::x, and TileInfo::y.

Referenced by DrawTile_Road(), and DrawTile_TunnelBridge().

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

Draws wires on a tunnel tile.

DrawTile_TunnelBridge() calls this function to draw the wires as SpriteCombine with the tunnel roof.

Parameters:

  | ti | The Tileinfo to draw the tile for

Definition at line 226 of file elrail.cpp.

References AddSortableSpriteToDraw(), BB_Z_SEPARATOR, GetTileZ(), GetTunnelBridgeDirection(), GetWireBase(), IsTransparencySet(), TileInfo::tile, TO_CATENARY, TileInfo::x, and TileInfo::y.

Referenced by DrawTile_TunnelBridge().

static bool HasCatenary | ( | RailType | rt | ) | `[inline, static]`

Test if a rail type has catenary.

Parameters:

  | rt | Rail type to test

Definition at line 17 of file elrail_func.h.

References GetRailTypeInfo(), HasBit(), and RTF_CATENARY.

Referenced by DrawCatenaryRailway(), GetRailTrackBitsUniversal(), HasCatenaryDrawn(), and MaskWireBits().

static bool HasCatenaryDrawn | ( | RailType | rt | ) | `[inline, static]`

Test if we should draw rail catenary.

Parameters:

  | rt | Rail type to test

Definition at line 26 of file elrail_func.h.

References _settings_game, VehicleSettings::disable_elrails, HasCatenary(), IsInvisibilitySet(), TO_CATENARY, and GameSettings::vehicle.

Referenced by DrawTile_Road(), and DrawTile_TunnelBridge().