Changeset - r13156:3067a72f5e13
[Not reviewed]
master
0 2 0
frosch - 15 years ago 2009-09-30 18:54:33
frosch@openttd.org
(svn r17671) -Codechange: Move ResolverObject::info_view into u.vehicle as it is only needed for them.
2 files changed with 4 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/newgrf_engine.cpp
Show inline comments
 
@@ -721,13 +721,13 @@ static uint32 VehicleGetVariable(const R
 
		case 0x19: return GB(v->max_speed, 8, 8);
 
		case 0x1A: return v->x_pos;
 
		case 0x1B: return GB(v->x_pos, 8, 8);
 
		case 0x1C: return v->y_pos;
 
		case 0x1D: return GB(v->y_pos, 8, 8);
 
		case 0x1E: return v->z_pos;
 
		case 0x1F: return object->info_view ? DIR_W : v->direction;
 
		case 0x1F: return object->u.vehicle.info_view ? DIR_W : v->direction;
 
		case 0x28: return v->cur_image;
 
		case 0x29: return GB(v->cur_image, 8, 8);
 
		case 0x32: return v->vehstatus;
 
		case 0x33: return 0; // non-existent high byte of vehstatus
 
		case 0x34: return v->cur_speed;
 
		case 0x35: return GB(v->cur_speed, 8, 8);
 
@@ -859,14 +859,13 @@ static inline void NewVehicleResolver(Re
 
	res->ResolveReal   = &VehicleResolveReal;
 

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

	
 
	res->u.vehicle.self_type = engine_type;
 

	
 
	res->info_view = false;
 
	res->u.vehicle.info_view = false;
 

	
 
	res->callback        = CBID_NO_CALLBACK;
 
	res->callback_param1 = 0;
 
	res->callback_param2 = 0;
 
	res->last_value      = 0;
 
	res->trigger         = 0;
 
@@ -942,13 +941,13 @@ SpriteID GetRotorOverrideSprite(EngineID
 
	assert(!(e->u.air.subtype & AIR_CTOL));
 

	
 
	ResolverObject object;
 

	
 
	NewVehicleResolver(&object, engine, v);
 

	
 
	object.info_view = info_view;
 
	object.u.vehicle.info_view = info_view;
 

	
 
	const SpriteGroup *group = GetWagonOverrideSpriteSet(engine, CT_DEFAULT, engine);
 
	group = SpriteGroup::Resolve(group, &object);
 

	
 
	if (group == NULL || group->GetNumResults() == 0) return 0;
 

	
src/newgrf_spritegroup.h
Show inline comments
 
@@ -293,23 +293,22 @@ struct ResolverObject {
 
	byte trigger;
 
	byte count;
 
	uint32 last_value;
 
	uint32 reseed;
 
	VarSpriteGroupScope scope;
 

	
 
	bool info_view; ///< Indicates if the item is being drawn in an info window
 

	
 
	BaseStorageArray *psa; ///< The persistent storage array of this resolved object.
 

	
 
	const GRFFile *grffile; ///< GRFFile the resolved SpriteGroup belongs to
 

	
 
	union {
 
		struct {
 
			const struct Vehicle *self;
 
			const struct Vehicle *parent;
 
			EngineID self_type;
 
			bool info_view;                ///< Indicates if the item is being drawn in an info window
 
		} vehicle;
 
		struct {
 
			TileIndex tile;
 
		} canal;
 
		struct {
 
			TileIndex tile;
0 comments (0 inline, 0 general)