mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 21:06:58 +00:00
(svn r19707) -Add: helper functions to instantiate/fill ResolverObjects
This commit is contained in:
parent
e75e2648fc
commit
1da0086a45
@ -406,3 +406,12 @@ void AirportAnimationTrigger(Station *st, AirpAnimationTrigger trigger, CargoID
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve an airport tile's spec and such so we can get a variable.
|
||||
* @param ro The resolver object to fill.
|
||||
* @param index The airport tile to get the data from.
|
||||
*/
|
||||
void GetAirportTileTypeResolver(ResolverObject *ro, uint index)
|
||||
{
|
||||
AirportTileResolver(ro, GetAirportGfx(index), index, Station::GetByTile(index));
|
||||
}
|
||||
|
@ -1188,3 +1188,14 @@ void CommitVehicleListOrderChanges()
|
||||
/* Clear out the queue */
|
||||
_list_order_changes.Reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve an engine's spec and such so we can get a variable.
|
||||
* @param ro The resolver object to fill.
|
||||
* @param index The vehicle to get the data from.
|
||||
*/
|
||||
void GetVehicleResolver(ResolverObject *ro, uint index)
|
||||
{
|
||||
Vehicle *v = Vehicle::Get(index);
|
||||
NewVehicleResolver(ro, v->engine_type, v);
|
||||
}
|
||||
|
@ -656,3 +656,13 @@ void TriggerHouse(TileIndex t, HouseTrigger trigger)
|
||||
{
|
||||
DoTriggerHouse(t, trigger, 0, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a house's spec and such so we can get a variable.
|
||||
* @param ro The resolver object to fill.
|
||||
* @param index The house tile to get the data from.
|
||||
*/
|
||||
void GetHouseResolver(ResolverObject *ro, uint index)
|
||||
{
|
||||
NewHouseResolver(ro, GetHouseType(index), index, Town::GetByTile(index));
|
||||
}
|
||||
|
@ -563,3 +563,14 @@ void IndustryProductionCallback(Industry *ind, int reason)
|
||||
|
||||
SetWindowDirty(WC_INDUSTRY_VIEW, ind->index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a industry's spec and such so we can get a variable.
|
||||
* @param ro The resolver object to fill.
|
||||
* @param index The industry ID to get the data from.
|
||||
*/
|
||||
void GetIndustryResolver(ResolverObject *ro, uint index)
|
||||
{
|
||||
Industry *i = Industry::Get(index);
|
||||
NewIndustryResolver(ro, i->location.tile, i, i->type);
|
||||
}
|
||||
|
@ -430,3 +430,13 @@ void TriggerIndustry(Industry *ind, IndustryTileTrigger trigger)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a industry tile's spec and such so we can get a variable.
|
||||
* @param ro The resolver object to fill.
|
||||
* @param index The industry tile to get the data from.
|
||||
*/
|
||||
void GetIndustryTileResolver(ResolverObject *ro, uint index)
|
||||
{
|
||||
NewIndustryTileResolver(ro, GetIndustryGfx(index), index, Industry::GetByTile(index));
|
||||
}
|
||||
|
@ -113,3 +113,13 @@ uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile)
|
||||
/* If not found, return as invalid */
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a railtypes's spec and such so we can get a variable.
|
||||
* @param ro The resolver object to fill.
|
||||
* @param index The rail tile to get the data from.
|
||||
*/
|
||||
void GetRailTypeResolver(ResolverObject *ro, uint index)
|
||||
{
|
||||
NewRailTypeResolver(ro, index);
|
||||
}
|
||||
|
@ -1081,3 +1081,13 @@ void StationUpdateAnimTriggers(BaseStation *st)
|
||||
if (ss != NULL) st->cached_anim_triggers |= ss->anim_triggers;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a station's spec and such so we can get a variable.
|
||||
* @param ro The resolver object to fill.
|
||||
* @param index The station to get the data from.
|
||||
*/
|
||||
void GetStationResolver(ResolverObject *ro, uint index)
|
||||
{
|
||||
NewStationResolver(ro, GetStationSpec(index), Station::GetByTile(index), index);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user