Changeset - r15071:e236d80508bb
[Not reviewed]
master
0 7 0
rubidium - 14 years ago 2010-04-24 13:35:18
rubidium@openttd.org
(svn r19707) -Add: helper functions to instantiate/fill ResolverObjects
7 files changed with 71 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -403,6 +403,15 @@ void AirportAnimationTrigger(Station *st
 

	
 
	TILE_AREA_LOOP(tile, st->airport) {
 
		if (st->TileBelongsToAirport(tile)) AirportTileAnimationTrigger(st, tile, trigger, cargo_type);
 
	}
 
}
 

	
 
/**
 
 * 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));
 
}
src/newgrf_engine.cpp
Show inline comments
 
@@ -1185,6 +1185,17 @@ void CommitVehicleListOrderChanges()
 
		lptr_map.Clear();
 
	}
 

	
 
	/* 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);
 
}
src/newgrf_house.cpp
Show inline comments
 
@@ -653,6 +653,16 @@ static void DoTriggerHouse(TileIndex til
 
}
 

	
 
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));
 
}
src/newgrf_industries.cpp
Show inline comments
 
@@ -560,6 +560,17 @@ void IndustryProductionCallback(Industry
 

	
 
		SB(object.callback_param2, 24, 8, again);
 
	}
 

	
 
	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);
 
}
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -427,6 +427,16 @@ void TriggerIndustry(Industry *ind, Indu
 
	TILE_AREA_LOOP(tile, ind->location) {
 
		if (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == ind->index) {
 
			DoTriggerIndustryTile(tile, trigger, ind);
 
		}
 
	}
 
}
 

	
 
/**
 
 * 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));
 
}
src/newgrf_railtype.cpp
Show inline comments
 
@@ -110,6 +110,16 @@ uint8 GetReverseRailTypeTranslation(Rail
 
		if (label == grffile->railtype_list[i]) return i;
 
	}
 

	
 
	/* 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);
 
}
src/newgrf_station.cpp
Show inline comments
 
@@ -1078,6 +1078,16 @@ void StationUpdateAnimTriggers(BaseStati
 
	 * of this station. */
 
	for (uint i = 0; i < st->num_specs; i++) {
 
		const StationSpec *ss = st->speclist[i].spec;
 
		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);
 
}
0 comments (0 inline, 0 general)