Changeset - r18292:67d22b89b6c6
[Not reviewed]
master
0 18 0
frosch - 13 years ago 2011-11-08 17:23:30
frosch@openttd.org
(svn r23138) -Feature: [NewGRF] Allow passing 32bit parameters to 60+x variables (using var 7B). Currently most useful for vehicle var 60.
18 files changed with 23 insertions and 23 deletions:
0 comments (0 inline, 0 general)
src/newgrf_airport.cpp
Show inline comments
 
@@ -127,7 +127,7 @@ void AirportOverrideManager::SetEntitySp
 
	}
 
}
 

	
 
uint32 AirportGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
uint32 AirportGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	const Station *st = object->u.airport.st;
 
	byte layout       = object->u.airport.layout;
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -166,7 +166,7 @@ static uint32 GetAirportTileIDAtOffset(T
 
	return 0xFF << 8 | ats->grf_prop.subst_id; // so just give him the substitute
 
}
 

	
 
static uint32 AirportTileGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 AirportTileGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	const Station *st = object->u.airport.st;
 
	TileIndex tile    = object->u.airport.tile;
src/newgrf_canal.cpp
Show inline comments
 
@@ -41,7 +41,7 @@ static void CanalSetTriggers(const Resol
 
}
 

	
 

	
 
static uint32 CanalGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 CanalGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	TileIndex tile = object->u.canal.tile;
 

	
src/newgrf_cargo.cpp
Show inline comments
 
@@ -33,7 +33,7 @@ static void CargoSetTriggers(const Resol
 
}
 

	
 

	
 
static uint32 CargoGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 CargoGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	DEBUG(grf, 1, "Unhandled cargo variable 0x%X", variable);
 

	
src/newgrf_debug_gui.cpp
Show inline comments
 
@@ -291,7 +291,7 @@ struct NewGRFInspectWindow : Window {
 
	static const int BOTTOM_OFFSET = 5; ///< Position of bottom edge
 

	
 
	/** The value for the variable 60 parameters. */
 
	static byte var60params[GSF_FAKE_END][0x20];
 
	static uint32 var60params[GSF_FAKE_END][0x20];
 

	
 
	/** GRFID of the caller of this window, 0 if it has no caller. */
 
	uint32 caller_grfid;
 
@@ -497,7 +497,7 @@ struct NewGRFInspectWindow : Window {
 
					if (!HasVariableParameter(niv->var)) break;
 

	
 
					this->current_edit_param = niv->var;
 
					ShowQueryString(STR_EMPTY, STR_NEWGRF_INSPECT_QUERY_CAPTION, 3, this, CS_HEXADECIMAL, QSF_NONE);
 
					ShowQueryString(STR_EMPTY, STR_NEWGRF_INSPECT_QUERY_CAPTION, 9, this, CS_HEXADECIMAL, QSF_NONE);
 
				}
 
			}
 
		}
 
@@ -517,7 +517,7 @@ struct NewGRFInspectWindow : Window {
 
	}
 
};
 

	
 
/* static */ byte NewGRFInspectWindow::var60params[GSF_FAKE_END][0x20] = { {0} }; // Use spec to have 0s in whole array
 
/* static */ uint32 NewGRFInspectWindow::var60params[GSF_FAKE_END][0x20] = { {0} }; // Use spec to have 0s in whole array
 

	
 
static const NWidgetPart _nested_newgrf_inspect_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
src/newgrf_engine.cpp
Show inline comments
 
@@ -460,7 +460,7 @@ static uint32 PositionHelper(const Vehic
 
	return chain_before | chain_after << 8 | (chain_before + chain_after + consecutive) << 16;
 
}
 

	
 
static uint32 VehicleGetVariable(Vehicle *v, const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 VehicleGetVariable(Vehicle *v, const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	/* Calculated vehicle parameters */
 
	switch (variable) {
 
@@ -837,7 +837,7 @@ static uint32 VehicleGetVariable(Vehicle
 
	return UINT_MAX;
 
}
 

	
 
static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	Vehicle *v = const_cast<Vehicle*>(GRV(object));
 

	
src/newgrf_generic.cpp
Show inline comments
 
@@ -85,7 +85,7 @@ static void GenericCallbackSetTriggers(c
 
}
 

	
 

	
 
static uint32 GenericCallbackGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 GenericCallbackGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	DEBUG(grf, 1, "Unhandled generic feature variable 0x%02X", variable);
 

	
 
@@ -93,7 +93,7 @@ static uint32 GenericCallbackGetVariable
 
	return UINT_MAX;
 
}
 

	
 
static uint32 GenericAiCallbackGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 GenericAiCallbackGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	switch (variable) {
 
		case 0x40: return object->grffile->cargo_map[object->u.generic.cargo_type];
src/newgrf_house.cpp
Show inline comments
 
@@ -254,7 +254,7 @@ static uint32 GetDistanceFromNearbyHouse
 
 *
 
 * Used by the resolver to get values for feature 07 deterministic spritegroups.
 
 */
 
static uint32 HouseGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 HouseGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	Town *town = object->u.house.town;
 
	TileIndex tile   = object->u.house.tile;
src/newgrf_industries.cpp
Show inline comments
 
@@ -170,7 +170,7 @@ static uint32 GetCountAndDistanceOfClose
 
 * @param available will return false if ever the variable asked for does not exist
 
 * @return the value stored in the corresponding variable
 
 */
 
uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
uint32 IndustryGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	const Industry *industry = object->u.industry.ind;
 
	TileIndex tile = object->u.industry.tile;
 
@@ -456,7 +456,7 @@ uint16 GetIndustryCallback(CallbackID ca
 
	return group->GetCallbackResult();
 
}
 

	
 
uint32 IndustryLocationGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
uint32 IndustryLocationGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	const Industry *industry = object->u.industry.ind;
 
	TileIndex tile = object->u.industry.tile;
src/newgrf_industries.h
Show inline comments
 
@@ -35,7 +35,7 @@ enum IndustryAvailabilityCallType {
 
};
 

	
 
/* in newgrf_industry.cpp */
 
uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available);
 
uint32 IndustryGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available);
 
uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile);
 
