(svn r16393) -Codechange: move VehicleRail to Train.

This commit is contained in:
rubidium
2009-05-22 22:55:41 +00:00
parent 6350648a6c
commit 4c0542c17f
18 changed files with 136 additions and 136 deletions

View File

@@ -7,7 +7,6 @@
#include "vehicle_type.h"
#include "track_type.h"
#include "rail_type.h"
#include "cargo_type.h"
#include "direction_type.h"
#include "gfx_type.h"
@@ -44,39 +43,6 @@ enum VehicleFlags {
VF_AUTOFILL_PRES_WAIT_TIME, ///< Whether non-destructive auto-fill should preserve waiting times
};
struct VehicleRail {
/* Cached wagon override spritegroup */
const struct SpriteGroup *cached_override;
uint16 last_speed; // NOSAVE: only used in UI
/* cached values, recalculated on load and each time a vehicle is added to/removed from the consist. */
uint32 cached_power; ///< total power of the consist.
uint16 cached_max_speed; ///< max speed of the consist. (minimum of the max speed of all vehicles in the consist)
uint16 cached_total_length; ///< Length of the whole train, valid only for first engine.
uint8 cached_veh_length; ///< length of this vehicle in units of 1/8 of normal length, cached because this can be set by a callback
bool cached_tilt; ///< train can tilt; feature provides a bonus in curves
/* cached values, recalculated when the cargo on a train changes (in addition to the conditions above) */
uint32 cached_weight; ///< total weight of the consist.
uint32 cached_veh_weight; ///< weight of the vehicle.
uint32 cached_max_te; ///< max tractive effort of consist
/**
* Position/type of visual effect.
* bit 0 - 3 = position of effect relative to vehicle. (0 = front, 8 = centre, 15 = rear)
* bit 4 - 5 = type of effect. (0 = default for engine class, 1 = steam, 2 = diesel, 3 = electric)
* bit 6 = disable visual effect.
* bit 7 = disable powered wagons.
*/
byte cached_vis_effect;
byte user_def_data;
/* NOSAVE: for wagon override - id of the first engine in train
* 0xffff == not in train */
EngineID first_engine;
};
typedef Pool<Vehicle, VehicleID, 512, 64000> VehiclePool;
extern VehiclePool _vehicle_pool;
@@ -204,10 +170,6 @@ public:
byte subtype; ///< subtype (Filled with values from EffectVehicles/TrainSubTypes/AircraftSubTypes)
union {
VehicleRail rail;
} u;
/* cached oftenly queried NewGRF values */
uint8 cache_valid; ///< Whether the caches are valid
uint32 cached_var40; ///< Cache for NewGRF var 40