VarAction2: Mark applicable road stops variables as expensive

This commit is contained in:
Jonathan G Rennison
2022-12-24 19:01:32 +00:00
parent 8af4ac8a4c
commit 546ad0b43c

View File

@@ -69,11 +69,29 @@ static bool IsExpensiveObjectVariable(uint16 variable)
} }
} }
static bool IsExpensiveRoadStopsVariable(uint16 variable)
{
switch (variable) {
case 0x45:
case 0x46:
case 0x66:
case 0x67:
case 0x68:
case 0x6A:
case 0x6B:
return true;
default:
return false;
}
}
static bool IsExpensiveVariable(uint16 variable, GrfSpecFeature feature, VarSpriteGroupScope var_scope) static bool IsExpensiveVariable(uint16 variable, GrfSpecFeature feature, VarSpriteGroupScope var_scope)
{ {
if ((feature >= GSF_TRAINS && feature <= GSF_AIRCRAFT) && IsExpensiveVehicleVariable(variable)) return true; if ((feature >= GSF_TRAINS && feature <= GSF_AIRCRAFT) && IsExpensiveVehicleVariable(variable)) return true;
if (feature == GSF_INDUSTRYTILES && var_scope == VSG_SCOPE_SELF && IsExpensiveIndustryTileVariable(variable)) return true; if (feature == GSF_INDUSTRYTILES && var_scope == VSG_SCOPE_SELF && IsExpensiveIndustryTileVariable(variable)) return true;
if (feature == GSF_OBJECTS && var_scope == VSG_SCOPE_SELF && IsExpensiveObjectVariable(variable)) return true; if (feature == GSF_OBJECTS && var_scope == VSG_SCOPE_SELF && IsExpensiveObjectVariable(variable)) return true;
if (feature == GSF_ROADSTOPS && var_scope == VSG_SCOPE_SELF && IsExpensiveRoadStopsVariable(variable)) return true;
return false; return false;
} }