diff --git a/src/settings_internal.h b/src/settings_internal.h --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -20,7 +20,7 @@ * @see VarTypes * @see SettingDescBase */ -enum SettingDescTypeLong { +enum SettingDescType : byte { /* 4 bytes allocated a maximum of 16 types for GenericType */ SDT_BEGIN = 0, SDT_NUMX = 0, ///< any number-type @@ -32,10 +32,9 @@ enum SettingDescTypeLong { SDT_END, /* 10 more possible primitives */ }; -typedef SimpleTinyEnumT SettingDescType; -enum SettingGuiFlagLong { +enum SettingGuiFlag : uint16 { /* 1 byte allocated for a maximum of 8 flags * Flags directing saving/loading of a variable */ SGF_NONE = 0, @@ -49,8 +48,7 @@ enum SettingGuiFlagLong { SGF_SCENEDIT_TOO = 1 << 7, ///< this setting can be changed in the scenario editor (only makes sense when SGF_NEWGAME_ONLY is set) SGF_PER_COMPANY = 1 << 8, ///< this setting can be different for each company (saved in company struct) }; -DECLARE_ENUM_AS_BIT_SET(SettingGuiFlagLong) -typedef SimpleTinyEnumT SettingGuiFlag; +DECLARE_ENUM_AS_BIT_SET(SettingGuiFlag) /** * A SettingCategory defines a grouping of the settings. diff --git a/src/table/currency_settings.ini b/src/table/currency_settings.ini --- a/src/table/currency_settings.ini +++ b/src/table/currency_settings.ini @@ -18,7 +18,7 @@ SDT_END = SDT_END() [defaults] flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC -guiflags = 0 +guiflags = SGF_NONE interval = 0 str = STR_NULL strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT diff --git a/src/table/gameopt_settings.ini b/src/table/gameopt_settings.ini --- a/src/table/gameopt_settings.ini +++ b/src/table/gameopt_settings.ini @@ -50,7 +50,7 @@ SDT_END = SDT_END() [defaults] flags = 0 -guiflags = 0 +guiflags = SGF_NONE interval = 0 str = STR_NULL strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT diff --git a/src/table/misc_settings.ini b/src/table/misc_settings.ini --- a/src/table/misc_settings.ini +++ b/src/table/misc_settings.ini @@ -25,7 +25,7 @@ SDTG_END = SDTG_END() [defaults] flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC -guiflags = 0 +guiflags = SGF_NONE interval = 0 str = STR_NULL strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT diff --git a/src/table/settings.h.preamble b/src/table/settings.h.preamble --- a/src/table/settings.h.preamble +++ b/src/table/settings.h.preamble @@ -57,7 +57,7 @@ static size_t ConvertLandscape(const cha */ #define NSD_GENERAL(name, def, cmd, guiflags, min, max, interval, many, str, strhelp, strval, proc, load, cat)\ - {name, (const void*)(size_t)(def), {(byte)cmd}, {(uint16)guiflags}, min, max, interval, many, str, strhelp, strval, proc, load, cat} + {name, (const void*)(size_t)(def), cmd, guiflags, min, max, interval, many, str, strhelp, strval, proc, load, cat} /* Macros for various objects to go in the configuration file. * This section is for global variables */ @@ -83,9 +83,9 @@ static size_t ConvertLandscape(const cha SDTG_GENERAL(name, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, var, 0, def, 0, 0, 0, full, str, strhelp, strval, proc, from, to, cat) #define SDTG_NULL(length, from, to)\ - {{"", nullptr, {0}, {0}, 0, 0, 0, nullptr, STR_NULL, STR_NULL, STR_NULL, nullptr, nullptr, SC_NONE}, SLEG_NULL(length, from, to)} + {{"", nullptr, SDT_NUMX, SGF_NONE, 0, 0, 0, nullptr, STR_NULL, STR_NULL, STR_NULL, nullptr, nullptr, SC_NONE}, SLEG_NULL(length, from, to)} -#define SDTG_END() {{nullptr, nullptr, {0}, {0}, 0, 0, 0, nullptr, STR_NULL, STR_NULL, STR_NULL, nullptr, nullptr, SC_NONE}, SLEG_END()} +#define SDTG_END() {{nullptr, nullptr, SDT_NUMX, SGF_NONE, 0, 0, 0, nullptr, STR_NULL, STR_NULL, STR_NULL, nullptr, nullptr, SC_NONE}, SLEG_END()} /* Macros for various objects to go in the configuration file. * This section is for structures where their various members are saved */ @@ -114,7 +114,7 @@ static size_t ConvertLandscape(const cha SDT_GENERAL(#var, SDT_MANYOFMANY, SL_VAR, type, flags, guiflags, base, var, 1, def, 0, 0, 0, full, str, strhelp, strval, proc, nullptr, from, to, cat) #define SDT_NULL(length, from, to)\ - {{"", nullptr, {0}, {0}, 0, 0, 0, nullptr, STR_NULL, STR_NULL, STR_NULL, nullptr, nullptr, SC_NONE}, SLE_CONDNULL(length, from, to)} + {{"", nullptr, SDT_NUMX, SGF_NONE, 0, 0, 0, nullptr, STR_NULL, STR_NULL, STR_NULL, nullptr, nullptr, SC_NONE}, SLE_CONDNULL(length, from, to)} #define SDTC_VAR(var, type, flags, guiflags, def, min, max, interval, str, strhelp, strval, proc, from, to, cat)\ @@ -132,5 +132,5 @@ static size_t ConvertLandscape(const cha #define SDTC_OMANY(var, type, flags, guiflags, def, max, full, str, strhelp, strval, proc, from, to, cat)\ SDTG_GENERAL(#var, SDT_ONEOFMANY, SL_VAR, type, flags, guiflags, _settings_client.var, 1, def, 0, max, 0, full, str, strhelp, strval, proc, from, to, cat) -#define SDT_END() {{nullptr, nullptr, {0}, {0}, 0, 0, 0, nullptr, STR_NULL, STR_NULL, STR_NULL, nullptr, nullptr, SC_NONE}, SLE_END()} +#define SDT_END() {{nullptr, nullptr, SDT_NUMX, SGF_NONE, 0, 0, 0, nullptr, STR_NULL, STR_NULL, STR_NULL, nullptr, nullptr, SC_NONE}, SLE_END()} diff --git a/src/table/settings.ini b/src/table/settings.ini --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -81,7 +81,7 @@ SDT_END = SDT_END() [defaults] flags = 0 -guiflags = 0 +guiflags = SGF_NONE interval = 0 str = STR_NULL strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT diff --git a/src/table/win32_settings.ini b/src/table/win32_settings.ini --- a/src/table/win32_settings.ini +++ b/src/table/win32_settings.ini @@ -23,7 +23,7 @@ SDTG_END = SDTG_END() [defaults] flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC -guiflags = 0 +guiflags = SGF_NONE interval = 0 str = STR_NULL strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT diff --git a/src/table/window_settings.ini b/src/table/window_settings.ini --- a/src/table/window_settings.ini +++ b/src/table/window_settings.ini @@ -19,7 +19,7 @@ SDT_END = SDT_END() [defaults] base = WindowDesc flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC -guiflags = 0 +guiflags = SGF_NONE interval = 0 str = STR_NULL strhelp = STR_CONFIG_SETTING_NO_EXPLANATION_AVAILABLE_HELPTEXT