OpenTTD Source: NGRFChunkHandler Struct Reference

OpenTTD Source 15.0-beta1

Public Member Functions | Static Public Attributes
NGRFChunkHandler Struct Reference
Inheritance diagram for NGRFChunkHandler:

## Public Member Functions
void | SaveParameters (const GRFConfig &config) const
void | Save () const override
| Save the chunk.
void | LoadParameters (GRFConfig &config) const
void | LoadCommon (GRFConfig *&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 (uint32_t id, ChunkType type)
virtual void | FixPointers () const
| Fix the pointers.
std::string | GetName () const

## 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
uint32_t | 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(), 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

  len | Number of bytes to skip.

Reimplemented from ChunkHandler.

Definition at line 139 of file newgrf_sl.cpp.

References _load_check_data, and LoadCheckData::grfconfig.

## ◆ LoadCommon()

void NGRFChunkHandler::LoadCommon | ( | GRFConfig *& | 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 CH_READONLY.

Reimplemented from ChunkHandler.

Definition at line 88 of file newgrf_sl.cpp.

References _grfconfig, GCF_INIT_ONLY, GCF_STATIC, HasBit(), GRFConfig::next, 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:
= {
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),
SLEG_ARR("param", param, SLE_UINT32, std::size(param)),
SLEG_VAR("num_params", num_params, SLE_UINT8),
SLE_CONDVAR(GRFConfig, palette, SLE_UINT8, SLV_101, SL_MAX_VERSION),
}
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:1028
SLEG_VAR
#define SLEG_VAR(name, variable, type)
Storage of a global variable in every savegame version.
Definition saveload.h:1186
SLEG_ARR
#define SLEG_ARR(name, variable, type, length)
Storage of a global fixed-size array of SL_VAR elements in every savegame version.
Definition saveload.h:1203
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:868
SLE_SSTR
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
Definition saveload.h:1046
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition saveload.h:399
SLV_151
@ SLV_151
151 20918
Definition saveload.h:224
SLV_101
@ SLV_101
101 14233
Definition saveload.h:164
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1002
GRFConfig
Information about GRF, used in the game and (part of it) in savegames.
Definition newgrf_config.h:154

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:

- src/saveload/newgrf_sl.cpp