1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-13 17:49:10 +00:00

(svn r3719) - [1/4] Present the game with a unified structure for the configuration-ini, saveload, console and gui representations of the settings. This first part rewrites the configuration section to use the SaveLoad VarType in general.

- This unified structure consists of a SaveLoad type which stores all data relevant about the variable internals such as type, mem/filesize, address, version-control. The SettingDesc type is concerned more about the representation. Things like default value, string-name, minimum/maximum values, gui-behaviour etc.
- The SaveLoad type has received a few flags controlling saving/loading. These are:
  SLF_SAVE_NO: the setting is not saved with the savegame, effectively making this setting player-based. Eg. it will NOT be overwritten when joining a network-game
  SLF_CONFIG_NO: the setting is not saved to the configuration file so you cannot overwrite it ingame.
  SLF_NETWORK_NO: the setting is not synchronised with the local settings when the game is loaded during network-play. Note that when SLF_SAVE_NO is set, SLF_NETWORK_NO is also set (which is logical), at least if the proper macros are used (in [2/4]).
- NOTE! The game is not compilable after this commit.
This commit is contained in:
Darkvater
2006-03-01 23:53:20 +00:00
parent a98e66c2c0
commit 1e247cab21
3 changed files with 225 additions and 224 deletions

View File

@@ -126,6 +126,13 @@ enum VarTypes {
SLE_INT = SLE_INT32,
SLE_STRB = SLE_STRINGBUF,
SLE_STRQ = SLE_STRINGQUOTE,
/* 8 bytes allocated for a maximum of 8 flags
* Flags directing saving/loading of a variable */
SLF_SAVE_NO = 1 << 8, ///< do not save with savegame, basically player-based
SLF_CONFIG_NO = 1 << 9, ///< do not save to config file
SLF_NETWORK_NO = 1 << 10, ///< do not synchronize over network (but it is saved if SSF_SAVE_NO is not set)
/* 5 more possible flags */
};
typedef uint32 VarType;