1
0
Fork 0

(svn r11774) -Change: do not include variables.h in a header when it is not needed.

release/0.6
rubidium 2008-01-07 00:57:19 +00:00
parent 64fc2ade9e
commit b0ac283aec
33 changed files with 56 additions and 23 deletions

View File

@ -884,6 +884,9 @@
<File <File
RelativePath=".\..\src\station_cmd.cpp"> RelativePath=".\..\src\station_cmd.cpp">
</File> </File>
<File
RelativePath=".\..\src\terraform_cmd.cpp">
</File>
<File <File
RelativePath=".\..\src\timetable_cmd.cpp"> RelativePath=".\..\src\timetable_cmd.cpp">
</File> </File>

View File

@ -1407,6 +1407,10 @@
RelativePath=".\..\src\station_cmd.cpp" RelativePath=".\..\src\station_cmd.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\terraform_cmd.cpp"
>
</File>
<File <File
RelativePath=".\..\src\timetable_cmd.cpp" RelativePath=".\..\src\timetable_cmd.cpp"
> >

View File

@ -1404,6 +1404,10 @@
RelativePath=".\..\src\station_cmd.cpp" RelativePath=".\..\src\station_cmd.cpp"
> >
</File> </File>
<File
RelativePath=".\..\src\terraform_cmd.cpp"
>
</File>
<File <File
RelativePath=".\..\src\timetable_cmd.cpp" RelativePath=".\..\src\timetable_cmd.cpp"
> >

View File

@ -262,6 +262,7 @@ road_cmd.cpp
roadveh_cmd.cpp roadveh_cmd.cpp
ship_cmd.cpp ship_cmd.cpp
station_cmd.cpp station_cmd.cpp
terraform_cmd.cpp
timetable_cmd.cpp timetable_cmd.cpp
town_cmd.cpp town_cmd.cpp
train_cmd.cpp train_cmd.cpp

View File

