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 }
}
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),
}
LoggedAction
Contains information about one logged action that caused at least one logged change.
Definition: gamelog_internal.h:81
SLE_VAR
#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),
}
LoggedChange::grfid
uint32 grfid
ID of removed GRF.
Definition: gamelog_internal.h:56
SLE_ARR
#define SLE_ARR(base, variable, type, length)
Storage of an array in every version of a savegame.
Definition: saveload.h:313
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#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),
}
LoggedChange::bug
byte bug
type of bug,
Definition: gamelog_internal.h:74
LoggedChange::grfid
uint32 grfid
ID of removed GRF.
Definition: gamelog_internal.h:56
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
LoggedChange::data
uint64 data
additional data
Definition: gamelog_internal.h:72

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),
}
LoggedChange::grfid
uint32 grfid
ID of removed GRF.
Definition: gamelog_internal.h:56
SLE_ARR
#define SLE_ARR(base, variable, type, length)
Storage of an array in every version of a savegame.
Definition: saveload.h:313
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#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),
}
LoggedChange::grfid
uint32 grfid
ID of removed GRF.
Definition: gamelog_internal.h:56
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
LoggedChange::offset
int32 offset
offset, positive = move down
Definition: gamelog_internal.h:64

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),
}
LoggedChange::grfid
uint32 grfid
ID of removed GRF.
Definition: gamelog_internal.h:56
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#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),
}
LoggedChange::grfid
uint32 grfid
ID of removed GRF.
Definition: gamelog_internal.h:56
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#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),
}
LoggedChange::mode
byte mode
new game mode - Editor x Game
Definition: gamelog_internal.h:41
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
LoggedChange::landscape
byte landscape
landscape (temperate, arctic, ...)
Definition: gamelog_internal.h:42

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),
}
LoggedChange::type
uint32 type
type of savegame,
Definition: gamelog_internal.h:51
LoggedChange::version
uint32 version
major and minor version OR ttdp version
Definition: gamelog_internal.h:52
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#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_ARR(LoggedChange, revision.text, SLE_UINT8, NETWORK_REVISION_LENGTH),
SLE_VAR(LoggedChange, revision.newgrf, SLE_UINT32),
SLE_VAR(LoggedChange, revision.slver, SLE_UINT16),
SLE_VAR(LoggedChange, revision.modified, SLE_UINT8),
}
LoggedChange::modified
byte modified
_openttd_revision_modified
Definition: gamelog_internal.h:48
SLE_ARR
#define SLE_ARR(base, variable, type, length)
Storage of an array in every version of a savegame.
Definition: saveload.h:313
LoggedChange::newgrf
uint32 newgrf
_openttd_newgrf_version
Definition: gamelog_internal.h:46
LoggedChange::text
char text[NETWORK_REVISION_LENGTH]
revision string, _openttd_revision
Definition: gamelog_internal.h:45
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
LoggedChange::slver
uint16 slver
_sl_version
Definition: gamelog_internal.h:47
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
NETWORK_REVISION_LENGTH
static const uint NETWORK_REVISION_LENGTH
The maximum length of the revision, in bytes including &#39;\0&#39;.
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),
}
LoggedChange::newval
int32 newval
new value
Definition: gamelog_internal.h:69
LoggedChange::name
char * name
name of the setting
Definition: gamelog_internal.h:67
LoggedChange::oldval
int32 oldval
old value
Definition: gamelog_internal.h:68
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:37
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
SLE_STR
#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.