VarAction2: Mark applicable rail station variables as expensive

This commit is contained in:
Jonathan G Rennison
2023-01-03 01:37:06 +00:00
parent 96f790fc7d
commit 4b51a3eda8

View File

@@ -37,6 +37,20 @@ static bool IsExpensiveVehicleVariable(uint16 variable)
}
}
static bool IsExpensiveStationVariable(uint16 variable)
{
switch (variable) {
case 0x66:
case 0x67:
case 0x68:
case 0x6A:
return true;
default:
return false;
}
}
static bool IsExpensiveIndustryTileVariable(uint16 variable)
{
switch (variable) {
@@ -89,6 +103,7 @@ static bool IsExpensiveRoadStopsVariable(uint16 variable)
static bool IsExpensiveVariable(uint16 variable, GrfSpecFeature feature, VarSpriteGroupScope var_scope)
{
if ((feature >= GSF_TRAINS && feature <= GSF_AIRCRAFT) && IsExpensiveVehicleVariable(variable)) return true;
if (feature == GSF_STATIONS && var_scope == VSG_SCOPE_SELF && IsExpensiveStationVariable(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_ROADSTOPS && var_scope == VSG_SCOPE_SELF && IsExpensiveRoadStopsVariable(variable)) return true;