mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 04:43:12 +00:00
(svn r12488) -Codechange: split order.h into order_base.h and order_func.h.
This commit is contained in:
parent
9598b1ecaf
commit
4a1035ab95
@ -32,6 +32,7 @@
|
||||
#include "../../settings_type.h"
|
||||
#include "default.h"
|
||||
#include "../../tunnelbridge.h"
|
||||
#include "../../order_func.h"
|
||||
|
||||
#include "../../table/ai_rail.h"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "autoreplace_func.h"
|
||||
#include "string_func.h"
|
||||
#include "player_func.h"
|
||||
#include "order_func.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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 */
|
@ -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"
|
||||
|
54
src/order_func.h
Normal file
54
src/order_func.h
Normal file
@ -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 */
|
@ -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"
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "autoreplace_gui.h"
|
||||
#include "gfx_func.h"
|
||||
#include "settings_type.h"
|
||||
#include "order_func.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "autoreplace_gui.h"
|
||||
#include "gfx_func.h"
|
||||
#include "settings_type.h"
|
||||
#include "order_func.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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";
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user