12 #include "../stdafx.h" 13 #include "../gamelog_internal.h" 18 #include "../safeguards.h" 20 static const SaveLoad _glog_action_desc[] = {
25 static const SaveLoad _glog_mode_desc[] = {
31 static const SaveLoad _glog_revision_desc[] = {
39 static const SaveLoad _glog_oldver_desc[] = {
45 static const SaveLoad _glog_setting_desc[] = {
52 static const SaveLoad _glog_grfadd_desc[] = {
58 static const SaveLoad _glog_grfrem_desc[] = {
63 static const SaveLoad _glog_grfcompat_desc[] = {
69 static const SaveLoad _glog_grfparam_desc[] = {
74 static const SaveLoad _glog_grfmove_desc[] = {
80 static const SaveLoad _glog_grfbug_desc[] = {
87 static const SaveLoad _glog_emergency_desc[] = {
91 static const SaveLoad *
const _glog_desc[] = {
102 _glog_emergency_desc,
107 static void Load_GLOG_common(
LoggedAction *&gamelog_action, uint &gamelog_actions)
109 assert(gamelog_action == NULL);
110 assert(gamelog_actions == 0);
114 gamelog_action =
ReallocT(gamelog_action, gamelog_actions + 1);
129 memset(lc, 0,
sizeof(*lc));
139 static void Save_GLOG()
147 assert((uint)lc->ct <
lengthof(_glog_desc));
171 static void Load_GLOG()
176 static void Check_GLOG()
182 {
'GLOG', Save_GLOG, Load_GLOG, NULL, Check_GLOG, CH_RIFF |
CH_LAST }
byte modified
_openttd_revision_modified
GamelogChangeType ct
Type of change logged in this struct.
struct LoggedAction * gamelog_action
Gamelog actions.
In savegames, end of list.
uint32 changes
Number of changes in this action.
uint32 grfid
ID of removed GRF.
#define SLE_ARR(base, variable, type, length)
Storage of an array in every version of a savegame.
So we know how many GLCTs are there.
uint _gamelog_actions
number of actions
GamelogActionType
The actions we log.
uint32 newgrf
_openttd_newgrf_version
LoadCheckData _load_check_data
Data loaded from save during SL_LOAD_CHECK.
uint32 type
type of savegame,
Functions/types related to saving and loading games.
Contains information about one logged action that caused at least one logged change.
char text[NETWORK_REVISION_LENGTH]
revision string, _openttd_revision
size_t SlCalcObjLength(const void *object, const SaveLoad *sld)
Calculate the size of an object.
byte mode
new game mode - Editor x Game
uint32 version
major and minor version OR ttdp version
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.
byte SlReadByte()
Wrapper for reading a byte from the buffer.
Handlers and description of chunk.
char * name
name of the setting
LoggedAction * _gamelog_action
first logged action
#define SLE_END()
End marker of a struct/class save or load.
GamelogActionType at
Type of action.
GamelogChangeType
Type of logged change.
LoggedChange * change
First logged change in this action.
Contains information about one logged change.
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
uint gamelog_actions
Number of gamelog actions.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
byte landscape
landscape (temperate, arctic, ...)
No logging active; in savegames, end of list.
#define SLE_STR(base, variable, type, length)
Storage of a string in every savegame version.
void SlSetLength(size_t length)
Sets the length of either a RIFF object or the number of items in an array.
int32 offset
offset, positive = move down
uint64 data
additional data
static const uint NETWORK_REVISION_LENGTH
The maximum length of the revision, in bytes including '\0'.
void SlWriteByte(byte b)
Wrapper for writing a byte to the dumper.
Last chunk in this array.