# HG changeset patch # User rubidium # Date 1199667439 0 # Node ID 29a8510dfd62af9a1e2f0e39884c29d841a13486 # Parent cc873256f63a5418fb9bf64d2146e6e6895fb5ae (svn r11774) -Change: do not include variables.h in a header when it is not needed. diff -r cc873256f63a -r 29a8510dfd62 projects/openttd.vcproj --- a/projects/openttd.vcproj Mon Jan 07 00:45:05 2008 +0000 +++ b/projects/openttd.vcproj Mon Jan 07 00:57:19 2008 +0000 @@ -885,6 +885,9 @@ RelativePath=".\..\src\station_cmd.cpp"> + + + + diff -r cc873256f63a -r 29a8510dfd62 projects/openttd_vs90.vcproj --- a/projects/openttd_vs90.vcproj Mon Jan 07 00:45:05 2008 +0000 +++ b/projects/openttd_vs90.vcproj Mon Jan 07 00:57:19 2008 +0000 @@ -1405,6 +1405,10 @@ > + + diff -r cc873256f63a -r 29a8510dfd62 source.list --- a/source.list Mon Jan 07 00:45:05 2008 +0000 +++ b/source.list Mon Jan 07 00:57:19 2008 +0000 @@ -262,6 +262,7 @@ roadveh_cmd.cpp ship_cmd.cpp station_cmd.cpp +terraform_cmd.cpp timetable_cmd.cpp town_cmd.cpp train_cmd.cpp diff -r cc873256f63a -r 29a8510dfd62 src/ai/ai.h --- a/src/ai/ai.h Mon Jan 07 00:45:05 2008 +0000 +++ b/src/ai/ai.h Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/ai/trolly/pathfinder.cpp --- a/src/ai/trolly/pathfinder.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/ai/trolly/pathfinder.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -11,6 +11,7 @@ #include "../../bridge.h" #include "../../tunnelbridge_map.h" #include "../ai.h" +#include "../../variables.h" #define TEST_STATION_NO_DIR 0xFF diff -r cc873256f63a -r 29a8510dfd62 src/aircraft.h --- a/src/aircraft.h Mon Jan 07 00:45:05 2008 +0000 +++ b/src/aircraft.h Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/aircraft_cmd.cpp --- a/src/aircraft_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/aircraft_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -33,6 +33,7 @@ #include "vehicle_func.h" #include "sound_func.h" #include "functions.h" +#include "variables.h" void Aircraft::UpdateDeltaXY(Direction direction) { diff -r cc873256f63a -r 29a8510dfd62 src/airport_gui.cpp --- a/src/airport_gui.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/airport_gui.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -17,6 +17,7 @@ #include "depot.h" #include "sound_func.h" #include "window_func.h" +#include "variables.h" static byte _selected_airport_type; diff -r cc873256f63a -r 29a8510dfd62 src/autoreplace_cmd.cpp --- a/src/autoreplace_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/autoreplace_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/autoslope.h --- a/src/autoslope.h Mon Jan 07 00:45:05 2008 +0000 +++ b/src/autoslope.h Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/build_vehicle_gui.cpp --- a/src/build_vehicle_gui.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/build_vehicle_gui.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -29,6 +29,7 @@ #include "window_func.h" #include "date_func.h" #include "vehicle_func.h" +#include "settings_type.h" enum BuildVehicleWidgets { diff -r cc873256f63a -r 29a8510dfd62 src/depot.h --- a/src/depot.h Mon Jan 07 00:45:05 2008 +0000 +++ b/src/depot.h Mon Jan 07 00:57:19 2008 +0000 @@ -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 @@ #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 -r cc873256f63a -r 29a8510dfd62 src/npf.cpp --- a/src/npf.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/npf.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -21,6 +21,7 @@ #include "tunnelbridge_map.h" #include "functions.h" #include "vehicle_base.h" +#include "settings_type.h" static AyStar _npf_aystar; diff -r cc873256f63a -r 29a8510dfd62 src/oldloader.cpp --- a/src/oldloader.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/oldloader.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -24,6 +24,7 @@ #include "functions.h" #include "date_func.h" #include "vehicle_func.h" +#include "variables.h" enum { HEADER_SIZE = 49, diff -r cc873256f63a -r 29a8510dfd62 src/openttd.cpp --- a/src/openttd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/openttd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/order.h --- a/src/order.h Mon Jan 07 00:45:05 2008 +0000 +++ b/src/order.h Mon Jan 07 00:57:19 2008 +0000 @@ -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 @@ 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 -r cc873256f63a -r 29a8510dfd62 src/order_cmd.cpp --- a/src/order_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/order_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 @@ } } +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 -r cc873256f63a -r 29a8510dfd62 src/order_gui.cpp --- a/src/order_gui.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/order_gui.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/rail.h --- a/src/rail.h Mon Jan 07 00:45:05 2008 +0000 +++ b/src/rail.h Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/rail_cmd.cpp --- a/src/rail_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/rail_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/road_cmd.cpp --- a/src/road_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/road_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/roadveh.h --- a/src/roadveh.h Mon Jan 07 00:45:05 2008 +0000 +++ b/src/roadveh.h Mon Jan 07 00:57:19 2008 +0000 @@ -7,7 +7,6 @@ #include "vehicle_base.h" #include "engine.h" -#include "variables.h" #include "economy_func.h" enum RoadVehicleSubType { diff -r cc873256f63a -r 29a8510dfd62 src/roadveh_cmd.cpp --- a/src/roadveh_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/roadveh_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/ship.h --- a/src/ship.h Mon Jan 07 00:45:05 2008 +0000 +++ b/src/ship.h Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/ship_cmd.cpp --- a/src/ship_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/ship_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/station.cpp --- a/src/station.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/station.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -31,6 +31,7 @@ #include "functions.h" #include "window_func.h" #include "date_func.h" +#include "variables.h" Station::Station(TileIndex tile) { diff -r cc873256f63a -r 29a8510dfd62 src/station_cmd.cpp --- a/src/station_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/station_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/train_cmd.cpp --- a/src/train_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/train_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/train_gui.cpp --- a/src/train_gui.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/train_gui.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/vehicle.cpp --- a/src/vehicle.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/vehicle.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/water_cmd.cpp --- a/src/water_cmd.cpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/water_cmd.cpp Mon Jan 07 00:57:19 2008 +0000 @@ -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 -r cc873256f63a -r 29a8510dfd62 src/yapf/yapf.hpp --- a/src/yapf/yapf.hpp Mon Jan 07 00:45:05 2008 +0000 +++ b/src/yapf/yapf.hpp Mon Jan 07 00:57:19 2008 +0000 @@ -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