OpenTTD Source 20241224-master-gee860a5c8e
OBJSChunkHandler Struct Reference
Inheritance diagram for OBJSChunkHandler:
ChunkHandler

Public Member Functions

void Save () const override
 Save the chunk.
 
void Load () const override
 Load the chunk.
 
void FixPointers () const override
 Fix the pointers.
 
- Public Member Functions inherited from ChunkHandler
 ChunkHandler (uint32_t id, ChunkType type)
 
virtual void LoadCheck (size_t len=0) const
 Load the chunk for game preview.
 
std::string GetName () const
 

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 32 of file object_sl.cpp.

Constructor & Destructor Documentation

◆ OBJSChunkHandler()

OBJSChunkHandler::OBJSChunkHandler ( )
inline

Definition at line 33 of file object_sl.cpp.

Member Function Documentation

◆ FixPointers()

void OBJSChunkHandler::FixPointers ( ) const
inlineoverridevirtual

Fix the pointers.

Pointers are saved using the index of the pointed object. On load, pointers are filled with indices and need to be fixed to point to the real object. Must be overridden if the chunk saves any pointer.

Reimplemented from ChunkHandler.

Definition at line 57 of file object_sl.cpp.

References IsSavegameVersionBefore(), IsTileType(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_object_pool >::Iterate(), MP_OBJECT, SlObject(), and SLV_148.

◆ Load()

void OBJSChunkHandler::Load ( ) const
inlineoverridevirtual

Load the chunk.

Must be overridden.

Implements ChunkHandler.

Definition at line 46 of file object_sl.cpp.

References _object_sl_compat, SlCompatTableHeader(), SlIterateArray(), and SlObject().

◆ Save()

void OBJSChunkHandler::Save ( ) const
inlineoverridevirtual

Save the chunk.

Must be overridden, unless Chunk type is CH_READONLY.

Reimplemented from ChunkHandler.

Definition at line 35 of file object_sl.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_object_pool >::Iterate(), SlObject(), and SlTableHeader().


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