@ -7,6 +7,7 @@
#include "../player.h" #include "../player.h"
#include "../command_type.h" #include "../command_type.h"
#include "../core/random_func.hpp" #include "../core/random_func.hpp"
#include "../settings_type.h"
/* How DoCommands look like for an AI */ /* How DoCommands look like for an AI */
struct AICommand { struct AICommand {

View File

@ -11,6 +11,7 @@
#include "../../bridge.h" #include "../../bridge.h"
#include "../../tunnelbridge_map.h" #include "../../tunnelbridge_map.h"
#include "../ai.h" #include "../ai.h"
#include "../../variables.h"
#define TEST_STATION_NO_DIR 0xFF #define TEST_STATION_NO_DIR 0xFF

View File

@ -8,7 +8,6 @@
#include "station_map.h" #include "station_map.h"
#include "vehicle_base.h" #include "vehicle_base.h"
#include "engine.h" #include "engine.h"
#include "variables.h"
/** An aircraft can be one ot those types */ /** An aircraft can be one ot those types */
enum AircraftSubType { enum AircraftSubType {

View File

@ -33,6 +33,7 @@
#include "vehicle_func.h" #include "vehicle_func.h"
#include "sound_func.h" #include "sound_func.h"
#include "functions.h" #include "functions.h"
#include "variables.h"
void Aircraft::UpdateDeltaXY(Direction direction) void Aircraft::UpdateDeltaXY(Direction direction)
{ {

View File

@ -17,6 +17,7 @@
#include "depot.h" #include "depot.h"
#include "sound_func.h" #include "sound_func.h"
#include "window_func.h" #include "window_func.h"
#include "variables.h"
static byte _selected_airport_type; static byte _selected_airport_type;

View File

@ -20,6 +20,7 @@
#include "command_func.h" #include "command_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "functions.h" #include "functions.h"
#include "variables.h"
/* /*
* move the cargo from one engine to another if possible * move the cargo from one engine to another if possible

View File

@ -6,6 +6,7 @@
#define AUTOSLOPE_H #define AUTOSLOPE_H
#include "depot.h" #include "depot.h"
#include "settings_type.h"
/** /**
* Autoslope check for tiles with an entrance on an edge. * Autoslope check for tiles with an entrance on an edge.

View File

@ -29,6 +29,7 @@
#include "window_func.h" #include "window_func.h"
#include "date_func.h" #include "date_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "settings_type.h"
enum BuildVehicleWidgets { enum BuildVehicleWidgets {

View File

@ -7,7 +7,6 @@
#include "direction_type.h" #include "direction_type.h"
#include "oldpool.h" #include "oldpool.h"
#include "variables.h"
#include "road_map.h" #include "road_map.h"
#include "rail_map.h" #include "rail_map.h"
#include "water_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_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 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. * Check if a tile is a depot of the given type.
*/ */

View File

@ -21,6 +21,7 @@
#include "tunnelbridge_map.h" #include "tunnelbridge_map.h"
#include "functions.h" #include "functions.h"
#include "vehicle_base.h" #include "vehicle_base.h"
#include "settings_type.h"
static AyStar _npf_aystar; static AyStar _npf_aystar;

View File

@ -24,6 +24,7 @@
#include "functions.h" #include "functions.h"
#include "date_func.h" #include "date_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "variables.h"
enum { enum {
HEADER_SIZE = 49, HEADER_SIZE = 49,

View File

@ -63,6 +63,7 @@
#include "date_func.h" #include "date_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "sound_func.h" #include "sound_func.h"
#include "variables.h"
#include "bridge_map.h" #include "bridge_map.h"
#include "clear_map.h" #include "clear_map.h"

View File

@ -10,6 +10,7 @@
#include "cargo_type.h" #include "cargo_type.h"
#include "vehicle_type.h" #include "vehicle_type.h"
#include "tile_type.h" #include "tile_type.h"
#include "date_type.h"
enum { enum {
INVALID_VEH_ORDER_ID = 0xFF, INVALID_VEH_ORDER_ID = 0xFF,
@ -216,4 +217,18 @@ bool CheckForValidOrders(const Vehicle* v);
Order UnpackOldOrder(uint16 packed); 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 */ #endif /* ORDER_H */

View File

@ -21,6 +21,7 @@
#include "core/alloc_func.hpp" #include "core/alloc_func.hpp"
#include "functions.h" #include "functions.h"
#include "window_func.h" #include "window_func.h"
#include "settings_type.h"
DEFINE_OLD_POOL_GENERIC(Order, Order) 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 * Check if we share our orders with an other vehicle

View File

@ -25,6 +25,7 @@
#include "strings_func.h" #include "strings_func.h"
#include "window_func.h" #include "window_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "settings_type.h"
enum OrderWindowWidgets { enum OrderWindowWidgets {
ORDER_WIDGET_CLOSEBOX = 0, ORDER_WIDGET_CLOSEBOX = 0,

View File

@ -11,7 +11,6 @@
#include "gfx_type.h" #include "gfx_type.h"
#include "core/bitmath_func.hpp" #include "core/bitmath_func.hpp"
#include "economy_func.h" #include "economy_func.h"
#include "variables.h"
#include "tile_cmd.h" #include "tile_cmd.h"
/** This struct contains all the info that is needed to draw and construct tracks. /** This struct contains all the info that is needed to draw and construct tracks.

View File

@ -34,6 +34,7 @@
#include "newgrf_station.h" #include "newgrf_station.h"
#include "train.h" #include "train.h"
#include "misc/autoptr.hpp" #include "misc/autoptr.hpp"
#include "variables.h"
#include "autoslope.h" #include "autoslope.h"
#include "transparency.h" #include "transparency.h"
#include "water.h" #include "water.h"

View File

@ -26,6 +26,7 @@
#include "station_map.h" #include "station_map.h"
#include "tunnel_map.h" #include "tunnel_map.h"
#include "misc/autoptr.hpp" #include "misc/autoptr.hpp"
#include "variables.h"
#include "autoslope.h" #include "autoslope.h"
#include "transparency.h" #include "transparency.h"
#include "tunnelbridge_map.h" #include "tunnelbridge_map.h"

View File

@ -7,7 +7,6 @@
#include "vehicle_base.h" #include "vehicle_base.h"
#include "engine.h" #include "engine.h"
#include "variables.h"
#include "economy_func.h" #include "economy_func.h"
enum RoadVehicleSubType { enum RoadVehicleSubType {

View File

@ -38,6 +38,7 @@
#include "date_func.h" #include "date_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "sound_func.h" #include "sound_func.h"
#include "variables.h"
static const uint16 _roadveh_images[63] = { static const uint16 _roadveh_images[63] = {

View File

@ -7,7 +7,6 @@
#include "vehicle_base.h" #include "vehicle_base.h"
#include "engine.h" #include "engine.h"
#include "variables.h"
#include "economy_func.h" #include "economy_func.h"
void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2); void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2);

View File

@ -34,6 +34,8 @@
#include "date_func.h" #include "date_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "sound_func.h" #include "sound_func.h"
#include "variables.h"
static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D}; static const uint16 _ship_sprites[] = {0x0E5D, 0x0E55, 0x0E65, 0x0E6D};

View File

@ -31,6 +31,7 @@
#include "functions.h" #include "functions.h"
#include "window_func.h" #include "window_func.h"
#include "date_func.h" #include "date_func.h"
#include "variables.h"
Station::Station(TileIndex tile) Station::Station(TileIndex tile)
{ {

View File

@ -35,6 +35,7 @@
#include "road_type.h" #include "road_type.h"
#include "road_internal.h" /* For drawing catenary/checking road removal */ #include "road_internal.h" /* For drawing catenary/checking road removal */
#include "cargotype.h" #include "cargotype.h"
#include "variables.h"
#include "autoslope.h" #include "autoslope.h"
#include "transparency.h" #include "transparency.h"
#include "water.h" #include "water.h"

View File

@ -43,6 +43,7 @@
#include "date_func.h" #include "date_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "sound_func.h" #include "sound_func.h"
#include "variables.h"
static bool TrainCheckIfLineEnds(Vehicle *v); static bool TrainCheckIfLineEnds(Vehicle *v);

View File

@ -17,6 +17,7 @@
#include "newgrf_engine.h" #include "newgrf_engine.h"
#include "strings_func.h" #include "strings_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "settings_type.h"
void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2) void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2)
{ {

View File

@ -43,6 +43,7 @@
#include "window_func.h" #include "window_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "sound_func.h" #include "sound_func.h"
#include "variables.h"
#define INVALID_COORD (0x7fffffff) #define INVALID_COORD (0x7fffffff)
#define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6)) #define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))

View File

@ -32,6 +32,7 @@
#include "window_func.h" #include "window_func.h"
#include "vehicle_func.h" #include "vehicle_func.h"
#include "sound_func.h" #include "sound_func.h"
#include "variables.h"
static Vehicle *FindFloodableVehicleOnTile(TileIndex tile); static Vehicle *FindFloodableVehicleOnTile(TileIndex tile);

View File

@ -22,8 +22,8 @@
#include "../pathfind.h" #include "../pathfind.h"
#include "../waypoint.h" #include "../waypoint.h"
#include "../debug.h" #include "../debug.h"
#include "../settings_type.h"
extern Patches _patches_newgame;
extern uint64 _rdtsc(); extern uint64 _rdtsc();
#include <limits.h> #include <limits.h>