OpenTTD
Functions | Variables
gamelog_sl.cpp File Reference

Code handling saving and loading of gamelog data. More...

#include "../stdafx.h"
#include "../gamelog_internal.h"
#include "../fios.h"
#include "saveload.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

 assert_compile (lengthof(_glog_desc)==GLCT_END)
 
static void Load_GLOG_common (LoggedAction *&gamelog_action, uint &gamelog_actions)
 
static void Save_GLOG ()
 
static void Load_GLOG ()
 
static void Check_GLOG ()
 

Variables

static const SaveLoad _glog_action_desc []
 
static const SaveLoad _glog_mode_desc []
 
static const SaveLoad _glog_revision_desc []
 
static const SaveLoad _glog_oldver_desc []
 
static const SaveLoad _glog_setting_desc []
 
static const SaveLoad _glog_grfadd_desc []
 
static const SaveLoad _glog_grfrem_desc []
 
static const SaveLoad _glog_grfcompat_desc []
 
static const SaveLoad _glog_grfparam_desc []
 
static const SaveLoad _glog_grfmove_desc []
 
static const SaveLoad _glog_grfbug_desc []
 
static const SaveLoad _glog_emergency_desc []
 
static const SaveLoad *const _glog_desc []
 
const ChunkHandler _gamelog_chunk_handlers []
 

Detailed Description

Code handling saving and loading of gamelog data.

Definition in file gamelog_sl.cpp.

Variable Documentation

◆ _gamelog_chunk_handlers

const ChunkHandler _gamelog_chunk_handlers[]
Initial value:
= {
{ 'GLOG', Save_GLOG, Load_GLOG, NULL, Check_GLOG, CH_RIFF | CH_LAST }
}
Last chunk in this array.
Definition: saveload.h:104

◆ _glog_action_desc

const SaveLoad _glog_action_desc[]
static
Initial value:
= {
SLE_VAR(LoggedAction, tick, SLE_UINT16),
}
Contains information about one logged action that caused at least one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 20 of file gamelog_sl.cpp.

◆ _glog_desc

const SaveLoad* const _glog_desc[]
static
Initial value:
= {
_glog_mode_desc,
_glog_revision_desc,
_glog_oldver_desc,
_glog_setting_desc,
_glog_grfadd_desc,
_glog_grfrem_desc,
_glog_grfcompat_desc,
_glog_grfparam_desc,
_glog_grfmove_desc,
_glog_grfbug_desc,
_glog_emergency_desc,
}

Definition at line 91 of file gamelog_sl.cpp.

◆ _glog_emergency_desc

const SaveLoad _glog_emergency_desc[]
static
Initial value:
= {
}

Definition at line 87 of file gamelog_sl.cpp.

◆ _glog_grfadd_desc

const SaveLoad _glog_grfadd_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, grfadd.grfid, SLE_UINT32 ),
SLE_ARR(LoggedChange, grfadd.md5sum, SLE_UINT8, 16),
}
uint32 grfid
ID of removed GRF.
#define SLE_ARR(base, variable, type, length)
Storage of an array in every version of a savegame.
Definition: saveload.h:313
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 52 of file gamelog_sl.cpp.

◆ _glog_grfbug_desc

const SaveLoad _glog_grfbug_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, grfbug.data, SLE_UINT64),
SLE_VAR(LoggedChange, grfbug.grfid, SLE_UINT32),
SLE_VAR(LoggedChange, grfbug.bug, SLE_UINT8),
}
byte bug
type of bug,
uint32 grfid
ID of removed GRF.
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
uint64 data
additional data

Definition at line 80 of file gamelog_sl.cpp.

◆ _glog_grfcompat_desc

const SaveLoad _glog_grfcompat_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, grfcompat.grfid, SLE_UINT32 ),
SLE_ARR(LoggedChange, grfcompat.md5sum, SLE_UINT8, 16),
}
uint32 grfid
ID of removed GRF.
#define SLE_ARR(base, variable, type, length)
Storage of an array in every version of a savegame.
Definition: saveload.h:313
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 63 of file gamelog_sl.cpp.

◆ _glog_grfmove_desc

const SaveLoad _glog_grfmove_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, grfmove.grfid, SLE_UINT32),
SLE_VAR(LoggedChange, grfmove.offset, SLE_INT32),
}
uint32 grfid
ID of removed GRF.
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
int32 offset
offset, positive = move down

Definition at line 74 of file gamelog_sl.cpp.

◆ _glog_grfparam_desc

const SaveLoad _glog_grfparam_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, grfparam.grfid, SLE_UINT32),
}
uint32 grfid
ID of removed GRF.
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 69 of file gamelog_sl.cpp.

◆ _glog_grfrem_desc

const SaveLoad _glog_grfrem_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, grfrem.grfid, SLE_UINT32),
}
uint32 grfid
ID of removed GRF.
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 58 of file gamelog_sl.cpp.

◆ _glog_mode_desc

const SaveLoad _glog_mode_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, mode.mode, SLE_UINT8),
SLE_VAR(LoggedChange, mode.landscape, SLE_UINT8),
}
byte mode
new game mode - Editor x Game
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
byte landscape
landscape (temperate, arctic, ...)

Definition at line 25 of file gamelog_sl.cpp.

◆ _glog_oldver_desc

const SaveLoad _glog_oldver_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, oldver.type, SLE_UINT32),
SLE_VAR(LoggedChange, oldver.version, SLE_UINT32),
}
uint32 type
type of savegame,
uint32 version
major and minor version OR ttdp version
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 39 of file gamelog_sl.cpp.

◆ _glog_revision_desc

const SaveLoad _glog_revision_desc[]
static
Initial value:
= {
SLE_VAR(LoggedChange, revision.newgrf, SLE_UINT32),
SLE_VAR(LoggedChange, revision.slver, SLE_UINT16),
SLE_VAR(LoggedChange, revision.modified, SLE_UINT8),
}
byte modified
_openttd_revision_modified
#define SLE_ARR(base, variable, type, length)
Storage of an array in every version of a savegame.
Definition: saveload.h:313
uint32 newgrf
_openttd_newgrf_version
char text[NETWORK_REVISION_LENGTH]
revision string, _openttd_revision
Contains information about one logged change.
uint16 slver
_sl_version
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
static const uint NETWORK_REVISION_LENGTH
The maximum length of the revision, in bytes including '\0'.
Definition: config.h:46

Definition at line 31 of file gamelog_sl.cpp.

◆ _glog_setting_desc

const SaveLoad _glog_setting_desc[]
static
Initial value:
= {
SLE_STR(LoggedChange, setting.name, SLE_STR, 128),
SLE_VAR(LoggedChange, setting.oldval, SLE_INT32),
SLE_VAR(LoggedChange, setting.newval, SLE_INT32),
}
int32 newval
new value
char * name
name of the setting
int32 oldval
old value
Contains information about one logged change.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
#define SLE_STR(base, variable, type, length)
Storage of a string in every savegame version.
Definition: saveload.h:322

Definition at line 45 of file gamelog_sl.cpp.