Public Member Functions | Data Fields

RailtypeInfo Struct Reference

This struct contains all the info that is needed to draw and construct tracks. More...

#include <rail.h>

Public Member Functions

bool UsesOverlay () const
uint GetRailtypeSpriteOffset () const
 Offset between the current railtype and normal rail.

Data Fields

struct {
   SpriteID   track_y
 single piece of rail in Y direction, with ground
   SpriteID   track_ns
 two pieces of rail in North and South corner (East-West direction)
   SpriteID   ground
 ground sprite for a 3-way switch
   SpriteID   single_x
 single piece of rail in X direction, without ground
   SpriteID   single_y
 single piece of rail in Y direction, without ground
   SpriteID   single_n
 single piece of rail in the northern corner
   SpriteID   single_s
 single piece of rail in the southern corner
   SpriteID   single_e
 single piece of rail in the eastern corner
   SpriteID   single_w
 single piece of rail in the western corner
   SpriteID   single_sloped
 single piecs of rail for slopes
   SpriteID   crossing
 level crossing, rail in X direction
   SpriteID   tunnel
 tunnel sprites base
base_sprites
 Struct containing the main sprites.
struct {
   SpriteID   build_ns_rail
 button for building single rail in N-S direction
   SpriteID   build_x_rail
 button for building single rail in X direction
   SpriteID   build_ew_rail
 button for building single rail in E-W direction
   SpriteID   build_y_rail
 button for building single rail in Y direction
   SpriteID   auto_rail
 button for the autorail construction
   SpriteID   build_depot
 button for building depots
   SpriteID   build_tunnel
 button for building a tunnel
   SpriteID   convert_rail
 button for converting rail
gui_sprites
 struct containing the sprites for the rail GUI.
struct {
   CursorID   rail_ns
 Cursor for building rail in N-S direction.
   CursorID   rail_swne
 Cursor for building rail in X direction.
   CursorID   rail_ew
 Cursor for building rail in E-W direction.
   CursorID   rail_nwse
 Cursor for building rail in Y direction.
   CursorID   autorail
 Cursor for autorail tool.
   CursorID   depot
 Cursor for building a depot.
   CursorID   tunnel
 Cursor for building a tunnel.
   CursorID   convert
 Cursor for converting track.
cursor
struct {
   StringID   toolbar_caption
   StringID   menu_text
   StringID   build_caption
   StringID   replace_text
   StringID   new_loco
strings
SpriteID snow_offset
 sprite number difference between a piece of track on a snowy ground and the corresponding one on normal ground
RailTypes powered_railtypes
 bitmask to the OTHER railtypes on which an engine of THIS railtype generates power
RailTypes compatible_railtypes
 bitmask to the OTHER railtypes on which an engine of THIS railtype can physically travel
SpriteID bridge_offset
 Bridge offset.
byte fallback_railtype
 Original railtype number to use when drawing non-newgrf railtypes, or when drawing stations.
byte curve_speed
 Multiplier for curve maximum speed advantage.
RailTypeFlags flags
 Bit mask of rail type flags.
uint16 cost_multiplier
 Cost multiplier for building this rail type.
uint8 acceleration_type
 Acceleration type of this rail type.
uint16 max_speed
 Maximum speed for vehicles travelling on this rail type.
RailTypeLabel label
 Unique 32 bit rail type identifier.
byte map_colour
 Colour on mini-map.
Date introduction_date
 Introduction date.
RailTypes introduction_required_railtypes
 Bitmask of railtypes that are required for this railtype to be introduced at a given introduction_date.
RailTypes introduces_railtypes
 Bitmask of which other railtypes are introduced when this railtype is introduced.
byte sorting_order
 The sorting order of this railtype for the toolbar dropdown.
const SpriteGroupgroup [RTSG_END]
 Sprite groups for resolving sprites.

Detailed Description

This struct contains all the info that is needed to draw and construct tracks.

Definition at line 102 of file rail.h.


Member Function Documentation

uint RailtypeInfo::GetRailtypeSpriteOffset (  )  const [inline]

Offset between the current railtype and normal rail.

This means that:

1) All the sprites in a railset MUST be in the same order. This order is determined by normal rail. Check sprites 1005 and following for this order

2) The position where the railtype is loaded must always be the same, otherwise the offset will fail.

Definition at line 252 of file rail.h.

References fallback_railtype.

Referenced by DrawStationTile().


Field Documentation

Struct containing the main sprites.

Note:
not all sprites are listed, but only the ones used directly in the code

Referenced by DrawTile_Road(), DrawTile_TunnelBridge(), and DrawTrackBits().

struct { ... } RailtypeInfo::gui_sprites

struct containing the sprites for the rail GUI.

Note:
only sprites referred to directly in the code are listed

Referenced by CopyPasteWindow::OnTick(), and BuildRailToolbarWindow::SetupRailToolbar().

Introduction date.

When INVALID_DATE or a vehicle using this railtype gets introduced earlier, the vehicle's introduction date will be used instead for this railtype. The introduction at this date is furthermore limited by the introduction_required_types.

Definition at line 217 of file rail.h.

Referenced by AddDateIntroducedRailTypes(), and StartupEngines().


The documentation for this struct was generated from the following file: