OpenTTD Source 20260917-master-gec444f7315
NGRFChunkHandler Struct Reference
Inheritance diagram for NGRFChunkHandler:
ChunkHandler

Public Member Functions

void SaveParameters (const GRFConfig &config) const
void Save () const override
 Save the chunk.
void LoadParameters (GRFConfig &config) const
void LoadCommon (GRFConfigList &grfconfig) const
void Load () const override
 Load the chunk.
void LoadCheck (size_t) const override
 Load the chunk for game preview.
Public Member Functions inherited from ChunkHandler
 ChunkHandler (ChunkId id, ChunkType type)
 Create this ChunkHandler.
virtual ~ChunkHandler ()=default
 Ensure the destructor of the sub classes are called as well.
virtual void FixPointers () const
 Fix the pointers.
std::string GetName () const
 Get the name of this chunk.

Static Public Attributes

static std::array< uint32_t, GRFConfig::MAX_NUM_PARAMS > param
static uint8_t num_params
static const SaveLoad description []

Additional Inherited Members

Data Fields inherited from ChunkHandler
ChunkId id
 Unique ID (4 letters).
ChunkType type
 Type of the chunk.

Detailed Description

Definition at line 64 of file newgrf_sl.cpp.

Constructor & Destructor Documentation

◆ NGRFChunkHandler()

NGRFChunkHandler::NGRFChunkHandler ( )
inline

Definition at line 65 of file newgrf_sl.cpp.

Member Function Documentation

◆ Load()

void NGRFChunkHandler::Load ( ) const
inlineoverridevirtual

Load the chunk.

Must be overridden.

Implements ChunkHandler.

Definition at line 123 of file newgrf_sl.cpp.

References _grfconfig, AppendStaticGRFConfigs(), Menu, ResetGRFConfig(), and SlErrorCorrupt().

◆ LoadCheck()

void NGRFChunkHandler::LoadCheck ( size_t len) const
inlineoverridevirtual

Load the chunk for game preview.

Default implementation just skips the data.

Parameters
lenNumber of bytes to skip.

Reimplemented from ChunkHandler.

Definition at line 139 of file newgrf_sl.cpp.

References _load_check_data.

◆ LoadCommon()

void NGRFChunkHandler::LoadCommon ( GRFConfigList & grfconfig) const
inline

Definition at line 109 of file newgrf_sl.cpp.

◆ LoadParameters()

void NGRFChunkHandler::LoadParameters ( GRFConfig & config) const
inline

Definition at line 102 of file newgrf_sl.cpp.

◆ Save()

void NGRFChunkHandler::Save ( ) const
inlineoverridevirtual

Save the chunk.

Must be overridden, unless Chunk type is ChunkType::ReadOnly.

Reimplemented from ChunkHandler.

Definition at line 88 of file newgrf_sl.cpp.

References _grfconfig, SlObject(), and SlTableHeader().

◆ SaveParameters()

void NGRFChunkHandler::SaveParameters ( const GRFConfig & config) const
inline

Definition at line 80 of file newgrf_sl.cpp.

Field Documentation

◆ description

const SaveLoad NGRFChunkHandler::description[]
inlinestatic
Initial value:
= {
}
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
Definition saveload.h:754
#define SLE_GLOBAL_ADDRESS(variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a global...
Definition saveload.h:761
@ NewGRFPalette
Saveload version: 101, SVN revision: 14233 Store palette used by each of the NewGRFs.
Definition saveload.h:171
@ StoreNewGRFVersion
Saveload version: 151, SVN revision: 20918 Store the version of the used NewGRFs.
Definition saveload.h:231
Information about GRF, used in the game and (part of it) in savegames.
static SaveLoad Variable(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a variable in some savegame versions.
Definition saveload.h:926
static SaveLoad Array(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of an array in some savegame versions.
Definition saveload.h:1026
static SaveLoad String(std::string name, AddressFunction< T > address_func, StringValidationSettings string_validation_settings={}, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a string in some savegame versions.
Definition saveload.h:977

Definition at line 70 of file newgrf_sl.cpp.

◆ num_params

uint8_t NGRFChunkHandler::num_params
inlinestatic

Definition at line 68 of file newgrf_sl.cpp.

◆ param

std::array<uint32_t, GRFConfig::MAX_NUM_PARAMS> NGRFChunkHandler::param
inlinestatic

Definition at line 67 of file newgrf_sl.cpp.


The documentation for this struct was generated from the following file: