Codechange: Use std::array for GRF(File|Config) parameters.

This simplifies comparison, copying and assignment operations.
This commit is contained in:
Peter Nelson
2023-05-18 19:56:24 +01:00
committed by PeterN
parent c23aae96a2
commit 6b87fe6540
7 changed files with 18 additions and 23 deletions

View File

@@ -169,7 +169,7 @@ struct NewGRFParametersWindow : public Window {
clicked_row(UINT_MAX),
editable(editable)
{
this->action14present = (c->num_valid_params != lengthof(c->param) || c->param_info.size() != 0);
this->action14present = (c->num_valid_params != c->param.size() || c->param_info.size() != 0);
this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_NP_SCROLLBAR);
@@ -225,7 +225,7 @@ struct NewGRFParametersWindow : public Window {
}
case WID_NP_NUMPAR: {
SetDParamMaxValue(0, lengthof(this->grf_config->param));
SetDParamMaxValue(0, this->grf_config->param.size());
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
d.width += padding.width;
d.height += padding.height;