OpenTTD Source 20241224-master-gf74b0cf984
|
Handlers and description of chunk. More...
#include <saveload.h>
Public Member Functions | |
ChunkHandler (uint32_t id, ChunkType type) | |
virtual void | Save () const |
Save the chunk. | |
virtual void | Load () const =0 |
Load the chunk. | |
virtual void | FixPointers () const |
Fix the pointers. | |
virtual void | LoadCheck (size_t len=0) const |
Load the chunk for game preview. | |
std::string | GetName () const |
Data Fields | |
uint32_t | id |
Unique ID (4 letters). | |
ChunkType | type |
Type of the chunk. | |
Handlers and description of chunk.
Definition at line 463 of file saveload.h.
|
inline |
Definition at line 467 of file saveload.h.
|
inlinevirtual |
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 in ERNWChunkHandler, PLYRChunkHandler, DEPTChunkHandler, CAPYChunkHandler, INDYChunkHandler, LGRSChunkHandler, OBJSChunkHandler, ORDRChunkHandler, ORDLChunkHandler, BKORChunkHandler, STNSChunkHandler, STNNChunkHandler, ROADChunkHandler, CITYChunkHandler, VEHSChunkHandler, and CHKPChunkHandler.
Definition at line 489 of file saveload.h.
|
inline |
Definition at line 498 of file saveload.h.
|
pure virtual |
Load the chunk.
Must be overridden.
Implemented in AIPLChunkHandler, ANITChunkHandler, ERNWChunkHandler, CMDLChunkHandler, CMPUChunkHandler, CAPAChunkHandler, CHTSChunkHandler, PLYRChunkHandler, DEPTChunkHandler, PRICChunkHandler, CAPRChunkHandler, ECMYChunkHandler, CAPYChunkHandler, ENGNChunkHandler, ENGSChunkHandler, EIDSChunkHandler, GSDTChunkHandler, GSTRChunkHandler, GLOGChunkHandler, GOALChunkHandler, GRPSChunkHandler, INDYChunkHandler, IBLDChunkHandler, ITBLChunkHandler, RAILChunkHandler, ROTTChunkHandler, LEAEChunkHandler, LEATChunkHandler, LGRPChunkHandler, LGRJChunkHandler, LGRSChunkHandler, MAPSChunkHandler, MAPTChunkHandler, MAPHChunkHandler, MAPOChunkHandler, MAP2ChunkHandler, M3LOChunkHandler, M3HIChunkHandler, MAP5ChunkHandler, MAPEChunkHandler, MAP7ChunkHandler, MAP8ChunkHandler, DATEChunkHandler, VIEWChunkHandler, NGRFChunkHandler, NewGRFMappingChunkHandler, OBJSChunkHandler, ORDRChunkHandler, ORDLChunkHandler, BKORChunkHandler, SRNDChunkHandler, OPTSChunkHandler, PATSChunkHandler, SIGNChunkHandler, STNSChunkHandler, STNNChunkHandler, ROADChunkHandler, PSACChunkHandler, STPEChunkHandler, STPAChunkHandler, NAMEChunkHandler, SUBSChunkHandler, CITYChunkHandler, VEHSChunkHandler, WaterRegionChunkHandler, and CHKPChunkHandler.
Referenced by SlLoadChunk().
|
virtual |
Load the chunk for game preview.
Default implementation just skips the data.
len | Number of bytes to skip. |
Reimplemented in PLYRChunkHandler, GLOGChunkHandler, MAPSChunkHandler, DATEChunkHandler, NGRFChunkHandler, and PATSChunkHandler.
Definition at line 2012 of file saveload.cpp.
References _sl, SaveLoadParams::block_mode, SlSkipArray(), SlSkipBytes(), and SlTableHeader().
Referenced by SlLoadCheckChunk().
|
inlinevirtual |
Save the chunk.
Must be overridden, unless Chunk type is CH_READONLY.
Reimplemented in AIPLChunkHandler, ANITChunkHandler, ERNWChunkHandler, CMDLChunkHandler, CMPUChunkHandler, CAPAChunkHandler, CHTSChunkHandler, PLYRChunkHandler, DEPTChunkHandler, ECMYChunkHandler, CAPYChunkHandler, ENGNChunkHandler, EIDSChunkHandler, GSDTChunkHandler, GSTRChunkHandler, GLOGChunkHandler, GOALChunkHandler, GRPSChunkHandler, INDYChunkHandler, IBLDChunkHandler, ITBLChunkHandler, RAILChunkHandler, ROTTChunkHandler, LEAEChunkHandler, LEATChunkHandler, LGRPChunkHandler, LGRJChunkHandler, LGRSChunkHandler, MAPSChunkHandler, MAPTChunkHandler, MAPHChunkHandler, MAPOChunkHandler, MAP2ChunkHandler, M3LOChunkHandler, M3HIChunkHandler, MAP5ChunkHandler, MAPEChunkHandler, MAP7ChunkHandler, MAP8ChunkHandler, DATEChunkHandler, VIEWChunkHandler, NGRFChunkHandler, NewGRFMappingChunkHandler, OBJSChunkHandler, ORDRChunkHandler, ORDLChunkHandler, BKORChunkHandler, SRNDChunkHandler, PATSChunkHandler, SIGNChunkHandler, STNNChunkHandler, ROADChunkHandler, PSACChunkHandler, STPEChunkHandler, STPAChunkHandler, SUBSChunkHandler, CITYChunkHandler, and VEHSChunkHandler.
Definition at line 475 of file saveload.h.
Referenced by SlSaveChunk().
uint32_t ChunkHandler::id |
ChunkType ChunkHandler::type |
Type of the chunk.
Definition at line 465 of file saveload.h.
Referenced by SlSaveChunk().