diff options
author | darkvater <darkvater@openttd.org> | 2004-11-13 16:28:50 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2004-11-13 16:28:50 +0000 |
commit | 7690093b4cd450e1049e1eb2eadec4c37d42e057 (patch) | |
tree | 77ad16b0fbb66ce1650b5085ea1acc737f0119f1 /engine.h | |
parent | b5e1240a8a53b99be29492b6f0136f6f4d71d9a0 (diff) | |
download | openttd-7690093b4cd450e1049e1eb2eadec4c37d42e057.tar.xz |
(svn r565) -newgrf: fixed double work of RoadVehicleInfo[]; added AircraftVehicleInfo[] as well. table/engines.h is now the same as in the _map branch.
Diffstat (limited to 'engine.h')
-rw-r--r-- | engine.h | 49 |
1 files changed, 33 insertions, 16 deletions
@@ -14,7 +14,7 @@ typedef struct RailVehicleInfo { byte cargo_type; } RailVehicleInfo; -typedef struct RoadVehicleInfo { +typedef struct ShipVehicleInfo { byte image_index; byte base_cost; uint16 max_speed; @@ -22,19 +22,30 @@ typedef struct RoadVehicleInfo { uint16 capacity; byte running_cost; byte sfx; -} RoadVehicleInfo; + byte refittable; +} ShipVehicleInfo; -typedef struct ShipVehicleInfo { +typedef struct AircraftVehicleInfo { byte image_index; byte base_cost; - uint16 max_speed; - byte cargo_type; - uint16 capacity; byte running_cost; + byte subtype; byte sfx; - byte refittable; -} ShipVehicleInfo; + byte acceleration; + byte max_speed; + byte mail_capacity; + uint16 passanger_capacity; +} AircraftVehicleInfo; +typedef struct RoadVehicleInfo { + byte image_index; + byte base_cost; + byte running_cost; + byte sfx; + byte max_speed; + byte capacity; + byte cargo_type; +} RoadVehicleInfo; typedef struct EngineInfo { uint16 base_intro; @@ -133,21 +144,27 @@ enum { NUM_ROAD_ENGINES = 88, NUM_SHIP_ENGINES = 11, NUM_AIRCRAFT_ENGINES = 41, - TOTAL_NUM_ENGINES = NUM_NORMAL_RAIL_ENGINES+NUM_MONORAIL_ENGINES+NUM_MAGLEV_ENGINES+NUM_ROAD_ENGINES+NUM_SHIP_ENGINES+NUM_AIRCRAFT_ENGINES, + TOTAL_NUM_ENGINES = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES + NUM_SHIP_ENGINES + NUM_AIRCRAFT_ENGINES, AIRCRAFT_ENGINES_INDEX = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES + NUM_SHIP_ENGINES, SHIP_ENGINES_INDEX = NUM_TRAIN_ENGINES + NUM_ROAD_ENGINES, ROAD_ENGINES_INDEX = NUM_TRAIN_ENGINES, }; VARDEF Engine _engines[TOTAL_NUM_ENGINES]; +#define DEREF_ENGINE(i) (&_engines[i]) VARDEF StringID _engine_name_strings[TOTAL_NUM_ENGINES]; +/* Access Vehicle Data */ +//#include "table/engines.h" extern EngineInfo _engine_info[TOTAL_NUM_ENGINES]; -extern RailVehicleInfo _rail_vehicle_info[]; -#define road_vehicle_info(e) (&_road_vehicle_info[e - ROAD_ENGINES_INDEX]) -extern RoadVehicleInfo _road_vehicle_info[]; -/* TODO: Change this to return a pointer instead, for the sake of consistency. - * --pasky */ +extern RailVehicleInfo _rail_vehicle_info[NUM_TRAIN_ENGINES]; +extern ShipVehicleInfo _ship_vehicle_info[NUM_SHIP_ENGINES]; +extern AircraftVehicleInfo _aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES]; +extern RoadVehicleInfo _road_vehicle_info[NUM_ROAD_ENGINES]; +/* TODO: Change this to return a pointer type instead, for the sake of consistency. + * --pasky. XXX - really needed? Why?. Best to remove the pointer type as well cause + * _map uses it that way...less conflicts - Darkvater */ +#define rail_vehinfo(e) _rail_vehicle_info[e] #define ship_vehicle_info(e) _ship_vehicle_info[e - SHIP_ENGINES_INDEX] -extern ShipVehicleInfo _ship_vehicle_info[]; - +#define aircraft_vehinfo(e) _aircraft_vehicle_info[e - AIRCRAFT_ENGINES_INDEX] +#define road_vehicle_info(e) (&_road_vehicle_info[e - ROAD_ENGINES_INDEX]) #endif |