OpenTTD
Data Structures | Functions | Variables
labelmaps_sl.cpp File Reference

Code handling saving and loading of rail type label mappings. More...

#include "../stdafx.h"
#include "../station_map.h"
#include "../tunnelbridge_map.h"
#include "saveload.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  LabelObject
 Container for a label for SaveLoad system. More...
 

Functions

static bool NeedRailTypeConversion ()
 Test if any saved rail type labels are different to the currently loaded rail types, which therefore requires conversion. More...
 
void AfterLoadLabelMaps ()
 
static void Save_RAIL ()
 
static void Load_RAIL ()
 

Variables

static SmallVector< RailTypeLabel, RAILTYPE_END_railtype_list
 
static const SaveLoad _label_object_desc []
 
const ChunkHandler _labelmaps_chunk_handlers []
 

Detailed Description

Code handling saving and loading of rail type label mappings.

Definition in file labelmaps_sl.cpp.

Function Documentation

◆ NeedRailTypeConversion()

static bool NeedRailTypeConversion ( )
static

Test if any saved rail type labels are different to the currently loaded rail types, which therefore requires conversion.

Returns
true if (and only if) conversion due to rail type changes is needed.

Definition at line 27 of file labelmaps_sl.cpp.

References GetRailTypeInfo(), RailtypeInfo::label, SmallVector< T, S >::Length(), and RAILTYPE_END.

Variable Documentation

◆ _label_object_desc

const SaveLoad _label_object_desc[]
static
Initial value:
= {
SLE_VAR(LabelObject, label, SLE_UINT32),
}
#define SLE_END()
End marker of a struct/class save or load.
Definition: saveload.h:353
Container for a label for SaveLoad system.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 92 of file labelmaps_sl.cpp.

◆ _labelmaps_chunk_handlers

const ChunkHandler _labelmaps_chunk_handlers[]
Initial value:
= {
{ 'RAIL', Save_RAIL, Load_RAIL, NULL, NULL, CH_ARRAY | CH_LAST},
}
Last chunk in this array.
Definition: saveload.h:104