Changeset - r19723:ed364738c640
[Not reviewed]
master
0 15 0
alberth - 12 years ago 2012-11-10 20:37:31
alberth@openttd.org
(svn r24678) -Codechange: Introduce scope resolver base class and prepare for adding derived classes.
15 files changed with 173 insertions and 29 deletions:
0 comments (0 inline, 0 general)
src/newgrf_airport.cpp
Show inline comments
 
@@ -214,13 +214,13 @@ void AirportStorePSA(ResolverObject *obj
 
static void NewAirportResolver(ResolverObject *res, TileIndex tile, Station *st, byte airport_id, byte layout)
 
{
 
	res->GetRandomBits = AirportGetRandomBits;
 
	res->GetTriggers   = AirportGetTriggers;
 
	res->SetTriggers   = AirportSetTriggers;
 
	res->GetVariable   = AirportGetVariable;
 
	res->ResolveReal   = AirportResolveReal;
 
	res->ResolveRealMethod = AirportResolveReal;
 
	res->StorePSA      = AirportStorePSA;
 

	
 
	res->u.airport.st         = st;
 
	res->u.airport.airport_id = airport_id;
 
	res->u.airport.layout     = layout;
 
	res->u.airport.tile       = tile;
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -223,13 +223,13 @@ static uint32 AirportTileGetRandomBits(c
 
static void AirportTileResolver(ResolverObject *res, const AirportTileSpec *ats, TileIndex tile, Station *st)
 
{
 
	res->GetRandomBits = AirportTileGetRandomBits;
 
	res->GetTriggers   = NULL;
 
	res->SetTriggers   = NULL;
 
	res->GetVariable   = AirportTileGetVariable;
 
	res->ResolveReal   = AirportTileResolveReal;
 
	res->ResolveRealMethod = AirportTileResolveReal;
 
	res->StorePSA      = NULL;
 

	
 
	assert(st != NULL);
 
	res->u.airport.airport_id = st->airport.type;
 
	res->u.airport.st         = st;
 
	res->u.airport.tile       = tile;
src/newgrf_canal.cpp
Show inline comments
 
@@ -79,13 +79,13 @@ static const SpriteGroup *CanalResolveRe
 
static void NewCanalResolver(ResolverObject *res, TileIndex tile, const GRFFile *grffile)
 
{
 
	res->GetRandomBits = &CanalGetRandomBits;
 
	res->GetTriggers   = &CanalGetTriggers;
 
	res->SetTriggers   = &CanalSetTriggers;
 
	res->GetVariable   = &CanalGetVariable;
 
	res->ResolveReal   = &CanalResolveReal;
 
	res->ResolveRealMethod = &CanalResolveReal;
 

	
 
	res->u.canal.tile = tile;
 

	
 
	res->callback        = CBID_NO_CALLBACK;
 
	res->callback_param1 = 0;
 
	res->callback_param2 = 0;
src/newgrf_cargo.cpp
Show inline comments
 
@@ -54,13 +54,13 @@ static const SpriteGroup *CargoResolveRe
 
static void NewCargoResolver(ResolverObject *res, const CargoSpec *cs)
 
{
 
	res->GetRandomBits = &CargoGetRandomBits;
 
	res->GetTriggers   = &CargoGetTriggers;
 
	res->SetTriggers   = &CargoSetTriggers;
 
	res->GetVariable   = &CargoGetVariable;
 
	res->ResolveReal   = &CargoResolveReal;
 
	res->ResolveRealMethod = &CargoResolveReal;
 

	
 
	res->u.cargo.cs = cs;
 

	
 
	res->callback        = CBID_NO_CALLBACK;
 
	res->callback_param1 = 0;
 
	res->callback_param2 = 0;
src/newgrf_debug_gui.cpp
Show inline comments
 
@@ -159,13 +159,13 @@ public:
 
	 */
 
	virtual uint Resolve(uint index, uint var, uint param, bool *avail) const
 
	{
 
		ResolverObject ro;
 
		memset(&ro, 0, sizeof(ro));
 
		this->Resolve(&ro, index);
 
		return ro.GetVariable(&ro, var, param, avail);
 
		return ro.GetScope(ro.scope)->GetVariable(var, param, avail);
 
	}
 

	
 
	/**
 
	 * Used to decide if the PSA needs a parameter or not.
 
	 * @return True iff this item has a PSA that requires a parameter.
 
	 */
src/newgrf_engine.cpp
Show inline comments
 
@@ -935,13 +935,13 @@ static const SpriteGroup *VehicleResolve
 
static inline void NewVehicleResolver(ResolverObject *res, EngineID engine_type, const Vehicle *v)
 
{
 
	res->GetRandomBits = &VehicleGetRandomBits;
 
	res->GetTriggers   = &VehicleGetTriggers;
 
	res->SetTriggers   = &VehicleSetTriggers;
 
	res->GetVariable   = &VehicleGetVariable;
 
	res->ResolveReal   = &VehicleResolveReal;
 
	res->ResolveRealMethod = &VehicleResolveReal;
 

	
 
	res->u.vehicle.self   = v;
 
	res->u.vehicle.parent = (v != NULL) ? v->First() : v;
 

	
 
	res->u.vehicle.self_type = engine_type;
 
	res->u.vehicle.info_view = false;
 
@@ -1327,12 +1327,12 @@ void FillNewGRFVehicleCache(const Vehicl
 

	
 
	/* Resolve all the variables, so their caches are set. */
 
	for (size_t i = 0; i < lengthof(cache_entries); i++) {
 
		/* Only resolve when the cache isn't valid. */
 
		if (HasBit(v->grf_cache.cache_valid, cache_entries[i][1])) continue;
 
		bool stub;
 
		ro.GetVariable(&ro, cache_entries[i][0], 0, &stub);
 
		ro.GetScope(ro.scope)->GetVariable(cache_entries[i][0], 0, &stub);
 
	}
 

	
 
	/* Make sure really all bits are set. */
 
	assert(v->grf_cache.cache_valid == (1 << NCVV_END) - 1);
 
}
src/newgrf_generic.cpp
Show inline comments
 
@@ -127,13 +127,13 @@ static const SpriteGroup *GenericCallbac
 
static inline void NewGenericResolver(ResolverObject *res, bool ai_callback)
 
{
 
	res->GetRandomBits = &GenericCallbackGetRandomBits;
 
	res->GetTriggers   = &GenericCallbackGetTriggers;
 
	res->SetTriggers   = &GenericCallbackSetTriggers;
 
	res->GetVariable   = ai_callback ? &GenericAiCallbackGetVariable : &GenericCallbackGetVariable;
 
	res->ResolveReal   = &GenericCallbackResolveReal;
 
	res->ResolveRealMethod = &GenericCallbackResolveReal;
 

	
 
	res->callback        = CBID_NO_CALLBACK;
 
	res->callback_param1 = 0;
 
	res->callback_param2 = 0;
 
	res->ResetState();
 
}
src/newgrf_house.cpp
Show inline comments
 
@@ -420,13 +420,13 @@ void HouseStorePSA(ResolverObject *objec
 
static void NewHouseResolver(ResolverObject *res, HouseID house_id, TileIndex tile, Town *town)
 
{
 
	res->GetRandomBits = HouseGetRandomBits;
 
	res->GetTriggers   = HouseGetTriggers;
 
	res->SetTriggers   = HouseSetTriggers;
 
	res->GetVariable   = HouseGetVariable;
 
	res->ResolveReal   = HouseResolveReal;
 
	res->ResolveRealMethod = HouseResolveReal;
 
	res->StorePSA      = HouseStorePSA;
 

	
 
	res->u.house.tile     = tile;
 
	res->u.house.town     = town;
 
	res->u.house.house_id = house_id;
 
	res->u.house.not_yet_constructed = false;
src/newgrf_industries.cpp
Show inline comments
 
@@ -407,13 +407,13 @@ void IndustryStorePSA(ResolverObject *ob
 
static void NewIndustryResolver(ResolverObject *res, TileIndex tile, Industry *indus, IndustryType type)
 
{
 
	res->GetRandomBits = IndustryGetRandomBits;
 
	res->GetTriggers   = IndustryGetTriggers;
 
	res->SetTriggers   = IndustrySetTriggers;
 
	res->GetVariable   = IndustryGetVariable;
 
	res->ResolveReal   = IndustryResolveReal;
 
	res->ResolveRealMethod = IndustryResolveReal;
 
	res->StorePSA      = IndustryStorePSA;
 

	
 
	res->u.industry.tile = tile;
 
	res->u.industry.ind  = indus;
 
	res->u.industry.gfx  = INVALID_INDUSTRYTILE;
 
	res->u.industry.type = type;
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -173,13 +173,13 @@ void IndustryTileStorePSA(ResolverObject
 
static void NewIndustryTileResolver(ResolverObject *res, IndustryGfx gfx, TileIndex tile, Industry *indus)
 
{
 
	res->GetRandomBits = IndustryTileGetRandomBits;
 
	res->GetTriggers   = IndustryTileGetTriggers;
 
	res->SetTriggers   = IndustryTileSetTriggers;
 
	res->GetVariable   = IndustryTileGetVariable;
 
	res->ResolveReal   = IndustryTileResolveReal;
 
	res->ResolveRealMethod = IndustryTileResolveReal;
 
	res->StorePSA      = IndustryTileStorePSA;
 

	
 
	res->u.industry.tile = tile;
 
	res->u.industry.ind  = indus;
 
	res->u.industry.gfx  = gfx;
 
	res->u.industry.type = indus->type;
src/newgrf_object.cpp
Show inline comments
 
@@ -395,13 +395,13 @@ void ObjectStorePSA(ResolverObject *obje
 
static void NewObjectResolver(ResolverObject *res, const ObjectSpec *spec, Object *o, TileIndex tile, uint8 view = 0)
 
{
 
	res->GetRandomBits = ObjectGetRandomBits;
 
	res->GetTriggers   = ObjectGetTriggers;
 
	res->SetTriggers   = ObjectSetTriggers;
 
	res->GetVariable   = ObjectGetVariable;
 
	res->ResolveReal   = ObjectResolveReal;
 
	res->ResolveRealMethod = ObjectResolveReal;
 
	res->StorePSA      = ObjectStorePSA;
 

	
 
	res->u.object.o    = o;
 
	res->u.object.tile = tile;
 
	res->u.object.view = view;
 

	
src/newgrf_railtype.cpp
Show inline comments
 
@@ -80,13 +80,13 @@ static const SpriteGroup *RailTypeResolv
 
static inline void NewRailTypeResolver(ResolverObject *res, TileIndex tile, TileContext context, const GRFFile *grffile, uint32 param1 = 0, uint32 param2 = 0)
 
{
 
	res->GetRandomBits = &RailTypeGetRandomBits;
 
	res->GetTriggers   = &RailTypeGetTriggers;
 
	res->SetTriggers   = &RailTypeSetTriggers;
 
	res->GetVariable   = &RailTypeGetVariable;
 
	res->ResolveReal   = &RailTypeResolveReal;
 
	res->ResolveRealMethod = &RailTypeResolveReal;
 

	
 
	res->u.routes.tile = tile;
 
	res->u.routes.context = context;
 

	
 
	res->callback        = CBID_NO_CALLBACK;
 
	res->callback_param1 = param1;
src/newgrf_spritegroup.cpp
Show inline comments
 
@@ -7,12 +7,13 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file newgrf_spritegroup.cpp Handling of primarily NewGRF action 2. */
 

	
 
#include "stdafx.h"
 
#include "debug.h"
 
#include "newgrf_spritegroup.h"
 
#include "core/pool_func.hpp"
 

	
 
SpriteGroupPool _spritegroup_pool("SpriteGroup");
 
INSTANTIATE_POOL_METHODS(SpriteGroup)
 

	
 
@@ -33,38 +34,147 @@ RandomizedSpriteGroup::~RandomizedSprite
 
	free(this->groups);
 
}
 

	
 
TemporaryStorageArray<int32, 0x110> _temp_store;
 

	
 

	
 
static inline uint32 GetVariable(const ResolverObject *object, byte variable, uint32 parameter, bool *available)
 
static inline uint32 GetVariable(const ResolverObject *object, ScopeResolver *scope, byte variable, uint32 parameter, bool *available)
 
{
 
	/* First handle variables common with Action7/9/D */
 
	uint32 value;
 
	if (GetGlobalVariable(variable, &value, object->grffile)) return value;
 

	
 
	/* Non-common variable */
 
	switch (variable) {
 
		case 0x0C: return object->callback;
 
		case 0x10: return object->callback_param1;
 
		case 0x18: return object->callback_param2;
 
		case 0x1C: return object->last_value;
 

	
 
		case 0x5F: return (object->GetRandomBits(object) << 8) | object->GetTriggers(object);
 
		case 0x5F: return (scope->GetRandomBits() << 8) | scope->GetTriggers();
 

	
 
		case 0x7D: return _temp_store.GetValue(parameter);
 

	
 
		case 0x7F:
 
			if (object == NULL || object->grffile == NULL) return 0;
 
			return object->grffile->GetParam(parameter);
 

	
 
		/* Not a common variable, so evalute the feature specific variables */
 
		default: return object->GetVariable(object, variable, parameter, available);
 
		default: return scope->GetVariable(variable, parameter, available);
 
	}
 
}
 

	
 
ScopeResolver::ScopeResolver(ResolverObject *ro)
 
{
 
	this->ro = ro;
 
}
 

	
 
ScopeResolver::~ScopeResolver() {}
 

	
 
/**
 
 * Get a few random bits. Default implementation has no random bits.
 
 * @return Random bits.
 
 */
 
/* virtual */ uint32 ScopeResolver::GetRandomBits() const
 
{
 
	return 0;
 
}
 

	
 
/**
 
 * Get the triggers. Base class returns \c 0 to prevent trouble.
 
 * @return The triggers.
 
 */
 
/* virtual */ uint32 ScopeResolver::GetTriggers() const
 
{
 
	return 0;
 
}
 

	
 
/**
 
 * Set the triggers. Base class implementation does nothing.
 
 * @param triggers Triggers to set.
 
 */
 
/* virtual */ void ScopeResolver::SetTriggers(int triggers) const {}
 

	
 
/**
 
 * Get a variable value. Default implementation has no available variables.
 
 * @param variable Variable to read
 
 * @param parameter Parameter for 60+x variables
 
 * @param[out] available Set to false, in case the variable does not exist.
 
 * @return Value
 
 */
 
/* virtual */ uint32 ScopeResolver::GetVariable(byte variable, uint32 parameter, bool *available) const
 
{
 
	DEBUG(grf, 1, "Unhandled scope variable 0x%X", variable);
 
	*available = false;
 
	return UINT_MAX;
 
}
 

	
 
/**
 
 * Store a value into the persistent storage area (PSA). Default implementation does nothing (for newgrf classes without storage).
 
 * @param pos Position to store into.
 
 * @param value Value to store.
 
 */
 
/* virtual */ void ScopeResolver::StorePSA(uint reg, int32 value) {}
 

	
 

	
 
TempScopeResolver::TempScopeResolver(ResolverObject *ro) : ScopeResolver(ro) {}
 

	
 
/* virtual */ uint32 TempScopeResolver::GetRandomBits() const
 
{
 
	return this->ro->GetRandomBits(this->ro);
 
}
 

	
 
/* virtual */ uint32 TempScopeResolver::GetTriggers() const
 
{
 
	return this->ro->GetTriggers(this->ro);
 
}
 

	
 
/* virtual */ void TempScopeResolver::SetTriggers(int triggers) const
 
{
 
	this->ro->SetTriggers(this->ro, triggers);
 
}
 

	
 
/* virtual */ uint32 TempScopeResolver::GetVariable(byte variable, uint32 parameter, bool *available) const
 
{
 
	return this->ro->GetVariable(this->ro, variable, parameter, available);
 
}
 

	
 
/* virtual */ void TempScopeResolver::StorePSA(uint reg, int32 value)
 
{
 
	if (this->ro->StorePSA != NULL) this->ro->StorePSA(this->ro, reg, value);
 
}
 

	
 
ResolverObject::ResolverObject() : temp_scope(this) {} // XXX Temporary
 

	
 
ResolverObject::ResolverObject(const GRFFile *grffile, CallbackID callback, uint32 callback_param1, uint32 callback_param2) : temp_scope(this)
 
{
 
	this->callback = callback;
 
	this->callback_param1 = callback_param1;
 
	this->callback_param2 = callback_param2;
 
	this->ResetState();
 

	
 
	this->grffile = grffile;
 
}
 

	
 
ResolverObject::~ResolverObject() {}
 

	
 
/* virtual */ const SpriteGroup *ResolverObject::ResolveReal(const RealSpriteGroup *group) const
 
{
 
	return this->ResolveRealMethod(this, group);
 
}
 

	
 
/**
 
 * Get a specific ScopeResolver.
 
 * @param scope Scope to return.
 
 * @param relative Additional parameter for #VSG_SCOPE_RELATIVE.
 
 * @return ScopeResolver.
 
 */
 
/* virtual */ ScopeResolver *ResolverObject::GetScope(VarSpriteGroupScope scope, byte relative)
 
{
 
	return &this->temp_scope;
 
}
 

	
 
/**
 
 * Rotate val rot times to the right
 
 * @param val the value to rotate
 
 * @param rot the amount of times to rotate
 
 * @return the rotated value
 
@@ -108,13 +218,13 @@ static U EvalAdjustT(const Deterministic
 
		case DSGA_OP_MUL:  return last_value * value;
 
		case DSGA_OP_AND:  return last_value & value;
 
		case DSGA_OP_OR:   return last_value | value;
 
		case DSGA_OP_XOR:  return last_value ^ value;
 
		case DSGA_OP_STO:  _temp_store.StoreValue((U)value, (S)last_value); return last_value;
 
		case DSGA_OP_RST:  return value;
 
		case DSGA_OP_STOP: if (object->StorePSA != NULL) object->StorePSA(object, (U)value, (S)last_value); return last_value;
 
		case DSGA_OP_STOP: object->GetScope(object->scope)->StorePSA((U)value, (S)last_value); return last_value;
 
		case DSGA_OP_ROR:  return RotateRight(last_value, value);
 
		case DSGA_OP_SCMP: return ((S)last_value == (S)value) ? 1 : ((S)last_value < (S)value ? 0 : 2);
 
		case DSGA_OP_UCMP: return ((U)last_value == (U)value) ? 1 : ((U)last_value < (U)value ? 0 : 2);
 
		case DSGA_OP_SHL:  return (U)last_value << ((U)value & 0x1F); // mask 'value' to 5 bits, which should behave the same on all architectures.
 
		case DSGA_OP_SHR:  return (U)last_value >> ((U)value & 0x1F);
 
		case DSGA_OP_SAR:  return (S)last_value >> ((U)value & 0x1F);
 
@@ -145,15 +255,15 @@ const SpriteGroup *DeterministicSpriteGr
 
			}
 

	
 
			/* Reset values to current scope.
 
			 * Note: 'last_value' and 'reseed' are shared between the main chain and the procedure */
 
			object->scope = this->var_scope;
 
		} else if (adjust->variable == 0x7B) {
 
			value = GetVariable(object, adjust->parameter, last_value, &available);
 
			value = GetVariable(object, object->GetScope(this->var_scope), adjust->parameter, last_value, &available);
 
		} else {
 
			value = GetVariable(object, adjust->variable, adjust->parameter, &available);
 
			value = GetVariable(object, object->GetScope(this->var_scope), adjust->variable, adjust->parameter, &available);
 
		}
 

	
 
		if (!available) {
 
			/* Unsupported variable: skip further processing and return either
 
			 * the group from the first range or the default group. */
 
			return SpriteGroup::Resolve(this->num_ranges > 0 ? this->ranges[0].group : this->default_group, object);
 
@@ -187,45 +297,43 @@ const SpriteGroup *DeterministicSpriteGr
 
	return SpriteGroup::Resolve(this->default_group, object);
 
}
 

	
 

	
 
const SpriteGroup *RandomizedSpriteGroup::Resolve(ResolverObject *object) const
 
{
 
	uint32 mask;
 
	byte index;
 

	
 
	object->scope = this->var_scope;
 
	object->count = this->count;
 

	
 
	ScopeResolver *scope = object->GetScope(this->var_scope, this->count);
 
	if (object->trigger != 0) {
 
		/* Handle triggers */
 
		/* Magic code that may or may not do the right things... */
 
		byte waiting_triggers = object->GetTriggers(object);
 
		byte waiting_triggers = scope->GetTriggers();
 
		byte match = this->triggers & (waiting_triggers | object->trigger);
 
		bool res = (this->cmp_mode == RSG_CMP_ANY) ? (match != 0) : (match == this->triggers);
 

	
 
		if (res) {
 
			waiting_triggers &= ~match;
 
			object->reseed[this->var_scope] |= (this->num_groups - 1) << this->lowest_randbit;
 
		} else {
 
			waiting_triggers |= object->trigger;
 
		}
 

	
 
		object->SetTriggers(object, waiting_triggers);
 
		scope->SetTriggers(waiting_triggers);
 
	}
 

	
 
	mask  = (this->num_groups - 1) << this->lowest_randbit;
 
	index = (object->GetRandomBits(object) & mask) >> this->lowest_randbit;
 
	uint32 mask  = (this->num_groups - 1) << this->lowest_randbit;
 
	byte index = (scope->GetRandomBits() & mask) >> this->lowest_randbit;
 

	
 
	return SpriteGroup::Resolve(this->groups[index], object);
 
}
 

	
 

	
 
const SpriteGroup *RealSpriteGroup::Resolve(ResolverObject *object) const
 
{
 
	return object->ResolveReal(object, this);
 
	return object->ResolveReal(this);
 
}
 

	
 
/**
 
 * Process registers and the construction stage into the sprite layout.
 
 * The passed construction stage might get reset to zero, if it gets incorporated into the layout
 
 * during the preprocessing.
src/newgrf_spritegroup.h
Show inline comments
 
@@ -298,14 +298,46 @@ struct IndustryProductionSpriteGroup : S
 
	uint8 version;
 
	int16 subtract_input[3];  // signed
 
	uint16 add_output[2];     // unsigned
 
	uint8 again;
 
};
 

	
 
struct ResolverObject;
 

	
 
struct ScopeResolver {
 
	ResolverObject *ro;
 

	
 
	ScopeResolver(ResolverObject *ro);
 
	virtual ~ScopeResolver();
 

	
 
	virtual uint32 GetRandomBits() const;
 
	virtual uint32 GetTriggers() const;
 
	virtual void SetTriggers(int triggers) const;
 

	
 
	virtual uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
 
	virtual void StorePSA(uint reg, int32 value);
 
};
 

	
 
struct TempScopeResolver : public ScopeResolver {
 
	TempScopeResolver(ResolverObject *ro);
 

	
 
	virtual uint32 GetRandomBits() const;
 
	virtual uint32 GetTriggers() const;
 
	virtual void SetTriggers(int triggers) const;
 

	
 
	virtual uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
 
	virtual void StorePSA(uint reg, int32 value);
 
};
 

	
 
struct ResolverObject {
 
	ResolverObject();
 
	ResolverObject(const GRFFile *grffile, CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
 
	virtual ~ResolverObject();
 

	
 
	TempScopeResolver temp_scope; ///< Temporary scope resolver to refer back to the methods of #ResolverObject.
 

	
 
	CallbackID callback;
 
	uint32 callback_param1;
 
	uint32 callback_param2;
 

	
 
	byte trigger;
 

	
 
@@ -379,15 +411,19 @@ struct ResolverObject {
 
	} u;
 

	
 
	uint32 (*GetRandomBits)(const struct ResolverObject*);
 
	uint32 (*GetTriggers)(const struct ResolverObject*);
 
	void (*SetTriggers)(const struct ResolverObject*, int);
 
	uint32 (*GetVariable)(const struct ResolverObject *object, byte variable, uint32 parameter, bool *available);
 
	const SpriteGroup *(*ResolveReal)(const struct ResolverObject*, const RealSpriteGroup*);
 
	const SpriteGroup *(*ResolveRealMethod)(const struct ResolverObject*, const RealSpriteGroup*);
 
	void (*StorePSA)(struct ResolverObject*, uint, int32);
 

	
 
	virtual const SpriteGroup *ResolveReal(const RealSpriteGroup *group) const;
 

	
 
	virtual ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0);
 

	
 
	/**
 
	 * Returns the OR-sum of all bits that need reseeding
 
	 * independent of the scope they were accessed with.
 
	 * @return OR-sum of the bits.
 
	 */
 
	uint32 GetReseedSum() const
src/newgrf_station.cpp
Show inline comments
 
@@ -547,13 +547,13 @@ void StationStorePSA(ResolverObject *obj
 
static void NewStationResolver(ResolverObject *res, const StationSpec *statspec, BaseStation *st, TileIndex tile)
 
{
 
	res->GetRandomBits = StationGetRandomBits;
 
	res->GetTriggers   = StationGetTriggers;
 
	res->SetTriggers   = StationSetTriggers;
 
	res->GetVariable   = StationGetVariable;
 
	res->ResolveReal   = StationResolveReal;
 
	res->ResolveRealMethod = StationResolveReal;
 
	res->StorePSA      = StationStorePSA;
 

	
 
	res->u.station.st       = st;
 
	res->u.station.statspec = statspec;
 
	res->u.station.tile     = tile;
 
	res->u.station.axis     = INVALID_AXIS;
0 comments (0 inline, 0 general)