diff options
author | Patric Stout <truebrain@openttd.org> | 2021-07-09 21:16:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-09 21:16:03 +0200 |
commit | 8f5d0ecde39cbaf2ac1a6d27e82239bfc3bf1515 (patch) | |
tree | 232daba5b6f77f8ae33191c0b88dd21ef662a1c1 /src/settings_internal.h | |
parent | d9ca9ca55571829af88429147e20bf0734e07e2d (diff) | |
download | openttd-8f5d0ecde39cbaf2ac1a6d27e82239bfc3bf1515.tar.xz |
Codechange: split settings.ini over several files (#9421)
This reduced the load on compilers, as currently for example MacOS
doesn't like the huge settings-tables.
Additionally, nobody can find settings, as the list is massive and
unordered. By splitting it, it becomes a little bit more sensible.
Diffstat (limited to 'src/settings_internal.h')
-rw-r--r-- | src/settings_internal.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/settings_internal.h b/src/settings_internal.h index 304f1393a..a9083ce40 100644 --- a/src/settings_internal.h +++ b/src/settings_internal.h @@ -312,8 +312,10 @@ static constexpr const SettingDesc *GetSettingDesc(const SettingVariant &desc) return std::visit([](auto&& arg) -> const SettingDesc * { return &arg; }, desc); } +typedef span<const SettingVariant> SettingTable; + const SettingDesc *GetSettingFromName(const std::string_view name); -void GetSettingSaveLoadByPrefix(const std::string_view prefix, std::vector<SaveLoad> &saveloads); +void GetSaveLoadFromSettingTable(SettingTable settings, std::vector<SaveLoad> &saveloads); bool SetSettingValue(const IntSettingDesc *sd, int32 value, bool force_newgame = false); bool SetSettingValue(const StringSettingDesc *sd, const std::string value, bool force_newgame = false); |