2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2009-01-04 15:32:25 +00:00
|
|
|
/** @file gamelog_internal.h Declaration shared among gamelog.cpp and saveload/gamelog_sl.cpp */
|
|
|
|
|
|
|
|
#ifndef GAMELOG_INTERNAL_H
|
|
|
|
#define GAMELOG_INTERNAL_H
|
|
|
|
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "gamelog.h"
|
2009-01-04 15:32:25 +00:00
|
|
|
|
2019-01-27 14:35:12 +00:00
|
|
|
static const uint GAMELOG_REVISION_LENGTH = 15;
|
|
|
|
|
2009-01-04 15:32:25 +00:00
|
|
|
/** Contains information about one logged change */
|
|
|
|
struct LoggedChange {
|
|
|
|
GamelogChangeType ct; ///< Type of change logged in this struct
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
byte mode; ///< new game mode - Editor x Game
|
|
|
|
byte landscape; ///< landscape (temperate, arctic, ...)
|
|
|
|
} mode;
|
|
|
|
struct {
|
2019-01-27 14:35:12 +00:00
|
|
|
char text[GAMELOG_REVISION_LENGTH]; ///< revision string, _openttd_revision
|
2009-01-04 15:32:25 +00:00
|
|
|
uint32 newgrf; ///< _openttd_newgrf_version
|
|
|
|
uint16 slver; ///< _sl_version
|
|
|
|
byte modified; ///< _openttd_revision_modified
|
|
|
|
} revision;
|
|
|
|
struct {
|
|
|
|
uint32 type; ///< type of savegame, @see SavegameType
|
|
|
|
uint32 version; ///< major and minor version OR ttdp version
|
|
|
|
} oldver;
|
|
|
|
GRFIdentifier grfadd; ///< ID and md5sum of added GRF
|
|
|
|
struct {
|
|
|
|
uint32 grfid; ///< ID of removed GRF
|
|
|
|
} grfrem;
|
|
|
|
GRFIdentifier grfcompat; ///< ID and new md5sum of changed GRF
|
|
|
|
struct {
|
|
|
|
uint32 grfid; ///< ID of GRF with changed parameters
|
|
|
|
} grfparam;
|
|
|
|
struct {
|
|
|
|
uint32 grfid; ///< ID of moved GRF
|
|
|
|
int32 offset; ///< offset, positive = move down
|
|
|
|
} grfmove;
|
|
|
|
struct {
|
2009-02-08 12:25:13 +00:00
|
|
|
char *name; ///< name of the setting
|
2009-01-04 15:32:25 +00:00
|
|
|
int32 oldval; ///< old value
|
|
|
|
int32 newval; ///< new value
|
2009-02-08 12:25:13 +00:00
|
|
|
} setting;
|
2009-01-04 15:32:25 +00:00
|
|
|
struct {
|
|
|
|
uint64 data; ///< additional data
|
|
|
|
uint32 grfid; ///< ID of problematic GRF
|
|
|
|
byte bug; ///< type of bug, @see enum GRFBugs
|
|
|
|
} grfbug;
|
|
|
|
};
|
2023-05-01 17:14:31 +00:00
|
|
|
|
|
|
|
~LoggedChange();
|
2009-01-04 15:32:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** Contains information about one logged action that caused at least one logged change */
|
|
|
|
struct LoggedAction {
|
2023-05-01 17:14:31 +00:00
|
|
|
std::vector<LoggedChange> change; ///< First logged change in this action
|
2009-01-04 15:32:25 +00:00
|
|
|
GamelogActionType at; ///< Type of action
|
2022-09-21 10:42:29 +00:00
|
|
|
uint64 tick; ///< Tick when it happened
|
2009-01-04 15:32:25 +00:00
|
|
|
};
|
|
|
|
|
2023-05-01 17:14:31 +00:00
|
|
|
struct GamelogInternalData {
|
|
|
|
std::vector<LoggedAction> action;
|
|
|
|
};
|
2009-01-04 15:32:25 +00:00
|
|
|
|
|
|
|
#endif /* GAMELOG_INTERNAL_H */
|