OpenTTD Source: src/gamelog.h Source File

OpenTTD Source 13.1

gamelog.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_H
11 #define GAMELOG_H
12
13 #include "newgrf_config.h"
14
16 enum GamelogActionType : uint8 {
17 GLAT_START,
18 GLAT_LOAD,
19 GLAT_GRF,
20 GLAT_CHEAT,
21 GLAT_SETTING,
22 GLAT_GRFBUG,
23 GLAT_EMERGENCY,
24 GLAT_END,
25 GLAT_NONE = 0xFF,
26 };
27
28 void GamelogStartAction(GamelogActionType at);
29 void GamelogStopAction();
30 void GamelogStopAnyAction();
31
32 void GamelogFree(struct LoggedAction *gamelog_action, uint gamelog_actions);
33 void GamelogReset();
34
39 typedef void GamelogPrintProc(const char *s);
40 void GamelogPrint(GamelogPrintProc *proc); // needed for WIN32 crash.log
41
42 void GamelogPrintDebug(int level);
43 void GamelogPrintConsole();
44
45 void GamelogEmergency();
46 bool GamelogTestEmergency();
47
48 void GamelogRevision();
49 void GamelogMode();
50 void GamelogOldver();
51 void GamelogSetting(const std::string &name, int32 oldval, int32 newval);
52
53 void GamelogGRFUpdate(const GRFConfig *oldg, const GRFConfig *newg);
54 void GamelogGRFAddList(const GRFConfig *newg);
55 void GamelogGRFRemove(uint32 grfid);
56 void GamelogGRFAdd(const GRFConfig *newg);
57 void GamelogGRFCompatible(const GRFIdentifier *newg);
58
59 void GamelogTestRevision();
60 void GamelogTestMode();
61
62 bool GamelogGRFBugReverse(uint32 grfid, uint16 internal_id);
63
64 void GamelogInfo(struct LoggedAction *gamelog_action, uint gamelog_actions, uint32 *last_ottd_rev, byte *ever_modified, bool *removed_newgrfs);
65
66 #endif /* GAMELOG_H */
GamelogGRFRemove
void GamelogGRFRemove(uint32 grfid)
Logs removal of a GRF.
Definition: gamelog.cpp:604
GamelogPrintDebug
void GamelogPrintDebug(int level)
Prints gamelog to debug output.
Definition: gamelog.cpp:369
GamelogPrintProc
void GamelogPrintProc(const char *s)
Callback for printing text.
Definition: gamelog.h:39
GLAT_GRF
@ GLAT_GRF
GRF changed.
Definition: gamelog.h:19
GamelogFree
void GamelogFree(struct LoggedAction *gamelog_action, uint gamelog_actions)
Frees the memory allocated by a gamelog.
Definition: gamelog.cpp:98
GLAT_LOAD
@ GLAT_LOAD
Game loaded.
Definition: gamelog.h:18
GamelogRevision
void GamelogRevision()
Logs a change in game revision.
Definition: gamelog.cpp:438
GamelogPrint
void GamelogPrint(GamelogPrintProc *proc)
Prints active gamelog.
Definition: gamelog.cpp:192
GamelogGRFAdd
void GamelogGRFAdd(const GRFConfig *newg)
Logs adding of a GRF.
Definition: gamelog.cpp:618
GamelogSetting
void GamelogSetting(const std::string &name, int32 oldval, int32 newval)
Logs change in game settings.
Definition: gamelog.cpp:486
GamelogStartAction
void GamelogStartAction(GamelogActionType at)
Stores information about new action, but doesn't allocate it Action is allocated only when there is a...
Definition: gamelog.cpp:69
newgrf_config.h
GLAT_SETTING
@ GLAT_SETTING
Setting changed.
Definition: gamelog.h:21
GamelogPrintConsole
void GamelogPrintConsole()
Print the gamelog data to the console.
Definition: gamelog.cpp:350
GRFIdentifier
Basic data to distinguish a GRF.
Definition: newgrf_config.h:83
GamelogGRFUpdate
void GamelogGRFUpdate(const GRFConfig *oldg, const GRFConfig *newg)
Compares two NewGRF lists and logs any change.
Definition: gamelog.cpp:722
GamelogReset
void GamelogReset()
Resets and frees all memory allocated - used before loading or starting a new game.
Definition: gamelog.cpp:115
GRFConfig
Information about GRF, used in the game and (part of it) in savegames.
Definition: newgrf_config.h:155
GamelogGRFBugReverse
bool GamelogGRFBugReverse(uint32 grfid, uint16 internal_id)
Logs GRF bug - rail vehicle has different length after reversing.
Definition: gamelog.cpp:569
GLAT_NONE
@ GLAT_NONE
No logging active; in savegames, end of list.
Definition: gamelog.h:25
GamelogEmergency
void GamelogEmergency()
Logs a emergency savegame.
Definition: gamelog.cpp:408
GamelogTestMode
void GamelogTestMode()
Finds last stored game mode or landscape.
Definition: gamelog.cpp:526
GLAT_EMERGENCY
@ GLAT_EMERGENCY
Emergency savegame.
Definition: gamelog.h:23
GamelogStopAction
void GamelogStopAction()
Stops logging of any changes.
Definition: gamelog.cpp:78
GamelogMode
void GamelogMode()
Logs a change in game mode (scenario editor or game)
Definition: gamelog.cpp:455
GLAT_CHEAT
@ GLAT_CHEAT
Cheat was used.
Definition: gamelog.h:20
GLAT_GRFBUG
@ GLAT_GRFBUG
GRF bug was triggered.
Definition: gamelog.h:22
GLAT_END
@ GLAT_END
So we know how many GLATs are there.
Definition: gamelog.h:24
GamelogTestRevision
void GamelogTestRevision()
Finds out if current revision is different than last revision stored in the savegame.
Definition: gamelog.cpp:503
GamelogGRFAddList
void GamelogGRFAddList(const GRFConfig *newg)
Logs adding of list of GRFs.
Definition: gamelog.cpp:681
GamelogTestEmergency
bool GamelogTestEmergency()
Finds out if current game is a loaded emergency savegame.
Definition: gamelog.cpp:420
GamelogGRFCompatible
void GamelogGRFCompatible(const GRFIdentifier *newg)
Logs loading compatible GRF (the same ID, but different MD5 hash)
Definition: gamelog.cpp:635
GamelogActionType
GamelogActionType
The actions we log.
Definition: gamelog.h:16
GamelogOldver
void GamelogOldver()
Logs loading from savegame without gamelog.
Definition: gamelog.cpp:469
GLAT_START
@ GLAT_START
Game created.
Definition: gamelog.h:17
LoggedAction
Contains information about one logged action that caused at least one logged change.
Definition: gamelog_internal.h:80
GamelogInfo
void GamelogInfo(struct LoggedAction *gamelog_action, uint gamelog_actions, uint32 *last_ottd_rev, byte *ever_modified, bool *removed_newgrfs)
Get some basic information from the given gamelog.
Definition: gamelog.cpp:806