OpenTTD Source 20241224-master-gf74b0cf984
|
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 More... | ||
SpriteID track_ns | ||
two pieces of rail in North and South corner (East-West direction) More... | ||
SpriteID ground | ||
ground sprite for a 3-way switch More... | ||
SpriteID single_x | ||
single piece of rail in X direction, without ground More... | ||
SpriteID single_y | ||
single piece of rail in Y direction, without ground More... | ||
SpriteID single_n | ||
single piece of rail in the northern corner More... | ||
SpriteID single_s | ||
single piece of rail in the southern corner More... | ||
SpriteID single_e | ||
single piece of rail in the eastern corner More... | ||
SpriteID single_w | ||
single piece of rail in the western corner More... | ||
SpriteID single_sloped | ||
single piece of rail for slopes More... | ||
SpriteID crossing | ||
level crossing, rail in X direction More... | ||
SpriteID tunnel | ||
tunnel sprites base More... | ||
} | base_sprites | |
Struct containing the main sprites. | ||
struct { | ||
SpriteID build_ns_rail | ||
button for building single rail in N-S direction More... | ||
SpriteID build_x_rail | ||
button for building single rail in X direction More... | ||
SpriteID build_ew_rail | ||
button for building single rail in E-W direction More... | ||
SpriteID build_y_rail | ||
button for building single rail in Y direction More... | ||
SpriteID auto_rail | ||
button for the autorail construction More... | ||
SpriteID build_depot | ||
button for building depots More... | ||
SpriteID build_tunnel | ||
button for building a tunnel More... | ||
SpriteID convert_rail | ||
button for converting rail More... | ||
SpriteID signals [SIGTYPE_END][2][2] | ||
signal GUI sprites (type, variant, state) More... | ||
} | gui_sprites | |
struct containing the sprites for the rail GUI. | ||
struct { | ||
CursorID rail_ns | ||
Cursor for building rail in N-S direction. More... | ||
CursorID rail_swne | ||
Cursor for building rail in X direction. More... | ||
CursorID rail_ew | ||
Cursor for building rail in E-W direction. More... | ||
CursorID rail_nwse | ||
Cursor for building rail in Y direction. More... | ||
CursorID autorail | ||
Cursor for autorail tool. More... | ||
CursorID depot | ||
Cursor for building a depot. More... | ||
CursorID tunnel | ||
Cursor for building a tunnel. More... | ||
CursorID convert | ||
Cursor for converting track. More... | ||
} | cursor | |
Cursors associated with the rail type. | ||
struct { | ||
StringID name | ||
Name of this rail type. More... | ||
StringID toolbar_caption | ||
Caption in the construction toolbar GUI for this rail type. More... | ||
StringID menu_text | ||
Name of this rail type in the main toolbar dropdown. More... | ||
StringID build_caption | ||
Caption of the build vehicle GUI for this rail type. More... | ||
StringID replace_text | ||
Text used in the autoreplace GUI. More... | ||
StringID new_loco | ||
Name of an engine for this type of rail in the engine preview GUI. More... | ||
} | strings | |
Strings associated with the rail type. | ||
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. | ||
uint8_t | fallback_railtype | |
Original railtype number to use when drawing non-newgrf railtypes, or when drawing stations. | ||
uint8_t | curve_speed | |
Multiplier for curve maximum speed advantage. | ||
RailTypeFlags | flags | |
Bit mask of rail type flags. | ||
uint16_t | cost_multiplier | |
Cost multiplier for building this rail type. | ||
uint16_t | maintenance_multiplier | |
Cost multiplier for maintenance of this rail type. | ||
uint8_t | acceleration_type | |
Acceleration type of this rail type. | ||
uint16_t | max_speed | |
Maximum speed for vehicles travelling on this rail type. | ||
RailTypeLabel | label | |
Unique 32 bit rail type identifier. | ||
RailTypeLabelList | alternate_labels | |
Rail type labels this type provides in addition to the main label. | ||
uint8_t | map_colour | |
Colour on mini-map. | ||
TimerGameCalendar::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. | ||
uint8_t | sorting_order | |
The sorting order of this railtype for the toolbar dropdown. | ||
const GRFFile * | grffile [RTSG_END] | |
NewGRF providing the Action3 for the railtype. | ||
const SpriteGroup * | group [RTSG_END] | |
Sprite groups for resolving sprites. | ||
This struct contains all the info that is needed to draw and construct tracks.
|
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 295 of file rail.h.
References fallback_railtype.
Referenced by DrawStationTile().
uint8_t RailTypeInfo::acceleration_type |
Acceleration type of this rail type.
Definition at line 226 of file rail.h.
Referenced by AffectSpeedByZChange(), Train::GetAccelerationType(), RailTypeChangeInfo(), and TrainController().
RailTypeLabelList RailTypeInfo::alternate_labels |
Rail type labels this type provides in addition to the main label.
Definition at line 241 of file rail.h.
Referenced by AllocateRailType(), and GetRailTypeByLabel().
SpriteID RailTypeInfo::auto_rail |
button for the autorail construction
Definition at line 157 of file rail.h.
Referenced by BuildRailToolbarWindow::OnInit().
CursorID RailTypeInfo::autorail |
Cursor for autorail tool.
Definition at line 169 of file rail.h.
Referenced by BuildRailToolbarWindow::OnClick().
struct { ... } RailTypeInfo::base_sprites |
Struct containing the main sprites.
Referenced by DrawBridgeMiddle(), DrawTile_Road(), DrawTile_TunnelBridge(), and DrawTrackBits().
SpriteID RailTypeInfo::bridge_offset |
Bridge offset.
Definition at line 196 of file rail.h.
Referenced by DrawBridgeMiddle(), and DrawTile_TunnelBridge().
StringID RailTypeInfo::build_caption |
Caption of the build vehicle GUI for this rail type.
Definition at line 179 of file rail.h.
Referenced by RailTypeChangeInfo(), and BuildVehicleWindow::SetStringParameters().
SpriteID RailTypeInfo::build_depot |
button for building depots
Definition at line 158 of file rail.h.
Referenced by BuildRailToolbarWindow::OnInit().
SpriteID RailTypeInfo::build_ew_rail |
button for building single rail in E-W direction
Definition at line 155 of file rail.h.
Referenced by BuildRailToolbarWindow::OnInit().
SpriteID RailTypeInfo::build_ns_rail |
button for building single rail in N-S direction
Definition at line 153 of file rail.h.
Referenced by BuildRailToolbarWindow::OnInit().
SpriteID RailTypeInfo::build_tunnel |
button for building a tunnel
Definition at line 159 of file rail.h.
Referenced by BuildRailToolbarWindow::OnInit().
SpriteID RailTypeInfo::build_x_rail |
button for building single rail in X direction
Definition at line 154 of file rail.h.
Referenced by GetRailTypeDropDownList(), and BuildRailToolbarWindow::OnInit().
SpriteID RailTypeInfo::build_y_rail |
button for building single rail in Y direction
Definition at line 156 of file rail.h.
Referenced by BuildRailToolbarWindow::OnInit().
RailTypes RailTypeInfo::compatible_railtypes |
bitmask to the OTHER railtypes on which an engine of THIS railtype can physically travel
Definition at line 191 of file rail.h.
Referenced by AllocateRailType(), CheckAutoreplaceValidity(), FollowTrainReservation(), FreeTrainTrackReservation(), GetTrainForReservation(), IsSafeWaitingPosition(), IsWaitingPositionFree(), and RailTypeChangeInfo().
CursorID RailTypeInfo::convert |
Cursor for converting track.
Definition at line 172 of file rail.h.
Referenced by BuildRailToolbarWindow::OnClick().
SpriteID RailTypeInfo::convert_rail |
button for converting rail
Definition at line 160 of file rail.h.
Referenced by BuildRailToolbarWindow::OnInit().
uint16_t RailTypeInfo::cost_multiplier |
Cost multiplier for building this rail type.
Definition at line 216 of file rail.h.
Referenced by ParamSet(), and RailTypeChangeInfo().
SpriteID RailTypeInfo::crossing |
level crossing, rail in X direction
Definition at line 144 of file rail.h.
Referenced by DrawTile_Road().
uint8_t RailTypeInfo::curve_speed |
Multiplier for curve maximum speed advantage.
Definition at line 206 of file rail.h.
Referenced by Train::GetCurveSpeedLimit(), and RailTypeChangeInfo().
CursorID RailTypeInfo::depot |
Cursor for building a depot.
Definition at line 170 of file rail.h.
Referenced by BuildRailToolbarWindow::OnClick().
uint8_t RailTypeInfo::fallback_railtype |
Original railtype number to use when drawing non-newgrf railtypes, or when drawing stations.
Definition at line 201 of file rail.h.
Referenced by DrawStationTile(), GetRailtypeSpriteOffset(), and RailTypeChangeInfo().
RailTypeFlags RailTypeInfo::flags |
Bit mask of rail type flags.
Definition at line 211 of file rail.h.
Referenced by InitRailTypes(), Rail90DegTurnDisallowed(), and RailTypeChangeInfo().
const GRFFile* RailTypeInfo::grffile[RTSG_END] |
SpriteID RailTypeInfo::ground |
ground sprite for a 3-way switch
Definition at line 136 of file rail.h.
Referenced by DrawTrackBits().
const SpriteGroup* RailTypeInfo::group[RTSG_END] |
Sprite groups for resolving sprites.
Definition at line 281 of file rail.h.
Referenced by GetCustomRailSprite(), GetCustomSignalSprite(), and RailTypeResolverObject::RailTypeResolverObject().
struct { ... } RailTypeInfo::gui_sprites |
struct containing the sprites for the rail GUI.
Referenced by BuildSignalWindow::DrawWidget(), GetRailTypeDropDownList(), BuildRailToolbarWindow::OnInit(), and BuildSignalWindow::OnInit().
RailTypes RailTypeInfo::introduces_railtypes |
Bitmask of which other railtypes are introduced when this railtype is introduced.
Definition at line 266 of file rail.h.
Referenced by AddDateIntroducedRailTypes(), AllocateRailType(), GetCompanyRailTypes(), GetRailTypes(), NewVehicleAvailable(), and RailTypeChangeInfo().
TimerGameCalendar::Date RailTypeInfo::introduction_date |
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_railtypes.
Definition at line 255 of file rail.h.
Referenced by AddDateIntroducedRailTypes(), and RailTypeChangeInfo().
RailTypes RailTypeInfo::introduction_required_railtypes |
Bitmask of railtypes that are required for this railtype to be introduced at a given introduction_date.
Definition at line 261 of file rail.h.
Referenced by AddDateIntroducedRailTypes(), and RailTypeChangeInfo().
RailTypeLabel RailTypeInfo::label |
Unique 32 bit rail type identifier.
Definition at line 236 of file rail.h.
Referenced by AddDateIntroducedRailTypes(), AllocateRailType(), RailTypeResolverObject::GetDebugID(), GetNewEngine(), GetRailTypeByLabel(), GetReverseRailTypeTranslation(), ResetNewGRFData(), RAILChunkHandler::Save(), and SetCurrentLabelLists().
uint16_t RailTypeInfo::maintenance_multiplier |
Cost multiplier for maintenance of this rail type.
Definition at line 221 of file rail.h.
Referenced by RailTypeChangeInfo().
uint8_t RailTypeInfo::map_colour |
uint16_t RailTypeInfo::max_speed |
Maximum speed for vehicles travelling on this rail type.
Definition at line 231 of file rail.h.
Referenced by Train::GetMaxTrackSpeed(), GetRailTypeDropDownList(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSpeedLimit(), RailTypeChangeInfo(), and BuildRailToolbarWindow::SetStringParameters().
StringID RailTypeInfo::menu_text |
Name of this rail type in the main toolbar dropdown.
Definition at line 178 of file rail.h.
Referenced by GetRailTypeDropDownList(), and RailTypeChangeInfo().
StringID RailTypeInfo::name |
Name of this rail type.
Definition at line 176 of file rail.h.
Referenced by CompanyInfrastructureWindow::DrawWidget(), RailTypeChangeInfo(), and CompanyInfrastructureWindow::UpdateWidgetSize().
StringID RailTypeInfo::new_loco |
Name of an engine for this type of rail in the engine preview GUI.
Definition at line 181 of file rail.h.
Referenced by GetEngineCategoryName(), and RailTypeChangeInfo().
RailTypes RailTypeInfo::powered_railtypes |
bitmask to the OTHER railtypes on which an engine of THIS railtype generates power
Definition at line 188 of file rail.h.
Referenced by AllocateRailType(), Train::ConsistChanged(), and RailTypeChangeInfo().
CursorID RailTypeInfo::rail_ew |
Cursor for building rail in E-W direction.
Definition at line 167 of file rail.h.
Referenced by BuildRailToolbarWindow::OnClick().
CursorID RailTypeInfo::rail_ns |
Cursor for building rail in N-S direction.
Definition at line 165 of file rail.h.
Referenced by BuildRailToolbarWindow::OnClick().
CursorID RailTypeInfo::rail_nwse |
Cursor for building rail in Y direction.
Definition at line 168 of file rail.h.
Referenced by BuildRailToolbarWindow::OnClick().
CursorID RailTypeInfo::rail_swne |
Cursor for building rail in X direction.
Definition at line 166 of file rail.h.
Referenced by BuildRailToolbarWindow::OnClick().
StringID RailTypeInfo::replace_text |
Text used in the autoreplace GUI.
Definition at line 180 of file rail.h.
Referenced by GetRailTypeDropDownList(), RailTypeChangeInfo(), ReplaceVehicleWindow::SetStringParameters(), and ReplaceVehicleWindow::UpdateWidgetSize().
SpriteID RailTypeInfo::signals[SIGTYPE_END][2][2] |
signal GUI sprites (type, variant, state)
Definition at line 161 of file rail.h.
Referenced by BuildSignalWindow::DrawWidget(), and BuildSignalWindow::OnInit().
SpriteID RailTypeInfo::single_e |
single piece of rail in the eastern corner
Definition at line 141 of file rail.h.
Referenced by DrawTrackBits().
SpriteID RailTypeInfo::single_n |
single piece of rail in the northern corner
Definition at line 139 of file rail.h.
Referenced by DrawTrackBits().
SpriteID RailTypeInfo::single_s |
single piece of rail in the southern corner
Definition at line 140 of file rail.h.
Referenced by DrawTrackBits().
SpriteID RailTypeInfo::single_sloped |
single piece of rail for slopes
Definition at line 143 of file rail.h.
Referenced by DrawTile_TunnelBridge(), and DrawTrackBits().
SpriteID RailTypeInfo::single_w |
single piece of rail in the western corner
Definition at line 142 of file rail.h.
Referenced by DrawTrackBits().
SpriteID RailTypeInfo::single_x |
single piece of rail in X direction, without ground
Definition at line 137 of file rail.h.
Referenced by DrawBridgeMiddle(), DrawTile_Road(), DrawTile_TunnelBridge(), and DrawTrackBits().
SpriteID RailTypeInfo::single_y |
single piece of rail in Y direction, without ground
Definition at line 138 of file rail.h.
Referenced by DrawBridgeMiddle(), DrawTile_Road(), DrawTile_TunnelBridge(), and DrawTrackBits().
SpriteID RailTypeInfo::snow_offset |
sprite number difference between a piece of track on a snowy ground and the corresponding one on normal ground
Definition at line 185 of file rail.h.
Referenced by DrawTrackBits().
uint8_t RailTypeInfo::sorting_order |
The sorting order of this railtype for the toolbar dropdown.
Definition at line 271 of file rail.h.
Referenced by AllocateRailType(), CompareRailTypes(), and RailTypeChangeInfo().
StringID RailTypeInfo::toolbar_caption |
Caption in the construction toolbar GUI for this rail type.
Definition at line 177 of file rail.h.
Referenced by RailTypeChangeInfo(), and BuildRailToolbarWindow::SetStringParameters().
SpriteID RailTypeInfo::track_ns |
two pieces of rail in North and South corner (East-West direction)
Definition at line 135 of file rail.h.
Referenced by DrawTrackBits().
SpriteID RailTypeInfo::track_y |
single piece of rail in Y direction, with ground
Definition at line 134 of file rail.h.
Referenced by DrawTrackBits().
SpriteID RailTypeInfo::tunnel |
tunnel sprites base
Definition at line 145 of file rail.h.
Referenced by DrawTile_TunnelBridge(), and BuildRailToolbarWindow::OnClick().