1 /* $Id: gamelog.h 23901 2012-02-05 15:51:13Z smatz $ */
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/>.
10 /** @file gamelog.h Functions to be called to log possibly unsafe game events */
15 #include "newgrf_config.h"
17 /** The actions we log. */
18 enum GamelogActionType
{
19 GLAT_START
, ///< Game created
20 GLAT_LOAD
, ///< Game loaded
21 GLAT_GRF
, ///< GRF changed
22 GLAT_CHEAT
, ///< Cheat was used
23 GLAT_SETTING
, ///< Setting changed
24 GLAT_GRFBUG
, ///< GRF bug was triggered
25 GLAT_EMERGENCY
, ///< Emergency savegame
26 GLAT_END
, ///< So we know how many GLATs are there
27 GLAT_NONE
= 0xFF, ///< No logging active; in savegames, end of list
30 void GamelogStartAction(GamelogActionType at
);
31 void GamelogStopAction();
33 void GamelogFree(struct LoggedAction
*gamelog_action
, uint gamelog_actions
);
37 * Callback for printing text.
38 * @param s The string to print.
40 typedef void GamelogPrintProc(const char *s
);
41 void GamelogPrint(GamelogPrintProc
*proc
); // needed for WIN32 / WINCE crash.log
43 void GamelogPrintDebug(int level
);
44 void GamelogPrintConsole();
46 void GamelogEmergency();
47 bool GamelogTestEmergency();
49 void GamelogRevision();
52 void GamelogSetting(const char *name
, int32 oldval
, int32 newval
);
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
);
60 void GamelogTestRevision();
61 void GamelogTestMode();
63 bool GamelogGRFBugReverse(uint32 grfid
, uint16 internal_id
);
65 void GamelogInfo(struct LoggedAction
*gamelog_action
, uint gamelog_actions
, uint32
*last_ottd_rev
, byte
*ever_modified
, bool *removed_newgrfs
);
67 #endif /* GAMELOG_H */