forked from mirror/OpenTTD
Add: store base graphics parameters in openttd.cfg.
This commit is contained in:
@@ -193,6 +193,7 @@ static void LoadSpriteTables()
|
||||
|
||||
/* Baseset extra graphics */
|
||||
GRFConfig *extra = new GRFConfig(used_set->GetOrCreateExtraConfig());
|
||||
if (extra->num_params == 0) extra->SetParameterDefaults();
|
||||
ClrBit(extra->flags, GCF_INIT_ONLY);
|
||||
|
||||
extra->next = top;
|
||||
@@ -388,6 +389,15 @@ GRFConfig &GraphicsSet::GetOrCreateExtraConfig() const
|
||||
return *this->extra_cfg;
|
||||
}
|
||||
|
||||
void GraphicsSet::CopyCompatibleConfig(const GraphicsSet &src)
|
||||
{
|
||||
const GRFConfig *src_cfg = src.GetExtraConfig();
|
||||
if (src_cfg == nullptr || src_cfg->num_params == 0) return;
|
||||
GRFConfig &dest_cfg = this->GetOrCreateExtraConfig();
|
||||
if (dest_cfg.IsCompatible(src_cfg->version)) return;
|
||||
dest_cfg.CopyParams(*src_cfg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate and check the MD5 hash of the supplied GRF.
|
||||
* @param file The file get the hash of.
|
||||
|
Reference in New Issue
Block a user