OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
16 #include "../station_map.h"
17 #include "../tunnelbridge_map.h"
19 #include "../safeguards.h"
21 static std::vector<RailTypeLabel> _railtype_list;
30 for (uint i = 0; i < _railtype_list.size(); i++) {
33 if (rti->
label != _railtype_list[i])
return true;
35 if (_railtype_list[i] != 0)
return true;
43 void AfterLoadLabelMaps()
46 std::vector<RailType> railtype_conversion_map;
48 for (uint i = 0; i < _railtype_list.size(); i++) {
52 railtype_conversion_map.push_back(r);
90 _railtype_list.clear();
98 static const SaveLoad _label_object_desc[] = {
129 _railtype_list.push_back((RailTypeLabel)lo.label);
139 extern const ChunkHandlerTable _labelmaps_chunk_handlers(labelmaps_chunk_handlers);
@ INVALID_RAILTYPE
Flag for invalid railtype.
const RailTypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
RailType
Enumeration for all possible railtypes.
This struct contains all the info that is needed to draw and construct tracks.
bool IsLevelCrossing(Tile t)
Return whether a tile is a level crossing.
@ RAILTYPE_END
Used for iterations.
Handlers and description of chunk.
RailType GetRailType(Tile t)
Gets the rail type of the given tile.
@ MP_ROAD
A tile with road (or tram tracks)
const SaveLoadCompat _label_object_sl_compat[]
Original field order for _label_object_desc.
static debug_inline TileType GetTileType(Tile tile)
Get the tiletype of a given tile.
@ RAILTYPE_BEGIN
Used for iterations.
Container for a label for SaveLoad system.
RailTypeLabel label
Unique 32 bit rail type identifier.
void Load() const override
Load the chunk.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
static bool NeedRailTypeConversion()
Test if any saved rail type labels are different to the currently loaded rail types,...
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
@ TRANSPORT_RAIL
Transport by train.
static debug_inline uint Size()
Get the size of the map.
bool HasStationRail(Tile t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
void SetRailType(Tile t, RailType r)
Sets the rail type of the given tile.
@ MP_STATION
A tile of a station.
TransportType GetTunnelBridgeTransportType(Tile t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
void Save() const override
Save the chunk.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
Get the rail type for a given label.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.