Variables

# trafficlight.h File Reference

variables used for handling trafficlights. More...

Go to the source code of this file.

## Variables
static const uint8 | _tlc_distance [5]
| Used for synchronising traffic light signals.
static const TileIndexDiffC | _tl_check_offsets [80]
static const Point | _tl_offsets [2][4]
| Drawing offsets for the traffic light posts [roadside (left, right)][direction (SW, SE, NW, NE)].
static const SpriteID | _tls_to_sprites [7][4]
| Sprites needed for the various states of a TL crossing [state][direction].

## Detailed Description

variables used for handling trafficlights.

Definition in file trafficlight.h.

## Variable Documentation

const Point _tl_offsets[2][4]`[static]`

Initial value:

     {
      {{15, 1}, {14, 15}, {1, 0}, {0, 14}},
      {{15, 14}, {1, 15}, {14, 0}, {0, 1}}
    }

Drawing offsets for the traffic light posts [roadside (left, right)][direction (SW, SE, NW, NE)].

Definition at line 117 of file trafficlight.h.

Referenced by DrawTrafficLights().

const uint8 _tlc_distance[5]`[static]`

Initial value:

     {
    0,
    8,
    24,
    48,
    80
    }

Used for synchronising traffic light signals.

Number below is how far we look into the _tl_check_offsets array when placing trafficlights, based on _settings_game.construction.max_tlc_distance.

Definition at line 18 of file trafficlight.h.

Referenced by GetTrafficLightConsist().

const SpriteID _tls_to_sprites[7][4]`[static]`

Initial value:

     {
      {SPR_TL_SW_NONE,       SPR_TL_SE_NONE,       SPR_TL_NW_NONE,       SPR_TL_NE_NONE},
      {SPR_TL_SW_GREEN,      SPR_TL_SE_RED,        SPR_TL_NW_RED,        SPR_TL_NE_GREEN},
      {SPR_TL_SW_YELLOW,     SPR_TL_SE_RED,        SPR_TL_NW_RED,        SPR_TL_NE_YELLOW},
      {SPR_TL_SW_RED,        SPR_TL_SE_RED_YELLOW, SPR_TL_NW_RED_YELLOW, SPR_TL_NE_RED},
      {SPR_TL_SW_RED,        SPR_TL_SE_GREEN,      SPR_TL_NW_GREEN,      SPR_TL_NE_RED},
      {SPR_TL_SW_RED,        SPR_TL_SE_YELLOW,     SPR_TL_NW_YELLOW,     SPR_TL_NE_RED},
      {SPR_TL_SW_RED_YELLOW, SPR_TL_SE_RED,        SPR_TL_NW_RED,        SPR_TL_NE_RED_YELLOW},
    }

Sprites needed for the various states of a TL crossing [state][direction].

Definition at line 125 of file trafficlight.h.

Referenced by DrawTrafficLights().