OpenTTD Source  20240919-master-gdf0233f4c2
newgrf_sl.cpp File Reference
#include "../stdafx.h"
#include "saveload.h"
#include "compat/newgrf_sl_compat.h"
#include "newgrf_sl.h"
#include "../fios.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  NGRFChunkHandler
 

Functions

const ChunkHandlerTable _newgrf_chunk_handlers (newgrf_chunk_handlers)
 

Variables

static const SaveLoad _newgrf_mapping_desc []
 Save and load the mapping between a spec and the NewGRF it came from. More...
 
static const SaveLoad _grfconfig_desc []
 
static const NGRFChunkHandler NGRF
 
static const ChunkHandlerRef newgrf_chunk_handlers []
 

Detailed Description

Code handling saving and loading of newgrf config

Definition in file newgrf_sl.cpp.

Variable Documentation

◆ _grfconfig_desc

const SaveLoad _grfconfig_desc[]
static
Initial value:
= {
SLE_SSTR(GRFConfig, filename, SLE_STR),
SLE_VAR(GRFConfig, ident.grfid, SLE_UINT32),
SLE_ARR(GRFConfig, ident.md5sum, SLE_UINT8, 16),
SLE_CONDVAR(GRFConfig, version, SLE_UINT32, SLV_151, SL_MAX_VERSION),
SLE_ARR(GRFConfig, param, SLE_UINT32, 0x80),
SLE_VAR(GRFConfig, num_params, SLE_UINT8),
SLE_CONDVAR(GRFConfig, palette, SLE_UINT8, SLV_101, SL_MAX_VERSION),
}

Definition at line 65 of file newgrf_sl.cpp.

◆ _newgrf_mapping_desc

const SaveLoad _newgrf_mapping_desc[]
static
Initial value:
= {
SLE_VAR(EntityIDMapping, grfid, SLE_UINT32),
SLE_CONDVAR(EntityIDMapping, entity_id, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_EXTEND_ENTITY_MAPPING),
SLE_CONDVAR(EntityIDMapping, substitute_id, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_EXTEND_ENTITY_MAPPING),
}

Save and load the mapping between a spec and the NewGRF it came from.

Definition at line 21 of file newgrf_sl.cpp.

Referenced by NewGRFMappingChunkHandler::Load(), and NewGRFMappingChunkHandler::Save().

◆ newgrf_chunk_handlers

const ChunkHandlerRef newgrf_chunk_handlers[]
static
Initial value:
= {
NGRF,
}

Definition at line 129 of file newgrf_sl.cpp.

SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:31
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:857
SLE_ARR
#define SLE_ARR(base, variable, type, length)
Storage of fixed-size array of SL_VAR elements in every version of a savegame.
Definition: saveload.h:997
GRFConfig
Information about GRF, used in the game and (part of it) in savegames.
Definition: newgrf_config.h:147
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:391
EntityIDMapping
Maps an entity id stored on the map to a GRF file.
Definition: newgrf_commons.h:185
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:971
SLE_SSTR
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
Definition: saveload.h:1015
SLV_151
@ SLV_151
151 20918
Definition: saveload.h:224
SLV_EXTEND_ENTITY_MAPPING
@ SLV_EXTEND_ENTITY_MAPPING
311 PR#10672 Extend entity mapping range.
Definition: saveload.h:353
SLV_101
@ SLV_101
101 14233
Definition: saveload.h:164