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