uint32 GetIndustryIDAtOffset(TileIndex new_tile, const Industry *i, uint32 cur_grfid);
 
void IndustryProductionCallback(Industry *ind, int reason);
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -61,7 +61,7 @@ uint32 GetRelativePosition(TileIndex til
 
	return ((y & 0xF) << 20) | ((x & 0xF) << 16) | (y << 8) | x;
 
}
 

	
 
static uint32 IndustryTileGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 IndustryTileGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	const Industry *inds = object->u.industry.ind;
 
	TileIndex tile       = object->u.industry.tile;
src/newgrf_object.cpp
Show inline comments
 
@@ -222,7 +222,7 @@ static uint32 GetCountAndDistanceOfClose
 
}
 

	
 
/** Used by the resolver to get values for feature 0F deterministic spritegroups. */
 
static uint32 ObjectGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 ObjectGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	const Object *o = object->u.object.o;
 
	TileIndex tile = object->u.object.tile;
src/newgrf_railtype.cpp
Show inline comments
 
@@ -32,7 +32,7 @@ static void RailTypeSetTriggers(const Re
 
{
 
}
 

	
 
static uint32 RailTypeGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 RailTypeGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	TileIndex tile = object->u.routes.tile;
 

	
src/newgrf_spritegroup.cpp
Show inline comments
 
@@ -38,7 +38,7 @@ RandomizedSpriteGroup::~RandomizedSprite
 
TemporaryStorageArray<int32, 0x110> _temp_store;
 

	
 

	
 
static inline uint32 GetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static inline uint32 GetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	/* First handle variables common with Action7/9/D */
 
	uint32 value;
src/newgrf_spritegroup.h
Show inline comments
 
@@ -383,7 +383,7 @@ struct ResolverObject {
 
	uint32 (*GetRandomBits)(const struct ResolverObject*);
 
	uint32 (*GetTriggers)(const struct ResolverObject*);
 
	void (*SetTriggers)(const struct ResolverObject*, int);
 
	uint32 (*GetVariable)(const struct ResolverObject*, byte, byte, bool*);
 
	uint32 (*GetVariable)(const struct ResolverObject *object, byte variable, uint32 parameter, bool *available);
 
	const SpriteGroup *(*ResolveReal)(const struct ResolverObject*, const RealSpriteGroup*);
 
	void (*StorePSA)(struct ResolverObject*, uint, int32);
 

	
src/newgrf_station.cpp
Show inline comments
 
@@ -257,7 +257,7 @@ static struct {
 
	uint8 valid; ///< Bits indicating what variable is valid (for each bit, \c 0 is invalid, \c 1 is valid).
 
} _svc;
 

	
 
static uint32 StationGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
static uint32 StationGetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
{
 
	const BaseStation *st = object->u.station.st;
 
	TileIndex tile = object->u.station.tile;
src/newgrf_town.cpp
Show inline comments
 
@@ -24,7 +24,7 @@
 
 * @param caller_grffile #GRFFile of the entity asking for a town variable.
 
 * @return the value stored in the corresponding variable
 
 */
 
uint32 TownGetVariable(byte variable, byte parameter, bool *available, Town *t, const GRFFile *caller_grffile)
 
uint32 TownGetVariable(byte variable, uint32 parameter, bool *available, Town *t, const GRFFile *caller_grffile)
 
{
 
	switch (variable) {
 
		/* Larger towns */
src/newgrf_town.h
Show inline comments
 
@@ -17,7 +17,7 @@
 
/* Currently there is no direct town resolver; we only need to get town
 
 * variable results from inside stations, house tiles and industries,
 
 * and to check the town's persistent storage. */
 
uint32 TownGetVariable(byte variable, byte parameter, bool *available, Town *t, const GRFFile *caller_grffile);
 
uint32 TownGetVariable(byte variable, uint32 parameter, bool *available, Town *t, const GRFFile *caller_grffile);
 
void TownStorePSA(Town *t, const GRFFile *caller_grffile, uint pos, int32 value);
 

	
 
#endif /* NEWGRF_TOWN_H */
0 comments (0 inline, 0 general)