diff options
author | rubidium <rubidium@openttd.org> | 2008-03-30 23:24:18 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-03-30 23:24:18 +0000 |
commit | b84b16cfcd06f66f44aa2ff8ad8382776662773d (patch) | |
tree | 845a4e8019b4224d85946c12f67be2fb14daa301 /src | |
parent | 8e9750901d2ffe6a08b213ae44341ebea0a7e957 (diff) | |
download | openttd-b84b16cfcd06f66f44aa2ff8ad8382776662773d.tar.xz |
(svn r12488) -Codechange: split order.h into order_base.h and order_func.h.
Diffstat (limited to 'src')
-rw-r--r-- | src/ai/default/default.cpp | 1 | ||||
-rw-r--r-- | src/ai/trolly/trolly.cpp | 1 | ||||
-rw-r--r-- | src/aircraft_cmd.cpp | 1 | ||||
-rw-r--r-- | src/aircraft_gui.cpp | 1 | ||||
-rw-r--r-- | src/airport_gui.cpp | 1 | ||||
-rw-r--r-- | src/autoreplace_cmd.cpp | 1 | ||||
-rw-r--r-- | src/depot.cpp | 2 | ||||
-rw-r--r-- | src/depot_gui.cpp | 1 | ||||
-rw-r--r-- | src/group_cmd.cpp | 1 | ||||
-rw-r--r-- | src/newgrf_text.cpp | 2 | ||||
-rw-r--r-- | src/order_base.h (renamed from src/order.h) | 49 | ||||
-rw-r--r-- | src/order_cmd.cpp | 3 | ||||
-rw-r--r-- | src/order_func.h | 54 | ||||
-rw-r--r-- | src/order_gui.cpp | 1 | ||||
-rw-r--r-- | src/roadveh_cmd.cpp | 1 | ||||
-rw-r--r-- | src/roadveh_gui.cpp | 1 | ||||
-rw-r--r-- | src/ship_cmd.cpp | 1 | ||||
-rw-r--r-- | src/ship_gui.cpp | 1 | ||||
-rw-r--r-- | src/sound/win32_s.cpp | 2 | ||||
-rw-r--r-- | src/station.cpp | 1 | ||||
-rw-r--r-- | src/train_cmd.cpp | 1 | ||||
-rw-r--r-- | src/train_gui.cpp | 1 | ||||
-rw-r--r-- | src/vehicle.cpp | 2 | ||||
-rw-r--r-- | src/vehicle_base.h | 2 | ||||
-rw-r--r-- | src/vehicle_gui.cpp | 1 | ||||
-rw-r--r-- | src/waypoint.cpp | 2 |
26 files changed, 79 insertions, 56 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index 6deebc02d..4708e5f55 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -32,6 +32,7 @@ #include "../../settings_type.h" #include "default.h" #include "../../tunnelbridge.h" +#include "../../order_func.h" #include "../../table/ai_rail.h" diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp index e85fc36c4..e06582e74 100644 --- a/src/ai/trolly/trolly.cpp +++ b/src/ai/trolly/trolly.cpp @@ -34,7 +34,6 @@ #include "../../vehicle_func.h" #include "../../date_func.h" #include "../ai.h" -#include "../../order.h" #include "../../player_base.h" #include "../../player_func.h" diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 625777e5d..9421c3b9a 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -36,6 +36,7 @@ #include "gfx_func.h" #include "player_func.h" #include "settings_type.h" +#include "order_func.h" #include "table/strings.h" #include "table/sprites.h" diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index 984d66e82..d2c7ae0a2 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -14,6 +14,7 @@ #include "strings_func.h" #include "vehicle_func.h" #include "gfx_func.h" +#include "order_func.h" #include "table/sprites.h" #include "table/strings.h" diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 95cfa12da..595eaff8f 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -18,6 +18,7 @@ #include "viewport_func.h" #include "gfx_func.h" #include "player_func.h" +#include "order_func.h" #include "table/sprites.h" #include "table/strings.h" diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 58e38a39d..74f476669 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -14,7 +14,6 @@ #include "aircraft.h" #include "cargotype.h" #include "group.h" -#include "order.h" #include "strings_func.h" #include "command_func.h" #include "vehicle_func.h" diff --git a/src/depot.cpp b/src/depot.cpp index 524274261..2ee984e38 100644 --- a/src/depot.cpp +++ b/src/depot.cpp @@ -7,7 +7,7 @@ #include "depot.h" #include "landscape.h" #include "saveload.h" -#include "order.h" +#include "order_func.h" #include "window_func.h" #include "table/strings.h" diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index f9605dd65..aeda3fb6f 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -22,6 +22,7 @@ #include "window_func.h" #include "vehicle_func.h" #include "player_func.h" +#include "order_func.h" #include "table/strings.h" #include "table/sprites.h" diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index 84aa0b39e..7d708161e 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -21,6 +21,7 @@ #include "autoreplace_func.h" #include "string_func.h" #include "player_func.h" +#include "order_func.h" #include "table/strings.h" diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index 261610f46..9417c7d68 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -642,7 +642,7 @@ uint RemapNewGRFStringControlCode(uint scc, char **buff, const char **str, int64 case SCC_NEWGRF_PRINT_SIGNED_WORD: case SCC_NEWGRF_PRINT_SIGNED_BYTE: case SCC_NEWGRF_PRINT_UNSIGNED_WORD: - return SCC_NUM; + return SCC_COMMA; case SCC_NEWGRF_PRINT_DWORD_CURRENCY: case SCC_NEWGRF_PRINT_QWORD_CURRENCY: diff --git a/src/order.h b/src/order_base.h index 2e0a3eeb7..8cc3a29f4 100644 --- a/src/order.h +++ b/src/order_base.h @@ -1,18 +1,14 @@ /* $Id$ */ -/** @file order.h */ +/** @file order_base.h */ -#ifndef ORDER_H -#define ORDER_H +#ifndef ORDER_BASE_H +#define ORDER_BASE_H #include "order_type.h" #include "oldpool.h" #include "core/bitmath_func.hpp" #include "cargo_type.h" -#include "vehicle_type.h" -#include "tile_type.h" -#include "date_type.h" -#include "group_type.h" DECLARE_OLD_POOL(Order, Order, 6, 1000) @@ -46,21 +42,6 @@ struct Order : PoolItem<Order, OrderID, &_Order_pool> { void FreeChain(); }; -struct BackuppedOrders { - BackuppedOrders() : order(NULL), name(NULL) { } - ~BackuppedOrders() { free(order); free(name); } - - VehicleID clone; - VehicleOrderID orderindex; - GroupID group; - Order *order; - uint16 service_interval; - char *name; -}; - -extern TileIndex _backup_orders_tile; -extern BackuppedOrders _backup_orders_data; - static inline VehicleOrderID GetMaxOrderIndex() { /* TODO - This isn't the real content of the function, but @@ -131,31 +112,7 @@ static inline Order UnpackOrder(uint32 packed) return order; } -/* Functions */ -void BackupVehicleOrders(const Vehicle *v, BackuppedOrders *order = &_backup_orders_data); -void RestoreVehicleOrders(const Vehicle *v, const BackuppedOrders *order = &_backup_orders_data); -void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination); -void InvalidateVehicleOrder(const Vehicle *v); -bool VehicleHasDepotOrders(const Vehicle *v); -void CheckOrders(const Vehicle*); -void DeleteVehicleOrders(Vehicle *v); void AssignOrder(Order *order, Order data); -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 044494404..2cce9c55a 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -4,7 +4,8 @@ #include "stdafx.h" #include "openttd.h" -#include "order.h" +#include "order_base.h" +#include "order_func.h" #include "airport.h" #include "depot.h" #include "waypoint.h" diff --git a/src/order_func.h b/src/order_func.h new file mode 100644 index 000000000..3351ea23b --- /dev/null +++ b/src/order_func.h @@ -0,0 +1,54 @@ +/* $Id$ */ + +/** @file order_func.h Functions related to orders. */ + +#ifndef ORDER_FUNC_H +#define ORDER_FUNC_H + +#include "order_type.h" +#include "vehicle_type.h" +#include "tile_type.h" +#include "group_type.h" +#include "date_type.h" + +struct BackuppedOrders { + BackuppedOrders() : order(NULL), name(NULL) { } + ~BackuppedOrders() { free(order); free(name); } + + VehicleID clone; + VehicleOrderID orderindex; + GroupID group; + Order *order; + uint16 service_interval; + char *name; +}; + +extern TileIndex _backup_orders_tile; +extern BackuppedOrders _backup_orders_data; + +void BackupVehicleOrders(const Vehicle *v, BackuppedOrders *order = &_backup_orders_data); +void RestoreVehicleOrders(const Vehicle *v, const BackuppedOrders *order = &_backup_orders_data); + +/* Functions */ +void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination); +void InvalidateVehicleOrder(const Vehicle *v); +bool VehicleHasDepotOrders(const Vehicle *v); +void CheckOrders(const Vehicle*); +void DeleteVehicleOrders(Vehicle *v); +bool CheckForValidOrders(const Vehicle* v); + +#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_FUNC_H */ diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 4f13423a5..7ec38c7c3 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -20,7 +20,6 @@ #include "vehicle_gui.h" #include "timetable.h" #include "cargotype.h" -#include "order.h" #include "strings_func.h" #include "window_func.h" #include "vehicle_func.h" diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 954e5900f..572d04fc9 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -42,6 +42,7 @@ #include "autoreplace_gui.h" #include "gfx_func.h" #include "settings_type.h" +#include "order_func.h" #include "table/strings.h" diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index d851f31ba..160a5874a 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -17,6 +17,7 @@ #include "strings_func.h" #include "vehicle_func.h" #include "string_func.h" +#include "order_func.h" #include "table/sprites.h" #include "table/strings.h" diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 17c35d6d3..84241c788 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -38,6 +38,7 @@ #include "autoreplace_gui.h" #include "gfx_func.h" #include "settings_type.h" +#include "order_func.h" #include "table/strings.h" diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp index 2a041efa5..9b95a52a1 100644 --- a/src/ship_gui.cpp +++ b/src/ship_gui.cpp @@ -15,6 +15,7 @@ #include "newgrf_engine.h" #include "strings_func.h" #include "vehicle_func.h" +#include "order_func.h" #include "table/strings.h" #include "table/sprites.h" diff --git a/src/sound/win32_s.cpp b/src/sound/win32_s.cpp index 9f330c824..2cc45d689 100644 --- a/src/sound/win32_s.cpp +++ b/src/sound/win32_s.cpp @@ -59,7 +59,7 @@ const char *SoundDriver_Win32::Start(const char* const* parm) wfex.nBlockAlign = (wfex.nChannels * wfex.wBitsPerSample) / 8; wfex.nAvgBytesPerSec = wfex.nSamplesPerSec * wfex.nBlockAlign; - _bufsize = GetDriverParamInt(parm, "bufsize", 1024); + _bufsize = GetDriverParamInt(parm, "bufsize", 2048); if (waveOutOpen(&_waveout, WAVE_MAPPER, &wfex, (DWORD_PTR)&waveOutProc, 0, CALLBACK_FUNCTION) != MMSYSERR_NOERROR) return "waveOutOpen failed"; diff --git a/src/station.cpp b/src/station.cpp index de7925d4e..21147c2ef 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -30,6 +30,7 @@ #include "variables.h" #include "settings_type.h" #include "command_func.h" +#include "order_func.h" #include "table/sprites.h" #include "table/strings.h" diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 7998a621f..5bbb28743 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -47,6 +47,7 @@ #include "autoreplace_gui.h" #include "gfx_func.h" #include "settings_type.h" +#include "order_func.h" #include "table/strings.h" #include "table/train_cmd.h" diff --git a/src/train_gui.cpp b/src/train_gui.cpp index a32f0a6fd..6f42a66dc 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -16,6 +16,7 @@ #include "strings_func.h" #include "vehicle_func.h" #include "settings_type.h" +#include "order_func.h" #include "table/sprites.h" #include "table/strings.h" diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 16a1346f1..bf3905680 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -34,7 +34,7 @@ #include "newgrf_engine.h" #include "newgrf_sound.h" #include "group.h" -#include "order.h" +#include "order_func.h" #include "strings_func.h" #include "zoom_func.h" #include "functions.h" diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 80de9f4a4..7f524cb5f 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -17,7 +17,7 @@ #include "date_type.h" #include "player_type.h" #include "oldpool.h" -#include "order.h" +#include "order_base.h" #include "cargopacket.h" #include "texteff.hpp" #include "group_type.h" diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index f9495aeef..4730cb704 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -36,6 +36,7 @@ #include "string_func.h" #include "settings_type.h" #include "widgets/dropdown_func.h" +#include "order_func.h" #include "table/sprites.h" #include "table/strings.h" diff --git a/src/waypoint.cpp b/src/waypoint.cpp index 08af0f310..16e278123 100644 --- a/src/waypoint.cpp +++ b/src/waypoint.cpp @@ -7,7 +7,7 @@ #include "command_func.h" #include "landscape.h" -#include "order.h" +#include "order_func.h" #include "rail_map.h" #include "rail.h" #include "bridge_map.h" |