diff options
author | frosch <frosch@openttd.org> | 2009-11-07 22:47:54 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-11-07 22:47:54 +0000 |
commit | ba1fc280e3b0c13baedc2ef54dabb2deec41c818 (patch) | |
tree | f8f51f5d18355d9205052bad2e90e068e9bfacb6 /src/table | |
parent | 7984d90c40f4d55cad9f34d0acac27beb701a63a (diff) | |
download | openttd-ba1fc280e3b0c13baedc2ef54dabb2deec41c818.tar.xz |
(svn r18005) -Codechange: Convert the Prices struct into an array and an enum.
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/engines.h | 19 | ||||
-rw-r--r-- | src/table/pricebase.h | 98 |
2 files changed, 59 insertions, 58 deletions
diff --git a/src/table/engines.h b/src/table/engines.h index 321b9f41a..6820da116 100644 --- a/src/table/engines.h +++ b/src/table/engines.h @@ -14,14 +14,6 @@ #ifndef ENGINES_H #define ENGINES_H -enum { - RC_W = 0xFF, ///< Running cost price index (out of range) of wagons - RC_S = 0x2A, ///< Running cost price index of steam - RC_D = 0x2B, ///< Running cost price index of diesel - RC_E = 0x2C, ///< Running cost price index of electric - RC_R = 0x2E, ///< Running cost price index of road vehicles -}; - /** Writes the properties of a train or road vehicle into the EngineInfo struct. * @see EngineInfo * @param a Introduction date @@ -378,6 +370,11 @@ static const EngineInfo _orig_engine_info[] = { #define O RAILTYPE_MONO #define L RAILTYPE_MAGLEV +#define RC_S PR_RUNNING_TRAIN_STEAM +#define RC_D PR_RUNNING_TRAIN_DIESEL +#define RC_E PR_RUNNING_TRAIN_ELECTRIC +#define RC_W INVALID_PRICE + static const RailVehicleInfo _orig_rail_vehicle_info[] = { /* image_index max_speed (kph) running_cost engclass * | flags | power (hp) | running_cost_class @@ -501,6 +498,10 @@ static const RailVehicleInfo _orig_rail_vehicle_info[] = { RVI(58, W, 193, 0, 0, 18, 0, RC_W, 32, L, A), // 114 RVI(59, W, 191, 0, 0, 18, 0, RC_W, 37, L, A), // 115 }; +#undef RC_W +#undef RC_E +#undef RC_D +#undef RC_S #undef L #undef O #undef C @@ -625,7 +626,7 @@ static const AircraftVehicleInfo _orig_aircraft_vehicle_info[] = { * @param g weight (1/4ton) * @param h power (10hp) */ -#define ROV(a, b, c, d, e, f, g, h) { a, b, c, RC_R, d, e, f, g, h, 76, 0 } +#define ROV(a, b, c, d, e, f, g, h) { a, b, c, PR_RUNNING_ROADVEH, d, e, f, g, h, 76, 0 } static const RoadVehicleInfo _orig_road_vehicle_info[] = { /* image_index sfx max_speed power * | base_cost | | capacity | diff --git a/src/table/pricebase.h b/src/table/pricebase.h index 364dd3f82..d42d2da1f 100644 --- a/src/table/pricebase.h +++ b/src/table/pricebase.h @@ -10,53 +10,53 @@ /** @file pricebase.h Price Bases */ static const PriceBaseSpec _price_base_specs[NUM_PRICES] = { - { 100, PCAT_NONE }, ///< station_value - { 100, PCAT_CONSTRUCTION}, ///< build_rail - { 95, PCAT_CONSTRUCTION}, ///< build_road - { 65, PCAT_CONSTRUCTION}, ///< build_signals - { 275, PCAT_CONSTRUCTION}, ///< build_bridge - { 600, PCAT_CONSTRUCTION}, ///< build_train_depot - { 500, PCAT_CONSTRUCTION}, ///< build_road_depot - { 700, PCAT_CONSTRUCTION}, ///< build_ship_depot - { 450, PCAT_CONSTRUCTION}, ///< build_tunnel - { 200, PCAT_CONSTRUCTION}, ///< train_station_track - { 180, PCAT_CONSTRUCTION}, ///< train_station_length - { 600, PCAT_CONSTRUCTION}, ///< build_airport - { 200, PCAT_CONSTRUCTION}, ///< build_bus_station - { 200, PCAT_CONSTRUCTION}, ///< build_truck_station - { 350, PCAT_CONSTRUCTION}, ///< build_dock - { 400000, PCAT_CONSTRUCTION}, ///< build_railvehicle - { 2000, PCAT_CONSTRUCTION}, ///< build_railwagon - { 700000, PCAT_CONSTRUCTION}, ///< aircraft_base - { 14000, PCAT_CONSTRUCTION}, ///< roadveh_base - { 65000, PCAT_CONSTRUCTION}, ///< ship_base - { 20, PCAT_CONSTRUCTION}, ///< build_trees - { 250, PCAT_CONSTRUCTION}, ///< terraform - { 20, PCAT_CONSTRUCTION}, ///< clear_grass - { 40, PCAT_CONSTRUCTION}, ///< clear_roughland - { 200, PCAT_CONSTRUCTION}, ///< clear_rocks - { 500, PCAT_CONSTRUCTION}, ///< clear_fields - { 20, PCAT_CONSTRUCTION}, ///< remove_trees - { -70, PCAT_CONSTRUCTION}, ///< remove_rail - { 10, PCAT_CONSTRUCTION}, ///< remove_signals - { 50, PCAT_CONSTRUCTION}, ///< clear_bridge - { 80, PCAT_CONSTRUCTION}, ///< remove_train_depot - { 80, PCAT_CONSTRUCTION}, ///< remove_road_depot - { 90, PCAT_CONSTRUCTION}, ///< remove_ship_depot - { 30, PCAT_CONSTRUCTION}, ///< clear_tunnel - { 10000, PCAT_CONSTRUCTION}, ///< clear_water - { 50, PCAT_CONSTRUCTION}, ///< remove_rail_station - { 30, PCAT_CONSTRUCTION}, ///< remove_airport - { 50, PCAT_CONSTRUCTION}, ///< remove_bus_station - { 50, PCAT_CONSTRUCTION}, ///< remove_truck_station - { 55, PCAT_CONSTRUCTION}, ///< remove_dock - { 1600, PCAT_CONSTRUCTION}, ///< remove_house - { 40, PCAT_CONSTRUCTION}, ///< remove_road - { 5600, PCAT_RUNNING }, ///< running_rail[0] steam - { 5200, PCAT_RUNNING }, ///< running_rail[1] diesel - { 4800, PCAT_RUNNING }, ///< running_rail[2] electric - { 9600, PCAT_RUNNING }, ///< aircraft_running - { 1600, PCAT_RUNNING }, ///< roadveh_running - { 5600, PCAT_RUNNING }, ///< ship_running - {1000000, PCAT_CONSTRUCTION}, ///< build_industry + { 100, PCAT_NONE }, ///< PR_STATION_VALUE + { 100, PCAT_CONSTRUCTION}, ///< PR_BUILD_RAIL + { 95, PCAT_CONSTRUCTION}, ///< PR_BUILD_ROAD + { 65, PCAT_CONSTRUCTION}, ///< PR_BUILD_SIGNALS + { 275, PCAT_CONSTRUCTION}, ///< PR_BUILD_BRIDGE + { 600, PCAT_CONSTRUCTION}, ///< PR_BUILD_DEPOT_TRAIN + { 500, PCAT_CONSTRUCTION}, ///< PR_BUILD_DEPOT_ROAD + { 700, PCAT_CONSTRUCTION}, ///< PR_BUILD_DEPOT_SHIP + { 450, PCAT_CONSTRUCTION}, ///< PR_BUILD_TUNNEL + { 200, PCAT_CONSTRUCTION}, ///< PR_BUILD_STATION_RAIL + { 180, PCAT_CONSTRUCTION}, ///< PR_BUILD_STATION_RAIL_LENGTH + { 600, PCAT_CONSTRUCTION}, ///< PR_BUILD_STATION_AIRPORT + { 200, PCAT_CONSTRUCTION}, ///< PR_BUILD_STATION_BUS + { 200, PCAT_CONSTRUCTION}, ///< PR_BUILD_STATION_TRUCK + { 350, PCAT_CONSTRUCTION}, ///< PR_BUILD_STATION_DOCK + { 400000, PCAT_CONSTRUCTION}, ///< PR_BUILD_VEHICLE_TRAIN + { 2000, PCAT_CONSTRUCTION}, ///< PR_BUILD_VEHICLE_WAGON + { 700000, PCAT_CONSTRUCTION}, ///< PR_BUILD_VEHICLE_AIRCRAFT + { 14000, PCAT_CONSTRUCTION}, ///< PR_BUILD_VEHICLE_ROAD + { 65000, PCAT_CONSTRUCTION}, ///< PR_BUILD_VEHICLE_SHIP + { 20, PCAT_CONSTRUCTION}, ///< PR_BUILD_TREES + { 250, PCAT_CONSTRUCTION}, ///< PR_TERRAFORM + { 20, PCAT_CONSTRUCTION}, ///< PR_CLEAR_GRASS + { 40, PCAT_CONSTRUCTION}, ///< PR_CLEAR_ROUGH + { 200, PCAT_CONSTRUCTION}, ///< PR_CLEAR_ROCKS + { 500, PCAT_CONSTRUCTION}, ///< PR_CLEAR_FILEDS + { 20, PCAT_CONSTRUCTION}, ///< PR_CLEAR_TREES + { -70, PCAT_CONSTRUCTION}, ///< PR_CLEAR_RAIL + { 10, PCAT_CONSTRUCTION}, ///< PR_CLEAR_SIGNALS + { 50, PCAT_CONSTRUCTION}, ///< PR_CLEAR_BRIDGE + { 80, PCAT_CONSTRUCTION}, ///< PR_CLEAR_DEPOT_TRAIN + { 80, PCAT_CONSTRUCTION}, ///< PR_CLEAR_DEPOT_ROAD + { 90, PCAT_CONSTRUCTION}, ///< PR_CLEAR_DEPOT_SHIP + { 30, PCAT_CONSTRUCTION}, ///< PR_CLEAR_TUNNEL + { 10000, PCAT_CONSTRUCTION}, ///< PR_CLEAR_WATER + { 50, PCAT_CONSTRUCTION}, ///< PR_CLEAR_STATION_RAIL + { 30, PCAT_CONSTRUCTION}, ///< PR_CLEAR_STATION_AIRPORT + { 50, PCAT_CONSTRUCTION}, ///< PR_CLEAR_STATION_BUS + { 50, PCAT_CONSTRUCTION}, ///< PR_CLEAR_STATION_TRUCK + { 55, PCAT_CONSTRUCTION}, ///< PR_CLEAR_STATION_DOCK + { 1600, PCAT_CONSTRUCTION}, ///< PR_CLEAR_HOUSE + { 40, PCAT_CONSTRUCTION}, ///< PR_CLEAR_ROAD + { 5600, PCAT_RUNNING }, ///< PR_RUNNING_TRAIN_STEAM + { 5200, PCAT_RUNNING }, ///< PR_RUNNING_TRAIN_DIESEL + { 4800, PCAT_RUNNING }, ///< PR_RUNNING_TRAIN_ELECTRIC + { 9600, PCAT_RUNNING }, ///< PR_RUNNING_AIRCRAFT + { 1600, PCAT_RUNNING }, ///< PR_RUNNING_ROADVEH + { 5600, PCAT_RUNNING }, ///< PR_RUNNING_SHIP + {1000000, PCAT_CONSTRUCTION}, ///< PR_BUILD_INDUSTRY }; |