Go to the documentation of this file.
10 #include "../stdafx.h"
11 #include "../gamelog_internal.h"
16 #include "../safeguards.h"
18 static const SaveLoad _glog_action_desc[] = {
23 static const SaveLoad _glog_mode_desc[] = {
29 static const SaveLoad _glog_revision_desc[] = {
37 static const SaveLoad _glog_oldver_desc[] = {
43 static const SaveLoad _glog_setting_desc[] = {
50 static const SaveLoad _glog_grfadd_desc[] = {
56 static const SaveLoad _glog_grfrem_desc[] = {
61 static const SaveLoad _glog_grfcompat_desc[] = {
67 static const SaveLoad _glog_grfparam_desc[] = {
72 static const SaveLoad _glog_grfmove_desc[] = {
78 static const SaveLoad _glog_grfbug_desc[] = {
85 static const SaveLoad _glog_emergency_desc[] = {
89 static const SaveLoad *
const _glog_desc[] = {
100 _glog_emergency_desc,
105 static void Load_GLOG_common(
LoggedAction *&gamelog_action, uint &gamelog_actions)
107 assert(gamelog_action ==
nullptr);
108 assert(gamelog_actions == 0);
115 gamelog_action =
ReallocT(gamelog_action, gamelog_actions + 1);
132 memset(lc, 0,
sizeof(*lc));
140 static void Save_GLOG()
148 assert((uint)lc->ct <
lengthof(_glog_desc));
172 static void Load_GLOG()
177 static void Check_GLOG()
183 {
'GLOG', Save_GLOG, Load_GLOG,
nullptr, Check_GLOG, CH_RIFF |
CH_LAST }
uint32 newgrf
_openttd_newgrf_version
char * name
name of the setting
@ GLCT_END
So we know how many GLCTs are there.
byte mode
new game mode - Editor x Game
int32 offset
offset, positive = move down
struct LoggedAction * gamelog_action
Gamelog actions.
uint32 type
type of savegame,
uint _gamelog_actions
number of actions
LoadCheckData _load_check_data
Data loaded from save during SL_LOAD_CHECK.
#define SLE_STR(base, variable, type, length)
Storage of a string in every savegame version.
@ CH_LAST
Last chunk in this array.
GamelogActionType at
Type of action.
Handlers and description of chunk.
byte landscape
landscape (temperate, arctic, ...)
void SlSetLength(size_t length)
Sets the length of either a RIFF object or the number of items in an array.
#define SLE_ARR(base, variable, type, length)
Storage of an array in every version of a savegame.
@ GLCT_NONE
In savegames, end of list.
GamelogActionType
The actions we log.
uint32 changes
Number of changes in this action.
void SlWriteByte(byte b)
Wrapper for writing a byte to the dumper.
uint gamelog_actions
Number of gamelog actions.
#define SLE_END()
End marker of a struct/class save or load.
byte modified
_openttd_revision_modified
uint64 data
additional data
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
GamelogChangeType
Type of logged change.
LoggedChange * change
First logged change in this action.
LoggedAction * _gamelog_action
first logged action
uint32 grfid
ID of removed GRF.
size_t SlCalcObjLength(const void *object, const SaveLoad *sld)
Calculate the size of an object.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
GamelogChangeType ct
Type of change logged in this struct.
@ GLAT_END
So we know how many GLATs are there.
void NORETURN SlErrorCorrupt(const char *msg)
Error handler for corrupt savegames.
@ GLAT_NONE
No logging active; in savegames, end of list.
byte SlReadByte()
Wrapper for reading a byte from the buffer.
static T * ReallocT(T *t_ptr, size_t num_elements)
Simplified reallocation function that allocates the specified number of elements of the given type.
#define lengthof(x)
Return the length of an fixed size array.
char text[GAMELOG_REVISION_LENGTH]
revision string, _openttd_revision
Contains information about one logged change.
Contains information about one logged action that caused at least one logged change.
uint32 version
major and minor version OR ttdp version