Change: Only resort town directory window on population change if necessary
[openttd-github.git] / src / gamelog_internal.h
blob2b5c6ed0a17cab47d30ae7b18b7a2c21335082ce
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 */
8 /** @file gamelog_internal.h Declaration shared among gamelog.cpp and saveload/gamelog_sl.cpp */
10 #ifndef GAMELOG_INTERNAL_H
11 #define GAMELOG_INTERNAL_H
13 #include "gamelog.h"
15 /** Type of logged change */
16 enum GamelogChangeType {
17 GLCT_MODE, ///< Scenario editor x Game, different landscape
18 GLCT_REVISION, ///< Changed game revision string
19 GLCT_OLDVER, ///< Loaded from savegame without logged data
20 GLCT_SETTING, ///< Non-networksafe setting value changed
21 GLCT_GRFADD, ///< Removed GRF
22 GLCT_GRFREM, ///< Added GRF
23 GLCT_GRFCOMPAT, ///< Loading compatible GRF
24 GLCT_GRFPARAM, ///< GRF parameter changed
25 GLCT_GRFMOVE, ///< GRF order changed
26 GLCT_GRFBUG, ///< GRF bug triggered
27 GLCT_EMERGENCY, ///< Emergency savegame
28 GLCT_END, ///< So we know how many GLCTs are there
29 GLCT_NONE = 0xFF, ///< In savegames, end of list
33 static const uint GAMELOG_REVISION_LENGTH = 15;
35 /** Contains information about one logged change */
36 struct LoggedChange {
37 GamelogChangeType ct; ///< Type of change logged in this struct
38 union {
39 struct {
40 byte mode; ///< new game mode - Editor x Game
41 byte landscape; ///< landscape (temperate, arctic, ...)
42 } mode;
43 struct {
44 char text[GAMELOG_REVISION_LENGTH]; ///< revision string, _openttd_revision
45 uint32 newgrf; ///< _openttd_newgrf_version
46 uint16 slver; ///< _sl_version
47 byte modified; ///< _openttd_revision_modified
48 } revision;
49 struct {
50 uint32 type; ///< type of savegame, @see SavegameType
51 uint32 version; ///< major and minor version OR ttdp version
52 } oldver;
53 GRFIdentifier grfadd; ///< ID and md5sum of added GRF
54 struct {
55 uint32 grfid; ///< ID of removed GRF
56 } grfrem;
57 GRFIdentifier grfcompat; ///< ID and new md5sum of changed GRF
58 struct {
59 uint32 grfid; ///< ID of GRF with changed parameters
60 } grfparam;
61 struct {
62 uint32 grfid; ///< ID of moved GRF
63 int32 offset; ///< offset, positive = move down
64 } grfmove;
65 struct {
66 char *name; ///< name of the setting
67 int32 oldval; ///< old value
68 int32 newval; ///< new value
69 } setting;
70 struct {
71 uint64 data; ///< additional data
72 uint32 grfid; ///< ID of problematic GRF
73 byte bug; ///< type of bug, @see enum GRFBugs
74 } grfbug;
79 /** Contains information about one logged action that caused at least one logged change */
80 struct LoggedAction {
81 LoggedChange *change; ///< First logged change in this action
82 uint32 changes; ///< Number of changes in this action
83 GamelogActionType at; ///< Type of action
84 uint16 tick; ///< Tick when it happened
87 extern LoggedAction *_gamelog_action;
88 extern uint _gamelog_actions;
90 #endif /* GAMELOG_INTERNAL_H */