OpenTTD Source  20241121-master-g67a0fccfad
labelmaps_sl.cpp File Reference

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. More...
 
static void ConvertRoadTypes ()
 Test if any saved road type labels are different to the currently loaded road types. More...
 
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 []
 

Detailed Description

Code handling saving and loading of rail type label mappings.

Definition in file labelmaps_sl.cpp.

Function Documentation

◆ ConvertRailTypes()

static void ConvertRailTypes ( )
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.

Referenced by AfterLoadLabelMaps().

◆ ConvertRoadTypes()

static void ConvertRoadTypes ( )
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.

Referenced by AfterLoadLabelMaps().

Variable Documentation

◆ labelmaps_chunk_handlers

const ChunkHandlerRef labelmaps_chunk_handlers[]
static
Initial value:
= {
RAIL,
ROTT,
}

Definition at line 238 of file labelmaps_sl.cpp.