OpenTTD Source  1.11.0-beta2
gamelog_internal.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef GAMELOG_INTERNAL_H
11 #define GAMELOG_INTERNAL_H
12 
13 #include "gamelog.h"
14 
29  GLCT_NONE = 0xFF,
30 };
31 
32 
33 static const uint GAMELOG_REVISION_LENGTH = 15;
34 
36 struct LoggedChange {
38  union {
39  struct {
40  byte mode;
41  byte landscape;
42  } mode;
43  struct {
44  char text[GAMELOG_REVISION_LENGTH];
45  uint32 newgrf;
46  uint16 slver;
47  byte modified;
48  } revision;
49  struct {
50  uint32 type;
51  uint32 version;
52  } oldver;
54  struct {
55  uint32 grfid;
56  } grfrem;
58  struct {
59  uint32 grfid;
60  } grfparam;
61  struct {
62  uint32 grfid;
63  int32 offset;
64  } grfmove;
65  struct {
66  char *name;
67  int32 oldval;
68  int32 newval;
69  } setting;
70  struct {
71  uint64 data;
72  uint32 grfid;
73  byte bug;
74  } grfbug;
75  };
76 };
77 
78 
80 struct LoggedAction {
82  uint32 changes;
84  uint16 tick;
85 };
86 
88 extern uint _gamelog_actions;
89 
90 #endif /* GAMELOG_INTERNAL_H */
GLCT_GRFBUG
@ GLCT_GRFBUG
GRF bug triggered.
Definition: gamelog_internal.h:26
LoggedChange::newgrf
uint32 newgrf
_openttd_newgrf_version
Definition: gamelog_internal.h:45
LoggedChange::name
char * name
name of the setting
Definition: gamelog_internal.h:66
GLCT_END
@ GLCT_END
So we know how many GLCTs are there.
Definition: gamelog_internal.h:28
GLCT_EMERGENCY
@ GLCT_EMERGENCY
Emergency savegame.
Definition: gamelog_internal.h:27
LoggedChange::mode
byte mode
new game mode - Editor x Game
Definition: gamelog_internal.h:40
LoggedChange::offset
int32 offset
offset, positive = move down
Definition: gamelog_internal.h:63
LoggedChange::type
uint32 type
type of savegame,
Definition: gamelog_internal.h:50
GLCT_REVISION
@ GLCT_REVISION
Changed game revision string.
Definition: gamelog_internal.h:18
LoggedAction::tick
uint16 tick
Tick when it happened.
Definition: gamelog_internal.h:84
LoggedAction::at
GamelogActionType at
Type of action.
Definition: gamelog_internal.h:83
GLCT_GRFREM
@ GLCT_GRFREM
Added GRF.
Definition: gamelog_internal.h:22
GLCT_GRFPARAM
@ GLCT_GRFPARAM
GRF parameter changed.
Definition: gamelog_internal.h:24
GLCT_GRFADD
@ GLCT_GRFADD
Removed GRF.
Definition: gamelog_internal.h:21
gamelog.h
LoggedChange::slver
uint16 slver
_sl_version
Definition: gamelog_internal.h:46
LoggedChange::landscape
byte landscape
landscape (temperate, arctic, ...)
Definition: gamelog_internal.h:41
GamelogActionType
GamelogActionType
The actions we log.
Definition: gamelog.h:16
GLCT_NONE
@ GLCT_NONE
In savegames, end of list.
Definition: gamelog_internal.h:29
GRFIdentifier
Basic data to distinguish a GRF.
Definition: newgrf_config.h:83
LoggedAction::changes
uint32 changes
Number of changes in this action.
Definition: gamelog_internal.h:82
LoggedChange::modified
byte modified
_openttd_revision_modified
Definition: gamelog_internal.h:47
GLCT_OLDVER
@ GLCT_OLDVER
Loaded from savegame without logged data.
Definition: gamelog_internal.h:19
_gamelog_action
LoggedAction * _gamelog_action
first logged action
Definition: gamelog.cpp:35
LoggedChange::data
uint64 data
additional data
Definition: gamelog_internal.h:71
GLCT_MODE
@ GLCT_MODE
Scenario editor x Game, different landscape.
Definition: gamelog_internal.h:17
GLCT_GRFMOVE
@ GLCT_GRFMOVE
GRF order changed.
Definition: gamelog_internal.h:25
GamelogChangeType
GamelogChangeType
Type of logged change.
Definition: gamelog_internal.h:16
LoggedAction::change
LoggedChange * change
First logged change in this action.
Definition: gamelog_internal.h:81
LoggedChange::grfid
uint32 grfid
ID of removed GRF.
Definition: gamelog_internal.h:55
LoggedChange::bug
byte bug
type of bug,
Definition: gamelog_internal.h:73
LoggedChange::ct
GamelogChangeType ct
Type of change logged in this struct.
Definition: gamelog_internal.h:37
GLCT_GRFCOMPAT
@ GLCT_GRFCOMPAT
Loading compatible GRF.
Definition: gamelog_internal.h:23
LoggedChange::grfadd
GRFIdentifier grfadd
ID and md5sum of added GRF.
Definition: gamelog_internal.h:53
LoggedChange::grfcompat
GRFIdentifier grfcompat
ID and new md5sum of changed GRF.
Definition: gamelog_internal.h:57
LoggedChange::oldval
int32 oldval
old value
Definition: gamelog_internal.h:67
_gamelog_actions
uint _gamelog_actions
number of actions
Definition: gamelog.cpp:36
LoggedChange::text
char text[GAMELOG_REVISION_LENGTH]
revision string, _openttd_revision
Definition: gamelog_internal.h:44
GLCT_SETTING
@ GLCT_SETTING
Non-networksafe setting value changed.
Definition: gamelog_internal.h:20
LoggedChange
Contains information about one logged change.
Definition: gamelog_internal.h:36
LoggedAction
Contains information about one logged action that caused at least one logged change.
Definition: gamelog_internal.h:80
LoggedChange::version
uint32 version
major and minor version OR ttdp version
Definition: gamelog_internal.h:51
LoggedChange::newval
int32 newval
new value
Definition: gamelog_internal.h:68