1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 11:44:17 +01:00

Codechange: Store GRFConfig parameters in a vector. (#13137)

All GRFConfigs have space allocated for parameters, but only configured GRFConfigs need them.

Using a vector instead means that space is only used when parameters are used.
This commit is contained in:
Peter Nelson
2024-12-01 15:15:21 +00:00
committed by GitHub
parent e28617fda6
commit 3a310f1802
11 changed files with 76 additions and 57 deletions

View File

@@ -814,7 +814,7 @@ struct GameOptionsWindow : Window {
auto *used_set = BaseGraphics::GetUsedSet();
if (used_set == nullptr || !used_set->IsConfigurable()) break;
GRFConfig &extra_cfg = used_set->GetOrCreateExtraConfig();
if (extra_cfg.num_params == 0) extra_cfg.SetParameterDefaults();
if (extra_cfg.param.empty()) extra_cfg.SetParameterDefaults();
OpenGRFParameterWindow(true, &extra_cfg, _game_mode == GM_MENU);
if (_game_mode == GM_MENU) this->reload = true;
break;