diff options
-rw-r--r-- | projects/openttd.vcproj | 3 | ||||
-rw-r--r-- | projects/openttd_vs80.vcproj | 4 | ||||
-rw-r--r-- | projects/openttd_vs90.vcproj | 4 | ||||
-rw-r--r-- | source.list | 1 | ||||
-rw-r--r-- | src/ai/ai.h | 1 | ||||
-rw-r--r-- | src/ai/trolly/pathfinder.cpp | 1 | ||||
-rw-r--r-- | src/aircraft.h | 1 | ||||
-rw-r--r-- | src/aircraft_cmd.cpp | 1 | ||||
-rw-r--r-- | src/airport_gui.cpp | 1 | ||||
-rw-r--r-- | src/autoreplace_cmd.cpp | 1 | ||||
-rw-r--r-- | src/autoslope.h | 1 | ||||
-rw-r--r-- | src/build_vehicle_gui.cpp | 1 | ||||
-rw-r--r-- | src/depot.h | 18 | ||||
-rw-r--r-- | src/npf.cpp | 1 | ||||
-rw-r--r-- | src/oldloader.cpp | 1 | ||||
-rw-r--r-- | src/openttd.cpp | 1 | ||||
-rw-r--r-- | src/order.h | 15 | ||||
-rw-r--r-- | src/order_cmd.cpp | 6 | ||||
-rw-r--r-- | src/order_gui.cpp | 1 | ||||
-rw-r--r-- | src/rail.h | 1 | ||||
-rw-r--r-- | src/rail_cmd.cpp | 1 | ||||
-rw-r--r-- | src/road_cmd.cpp | 1 | ||||
-rw-r--r-- | src/roadveh.h | 1 | ||||
-rw-r--r-- | src/roadveh_cmd.cpp | 1 | ||||
-rw-r--r-- | src/ship.h | 1 | ||||
-rw-r--r-- | src/ship_cmd.cpp | 2 | ||||
-rw-r--r-- | src/station.cpp | 1 | ||||
-rw-r--r-- | src/station_cmd.cpp | 1 | ||||
-rw-r--r-- | src/train_cmd.cpp | 1 | ||||
-rw-r--r-- | src/train_gui.cpp | 1 | ||||
-rw-r--r-- | src/vehicle.cpp | 1 | ||||
-rw-r--r-- | src/water_cmd.cpp | 1 | ||||
-rw-r--r-- | src/yapf/yapf.hpp | 2 |
33 files changed, 56 insertions, 23 deletions
diff --git a/projects/openttd.vcproj b/projects/openttd.vcproj index 5f87f8ec7..b9c53cb7b 100644 --- a/projects/openttd.vcproj +++ b/projects/openttd.vcproj @@ -885,6 +885,9 @@ RelativePath=".\..\src\station_cmd.cpp"> </File> <File + RelativePath=".\..\src\terraform_cmd.cpp"> + </File> + <File RelativePath=".\..\src\timetable_cmd.cpp"> </File> <File diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index 25c509d8b..a7762d24e 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -1408,6 +1408,10 @@ > </File> <File + RelativePath=".\..\src\terraform_cmd.cpp" + > + </File> + <File RelativePath=".\..\src\timetable_cmd.cpp" > </File> diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 3e76ade15..1a074660f 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -1405,6 +1405,10 @@ > </File> <File + RelativePath=".\..\src\terraform_cmd.cpp" + > + </File> + <File RelativePath=".\..\src\timetable_cmd.cpp" > </File> diff --git a/source.list b/source.list index 318039a8d..c7a5224c1 100644 --- a/source.list +++ b/source.list @@ -262,6 +262,7 @@ road_cmd.cpp roadveh_cmd.cpp ship_cmd.cpp station_cmd.cpp +terraform_cmd.cpp timetable_cmd.cpp town_cmd.cpp train_cmd.cpp diff --git a/src/ai/ai.h b/src/ai/ai.h index 2fdb3c986..96e25ef54 100644 --- a/src/ai/ai.h +++ b/src/ai/ai.h @@ -7,6 +7,7 @@ #include "../player.h" #include "../command_type.h" #include "../core/random_func.hpp" +#include "../settings_type.h" /* How DoCommands look like for an AI */ struct AICommand { diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp index a3bc55c8f..c670c0eae 100644 --- a/src/ai/trolly/pathfinder.cpp +++ b/src/ai/trolly/pathfinder.cpp @@ -11,6 +11,7 @@ #include "../../bridge.h" #include "../../tunnelbridge_map.h" #include "../ai.h" +#include "../../variables.h" #define TEST_STATION_NO_DIR 0xFF diff --git a/src/aircraft.h b/src/aircraft.h index ead9bd422..b9704c4ee 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -8,7 +8,6 @@ #include "station_map.h" #include "vehicle_base.h" #include "engine.h" -#include "variables.h" /** An aircraft can be one ot those types */ enum AircraftSubType { diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index fcfaef99a..6cd274111 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -33,6 +33,7 @@ #include "vehicle_func.h" #include "sound_func.h" #include "functions.h" +#include "variables.h" void Aircraft::UpdateDeltaXY(Direction direction) { diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 7c17aa0c5..19b1e1b58 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -17,6 +17,7 @@ #include "depot.h" #include "sound_func.h" #include "window_func.h" +#include "variables.h" static byte _selected_airport_type; diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 3a0fb3932..c2ca04b7f 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -20,6 +20,7 @@ #include "command_func.h" #include "vehicle_func.h" #include "functions.h" +#include "variables.h" /* * move the cargo from one engine to another if possible diff --git a/src/autoslope.h b/src/autoslope.h index 652bce906..0b55b161d 100644 --- a/src/autoslope.h +++ b/src/autoslope.h @@ -6,6 +6,7 @@ #define AUTOSLOPE_H #include "depot.h" +#include "settings_type.h" /** * Autoslope check for tiles with an entrance on an edge. diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index c9b3661f4..2b8c44ea7 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -29,6 +29,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "settings_type.h" enum BuildVehicleWidgets { diff --git a/src/depot.h b/src/depot.h index ad3499c18..4aec85aa1 100644 --- a/src/depot.h +++ b/src/depot.h @@ -7,7 +7,6 @@ #include "direction_type.h" #include "oldpool.h" -#include "variables.h" #include "road_map.h" #include "rail_map.h" #include "water_map.h" @@ -36,23 +35,6 @@ void ShowDepotWindow(TileIndex tile, VehicleType type); #define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) if (d->IsValid()) #define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0) -#define MIN_SERVINT_PERCENT 5 -#define MAX_SERVINT_PERCENT 90 -#define MIN_SERVINT_DAYS 30 -#define MAX_SERVINT_DAYS 800 - -/** - * Get the service interval domain. - * Get the new proposed service interval for the vehicle is indeed, clamped - * within the given bounds. @see MIN_SERVINT_PERCENT ,etc. - * @param index proposed service interval - * @return service interval - */ -static inline Date GetServiceIntervalClamped(uint index) -{ - return (_patches.servint_ispercent) ? Clamp(index, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : Clamp(index, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS); -} - /** * Check if a tile is a depot of the given type. */ diff --git a/src/npf.cpp b/src/npf.cpp index a5d8c7146..2031035b5 100644 --- a/src/npf.cpp +++ b/src/npf.cpp @@ -21,6 +21,7 @@ #include "tunnelbridge_map.h" #include "functions.h" #include "vehicle_base.h" +#include "settings_type.h" static AyStar _npf_aystar; diff --git a/src/oldloader.cpp b/src/oldloader.cpp index 8d9288644..36eeb5f3d 100644 --- a/src/oldloader.cpp +++ b/src/oldloader.cpp @@ -24,6 +24,7 @@ #include "functions.h" #include "date_func.h" #include "vehicle_func.h" +#include "variables.h" enum { HEADER_SIZE = 49, diff --git a/src/openttd.cpp b/src/openttd.cpp index 4871b035f..f1b85c697 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -63,6 +63,7 @@ #include "date_func.h" #include "vehicle_func.h" #include "sound_func.h" +#include "variables.h" #include "bridge_map.h" #include "clear_map.h" diff --git a/src/order.h b/src/order.h index 65aee3961..6b824755e 100644 --- a/src/order.h +++ b/src/order.h @@ -10,6 +10,7 @@ #include "cargo_type.h" #include "vehicle_type.h" #include "tile_type.h" +#include "date_type.h" enum { INVALID_VEH_ORDER_ID = 0xFF, @@ -216,4 +217,18 @@ bool CheckForValidOrders(const Vehicle* v); Order UnpackOldOrder(uint16 packed); +#define MIN_SERVINT_PERCENT 5 +#define MAX_SERVINT_PERCENT 90 +#define MIN_SERVINT_DAYS 30 +#define MAX_SERVINT_DAYS 800 + +/** + * Get the service interval domain. + * Get the new proposed service interval for the vehicle is indeed, clamped + * within the given bounds. @see MIN_SERVINT_PERCENT ,etc. + * @param index proposed service interval + * @return service interval + */ +Date GetServiceIntervalClamped(uint index); + #endif /* ORDER_H */ diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 08e751be8..da2d82460 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -21,6 +21,7 @@ #include "core/alloc_func.hpp" #include "functions.h" #include "window_func.h" +#include "settings_type.h" DEFINE_OLD_POOL_GENERIC(Order, Order) @@ -1251,6 +1252,11 @@ void DeleteVehicleOrders(Vehicle *v) } } +Date GetServiceIntervalClamped(uint index) +{ + return (_patches.servint_ispercent) ? Clamp(index, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : Clamp(index, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS); +} + /** * * Check if we share our orders with an other vehicle diff --git a/src/order_gui.cpp b/src/order_gui.cpp index bfda4f1b7..5ecb80259 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -25,6 +25,7 @@ #include "strings_func.h" #include "window_func.h" #include "vehicle_func.h" +#include "settings_type.h" enum OrderWindowWidgets { ORDER_WIDGET_CLOSEBOX = 0, diff --git a/src/rail.h b/src/rail.h index f2c35352b..8ba804c6e 100644 --- a/src/rail.h +++ b/src/rail.h @@ -11,7 +11,6 @@ #include "gfx_type.h" #include "core/bitmath_func.hpp" #include "economy_func.h" -#include "variables.h" #include "tile_cmd.h" /** This struct contains all the info that is needed to draw and construct tracks. diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 810329496..9fc6ddad5 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -34,6 +34,7 @@ #include "newgrf_station.h" #include "train.h" #include "misc/autoptr.hpp" +#include "variables.h" #include "autoslope.h" #include "transparency.h" #include "water.h" diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index e4c7ad6c4..3a27577ad 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -26,6 +26,7 @@ #include "station_map.h" #include "tunnel_map.h" #include "misc/autoptr.hpp" +#include "variables.h" #include "autoslope.h" #include "transparency.h" #include "tunnelbridge_map.h" diff --git a/src/roadveh.h b/src/roadveh.h index 36b6d1694..fbcde1bdf 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -7,7 +7,6 @@ #include "vehicle_base.h" #include "engine.h" -#include "variables.h" #include "economy_func.h" enum RoadVehicleSubType { diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index e0f10eb39..3d8135464 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -38,6 +38,7 @@ #include "date_func.h" #include "vehicle_func.h" #include "sound_func.h" +#include "variables.h" static const uint16 _roadveh_images[63] = { diff --git a/src/ship.h b/src/ship.h index a188cb9bf..923cfe6d3 100644 --- a/src/ship.h +++ b/src/ship.h @@ -7,7 +7,6 @@ #include "vehicle_base.h" #include "engine.h" -#include "variables.h" #include "economy_func.h" void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2); diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 4ab205d40..cc2f872d5 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -34,6 +34,8 @@ #include "date_func.h" #include "vehicle_func.h" #include "sound_func.h" +#include "variables.h" + static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D}; diff --git a/src/station.cpp b/src/station.cpp index 3a8919d92..af16d6960 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -31,6 +31,7 @@ #include "functions.h" #include "window_func.h" #include "date_func.h" +#include "variables.h" Station::Station(TileIndex tile) { diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 8ca9b74c1..7d05bfc45 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -35,6 +35,7 @@ #include "road_type.h" #include "road_internal.h" /* For drawing catenary/checking road removal */ #include "cargotype.h" +#include "variables.h" #include "autoslope.h" #include "transparency.h" #include "water.h" diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 379c2343a..8351a77a2 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -43,6 +43,7 @@ #include "date_func.h" #include "vehicle_func.h" #include "sound_func.h" +#include "variables.h" static bool TrainCheckIfLineEnds(Vehicle *v); diff --git a/src/train_gui.cpp b/src/train_gui.cpp index c592ba9c0..4005bb072 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -17,6 +17,7 @@ #include "newgrf_engine.h" #include "strings_func.h" #include "vehicle_func.h" +#include "settings_type.h" void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2) { diff --git a/src/vehicle.cpp b/src/vehicle.cpp index ee81b929b..612268bba 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -43,6 +43,7 @@ #include "window_func.h" #include "vehicle_func.h" #include "sound_func.h" +#include "variables.h" #define INVALID_COORD (0x7fffffff) #define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6)) diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp index 86cd583ec..07ab11e26 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -32,6 +32,7 @@ #include "window_func.h" #include "vehicle_func.h" #include "sound_func.h" +#include "variables.h" static Vehicle *FindFloodableVehicleOnTile(TileIndex tile); diff --git a/src/yapf/yapf.hpp b/src/yapf/yapf.hpp index 50c0b9d33..d728d0bfe 100644 --- a/src/yapf/yapf.hpp +++ b/src/yapf/yapf.hpp @@ -22,8 +22,8 @@ #include "../pathfind.h" #include "../waypoint.h" #include "../debug.h" +#include "../settings_type.h" -extern Patches _patches_newgame; extern uint64 _rdtsc(); #include <limits.h> |