1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 19:54:06 +01:00

Codechange: Pass GRFConfig by reference where feasible. (#13388)

In places where a GRFConfig is passed by pointer and not checked for nullptr, use a reference instead.
This commit is contained in:
Peter Nelson
2025-01-26 22:41:08 +00:00
committed by GitHub
parent e894a5880c
commit 9b947a37b8
9 changed files with 110 additions and 112 deletions

View File

@@ -186,7 +186,7 @@ static void LoadSpriteTables()
static const char *master_filename = "OPENTTD.GRF";
GRFConfig *master = new GRFConfig(master_filename);
master->palette |= GRFP_GRF_DOS;
FillGRFDetails(master, false, BASESET_DIR);
FillGRFDetails(*master, false, BASESET_DIR);
ClrBit(master->flags, GCF_INIT_ONLY);
/* Baseset extra graphics */
@@ -381,7 +381,7 @@ GRFConfig &GraphicsSet::GetOrCreateExtraConfig() const
case PAL_WINDOWS: this->extra_cfg->palette |= GRFP_GRF_WINDOWS; break;
default: break;
}
FillGRFDetails(this->extra_cfg.get(), false, BASESET_DIR);
FillGRFDetails(*this->extra_cfg, false, BASESET_DIR);
}
return *this->extra_cfg;
}