Debug: Log number of GRFs at level sl=2 when loading a game

Add helper to get the number of non-static GRFs in a GRF config
This commit is contained in:
Jonathan G Rennison
2024-04-29 20:14:37 +01:00
parent adc7840f01
commit c5cd598217
5 changed files with 17 additions and 9 deletions

View File

@@ -540,6 +540,15 @@ void ResetGRFConfig(bool defaults)
AppendStaticGRFConfigs(&_grfconfig);
}
/** Get the count of non-static GRFs in a GRF config list */
uint GetGRFConfigListNonStaticCount(const GRFConfig *config)
{
uint grf_count = 0;
for (const GRFConfig *c = config; c != nullptr; c = c->next) {
if (!HasBit(c->flags, GCF_STATIC)) grf_count++;
}
return grf_count;
}
/**
* Check if all GRFs in the GRF config from a savegame can be loaded.