OpenTTD Source 20241224-master-gf74b0cf984
|
Code handling saving and loading of rail type label mappings. More...
#include "../stdafx.h"
#include "saveload.h"
#include "compat/labelmaps_sl_compat.h"
#include "saveload_internal.h"
#include "../rail.h"
#include "../road.h"
#include "../station_map.h"
#include "../tunnelbridge_map.h"
#include "../safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | LabelObject< T > |
Container for a label for rail or road type conversion. More... | |
struct | RAILChunkHandler |
struct | ROTTChunkHandler |
Functions | |
static void | ConvertRailTypes () |
Test if any saved rail type labels are different to the currently loaded rail types. | |
static void | ConvertRoadTypes () |
Test if any saved road type labels are different to the currently loaded road types. | |
static void | SetCurrentLabelLists () |
Populate label lists with current values. | |
void | AfterLoadLabelMaps () |
Perform rail type and road type conversion if necessary. | |
void | ResetLabelMaps () |
const ChunkHandlerTable | _labelmaps_chunk_handlers (labelmaps_chunk_handlers) |
Variables | |
static std::vector< LabelObject< RailTypeLabel > > | _railtype_list |
static std::vector< LabelObject< RoadTypeLabel > > | _roadtype_list |
static const RAILChunkHandler | RAIL |
static const ROTTChunkHandler | ROTT |
static const ChunkHandlerRef | labelmaps_chunk_handlers [] |
Code handling saving and loading of rail type label mappings.
Definition in file labelmaps_sl.cpp.
void AfterLoadLabelMaps | ( | ) |
Perform rail type and road type conversion if necessary.
Definition at line 148 of file labelmaps_sl.cpp.
References ConvertRailTypes(), ConvertRoadTypes(), and SetCurrentLabelLists().
Referenced by AfterLoadGame(), and ReloadNewGRFData().
|
static |
Test if any saved rail type labels are different to the currently loaded rail types.
Rail types stored in the map will be converted if necessary.
Definition at line 37 of file labelmaps_sl.cpp.
References GetRailType(), GetRailTypeByLabel(), GetTileType(), GetTunnelBridgeTransportType(), HasStationRail(), INVALID_RAILTYPE, IsLevelCrossing(), Map::Iterate(), MP_RAILWAY, MP_ROAD, MP_STATION, MP_TUNNELBRIDGE, RAILTYPE_RAIL, SetRailType(), and TRANSPORT_RAIL.
Referenced by AfterLoadLabelMaps().
|
static |
Test if any saved road type labels are different to the currently loaded road types.
Road types stored in the map will be converted if necessary.
Definition at line 89 of file labelmaps_sl.cpp.
References GetRoadTypeByLabel(), GetTileType(), GetTunnelBridgeTransportType(), INVALID_ROADTYPE, IsRoadWaypoint(), IsStationRoadStop(), Map::Iterate(), MP_ROAD, MP_STATION, MP_TUNNELBRIDGE, ROADTYPE_ROAD, ROADTYPE_TRAM, SetRoadTypeRoad(), SetRoadTypeTram(), and TRANSPORT_ROAD.
Referenced by AfterLoadLabelMaps().
void ResetLabelMaps | ( | ) |
Definition at line 156 of file labelmaps_sl.cpp.
|
static |
Populate label lists with current values.
Definition at line 134 of file labelmaps_sl.cpp.
References GetRailTypeInfo(), GetRoadTypeInfo(), RailTypeInfo::label, RoadTypeInfo::label, RAILTYPE_BEGIN, RAILTYPE_END, ROADTYPE_BEGIN, and ROADTYPE_END.
Referenced by AfterLoadLabelMaps().
|
static |
Definition at line 30 of file labelmaps_sl.cpp.
|
static |
Definition at line 31 of file labelmaps_sl.cpp.
|
static |
Definition at line 238 of file labelmaps_sl.cpp.
|
static |
Definition at line 235 of file labelmaps_sl.cpp.
|
static |
Definition at line 236 of file labelmaps_sl.cpp.