OpenTTD

gamelog.h
Go to the documentation of this file.
1 /* $Id: gamelog.h 23901 2012-02-05 15:51:13Z smatz $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
9
12 #ifndef GAMELOG_H
13 #define GAMELOG_H
14
15 #include "newgrf_config.h"
16
18 enum GamelogActionType {
19 GLAT_START,
20 GLAT_LOAD,
21 GLAT_GRF,
22 GLAT_CHEAT,
23 GLAT_SETTING,
24 GLAT_GRFBUG,
25 GLAT_EMERGENCY,
26 GLAT_END,
27 GLAT_NONE = 0xFF,
28 };
29
30 void GamelogStartAction(GamelogActionType at);
31 void GamelogStopAction();
32
33 void GamelogFree(struct LoggedAction *gamelog_action, uint gamelog_actions);
34 void GamelogReset();
35
40 typedef void GamelogPrintProc(const char *s);
41 void GamelogPrint(GamelogPrintProc *proc); // needed for WIN32 / WINCE crash.log
42
43 void GamelogPrintDebug(int level);
44 void GamelogPrintConsole();
45
46 void GamelogEmergency();
47 bool GamelogTestEmergency();
48
49 void GamelogRevision();
50 void GamelogMode();
51 void GamelogOldver();
52 void GamelogSetting(const char *name, int32 oldval, int32 newval);
53
54 void GamelogGRFUpdate(const GRFConfig *oldg, const GRFConfig *newg);
55 void GamelogGRFAddList(const GRFConfig *newg);
56 void GamelogGRFRemove(uint32 grfid);
57 void GamelogGRFAdd(const GRFConfig *newg);
58 void GamelogGRFCompatible(const GRFIdentifier *newg);
59
60 void GamelogTestRevision();
61 void GamelogTestMode();
62
63 bool GamelogGRFBugReverse(uint32 grfid, uint16 internal_id);
64
65 void GamelogInfo(struct LoggedAction *gamelog_action, uint gamelog_actions, uint32 *last_ottd_rev, byte *ever_modified, bool *removed_newgrfs);
66
67 #endif /* GAMELOG_H */
GamelogFree
void GamelogFree(struct LoggedAction *gamelog_action, uint gamelog_actions)
Frees the memory allocated by a gamelog.
Definition: gamelog.cpp:71
GamelogGRFCompatible
void GamelogGRFCompatible(const GRFIdentifier *newg)
Logs loading compatible GRF (the same ID, but different MD5 hash)
Definition: gamelog.cpp:607
GamelogRevision
void GamelogRevision()
Logs a change in game revision.
Definition: gamelog.cpp:410
GamelogGRFAdd
void GamelogGRFAdd(const GRFConfig *newg)
Logs adding of a GRF.
Definition: gamelog.cpp:590
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:778
GamelogPrint
void GamelogPrint(GamelogPrintProc *proc)
Prints active gamelog.
Definition: gamelog.cpp:164
GamelogPrintDebug
void GamelogPrintDebug(int level)
Prints gamelog to debug output.
Definition: gamelog.cpp:341
GamelogStartAction
void GamelogStartAction(GamelogActionType at)
Stores information about new action, but doesn&#39;t allocate it Action is allocated only when there is a...
Definition: gamelog.cpp:47
GamelogPrintConsole
void GamelogPrintConsole()
Print the gamelog data to the console.
Definition: gamelog.cpp:322
GamelogGRFBugReverse
bool GamelogGRFBugReverse(uint32 grfid, uint16 internal_id)
Logs GRF bug - rail vehicle has different length after reversing.
Definition: gamelog.cpp:541
GRFIdentifier
Basic data to distinguish a GRF.
Definition: newgrf_config.h:84
GLAT_CHEAT
Cheat was used.
Definition: gamelog.h:22
GamelogActionType
GamelogActionType
The actions we log.
Definition: gamelog.h:18
GLAT_GRFBUG
GRF bug was triggered.
Definition: gamelog.h:24
GLAT_START
Game created.
Definition: gamelog.h:19
GamelogGRFUpdate
void GamelogGRFUpdate(const GRFConfig *oldg, const GRFConfig *newg)
Compares two NewGRF lists and logs any change.
Definition: gamelog.cpp:694
GamelogReset
void GamelogReset()
Resets and frees all memory allocated - used before loading or starting a new game.
Definition: gamelog.cpp:88
LoggedAction
Contains information about one logged action that caused at least one logged change.
Definition: gamelog_internal.h:81
GRFConfig
Information about GRF, used in the game and (part of it) in savegames.
Definition: newgrf_config.h:153
GamelogSetting
void GamelogSetting(const char *name, int32 oldval, int32 newval)
Logs change in game settings.
Definition: gamelog.cpp:458
GLAT_LOAD
Game loaded.
Definition: gamelog.h:20
GamelogEmergency
void GamelogEmergency()
Logs a emergency savegame.
Definition: gamelog.cpp:380
GamelogMode
void GamelogMode()
Logs a change in game mode (scenario editor or game)
Definition: gamelog.cpp:427
GLAT_END
So we know how many GLATs are there.
Definition: gamelog.h:26
GLAT_EMERGENCY
Emergency savegame.
Definition: gamelog.h:25
newgrf_config.h
Functions to find and configure NewGRFs.
GLAT_GRF
GRF changed.
Definition: gamelog.h:21
GLAT_SETTING
Setting changed.
Definition: gamelog.h:23
GamelogGRFAddList
void GamelogGRFAddList(const GRFConfig *newg)
Logs adding of list of GRFs.
Definition: gamelog.cpp:653
GamelogTestMode
void GamelogTestMode()
Finds last stored game mode or landscape.
Definition: gamelog.cpp:498
GamelogTestEmergency
bool GamelogTestEmergency()
Finds out if current game is a loaded emergency savegame.
Definition: gamelog.cpp:392
GamelogStopAction
void GamelogStopAction()
Stops logging of any changes.
Definition: gamelog.cpp:56
GamelogOldver
void GamelogOldver()
Logs loading from savegame without gamelog.
Definition: gamelog.cpp:441
GamelogTestRevision
void GamelogTestRevision()
Finds out if current revision is different than last revision stored in the savegame.
Definition: gamelog.cpp:475
GLAT_NONE
No logging active; in savegames, end of list.
Definition: gamelog.h:27
GamelogPrintProc
void GamelogPrintProc(const char *s)
Callback for printing text.
Definition: gamelog.h:40
GamelogGRFRemove
void GamelogGRFRemove(uint32 grfid)
Logs removal of a GRF.
Definition: gamelog.cpp:576