summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-09-30 18:54:33 +0000
committerfrosch <frosch@openttd.org>2009-09-30 18:54:33 +0000
commit3863742c725a256735c83260fbc7c015f9b92866 (patch)
tree7ba245a48c5f125c4916b31f7deb1f4ddf1972cd /src
parentd8eec0ebf0540954b5c52524d2a2d1478e94b7d8 (diff)
downloadopenttd-3863742c725a256735c83260fbc7c015f9b92866.tar.xz
(svn r17671) -Codechange: Move ResolverObject::info_view into u.vehicle as it is only needed for them.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_engine.cpp7
-rw-r--r--src/newgrf_spritegroup.h3
2 files changed, 4 insertions, 6 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index 4a566fe30..a5ee58d47 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -724,7 +724,7 @@ static uint32 VehicleGetVariable(const ResolverObject *object, byte variable, by
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;
@@ -862,8 +862,7 @@ static inline void NewVehicleResolver(ResolverObject *res, EngineID engine_type,
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;
@@ -945,7 +944,7 @@ SpriteID GetRotorOverrideSprite(EngineID engine, const Aircraft *v, bool info_vi
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);
diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h
index 0f2ffbb3a..0382de7c6 100644
--- a/src/newgrf_spritegroup.h
+++ b/src/newgrf_spritegroup.h
@@ -296,8 +296,6 @@ struct ResolverObject {
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
@@ -307,6 +305,7 @@ struct ResolverObject {
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;