(svn r13146) -Codechange: vehicle_base.h doesn't need to be included in vehicle_gui.h.
--- a/src/autoreplace_cmd.cpp Sat May 17 20:49:45 2008 +0000
+++ b/src/autoreplace_cmd.cpp Sat May 17 20:54:18 2008 +0000
@@ -216,7 +216,7 @@
// copy/clone the orders
DoCommand(0, (old_v->index << 16) | new_v->index, old_v->IsOrderListShared() ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
new_v->cur_order_index = old_v->cur_order_index;
- ChangeVehicleViewWindow(old_v, new_v);
+ ChangeVehicleViewWindow(old_v->index, new_v->index);
new_v->profit_this_year = old_v->profit_this_year;
new_v->profit_last_year = old_v->profit_last_year;
new_v->service_interval = old_v->service_interval;
--- a/src/misc.cpp Sat May 17 20:49:45 2008 +0000
+++ b/src/misc.cpp Sat May 17 20:54:18 2008 +0000
@@ -27,6 +27,7 @@
#include "core/alloc_type.hpp"
#include "animated_tile_func.h"
#include "tilehighlight_func.h"
+#include "core/bitmath_func.hpp"
#include "table/strings.h"
#include "table/sprites.h"
--- a/src/vehicle.cpp Sat May 17 20:49:45 2008 +0000
+++ b/src/vehicle.cpp Sat May 17 20:54:18 2008 +0000
@@ -2805,11 +2805,11 @@
{
if (!ContainsBackup()) return v;
if (v != NULL) {
- ChangeVehicleViewWindow(v, INVALID_VEHICLE);
+ ChangeVehicleViewWindow(v->index, INVALID_VEHICLE);
DoCommand(0, v->index, 1, DC_EXEC, GetCmdSellVeh(v));
}
v = RestoreBackupVehicle(this->vehicles, p);
- ChangeVehicleViewWindow(INVALID_VEHICLE, v);
+ ChangeVehicleViewWindow(INVALID_VEHICLE, v->index);
if (orders != NULL) RestoreVehicleOrdersBruteForce(v, orders);
if (economy != NULL) economy->Restore();
/* If we stored cargo as well then we should restore it. */
--- a/src/vehicle_gui.h Sat May 17 20:49:45 2008 +0000
+++ b/src/vehicle_gui.h Sat May 17 20:54:18 2008 +0000
@@ -11,7 +11,6 @@
#include "order_type.h"
#include "station_type.h"
#include "engine_type.h"
-#include "vehicle_base.h"
void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order);
@@ -90,21 +89,6 @@
* For ease of use it can be called with both Vehicle pointers and VehicleIDs. */
void ChangeVehicleViewWindow(VehicleID from_index, VehicleID to_index);
-static inline void ChangeVehicleViewWindow(const Vehicle *from_v, VehicleID to_index)
-{
- ChangeVehicleViewWindow(from_v->index, to_index);
-}
-
-static inline void ChangeVehicleViewWindow(VehicleID from_index, const Vehicle *to_v)
-{
- ChangeVehicleViewWindow(from_index, to_v->index);
-}
-
-static inline void ChangeVehicleViewWindow(const Vehicle *from_v, const Vehicle *to_v)
-{
- ChangeVehicleViewWindow(from_v->index, to_v->index);
-}
-
static inline uint GetVehicleListHeight(VehicleType type)
{
return (type == VEH_TRAIN || type == VEH_ROAD) ? 14 : 24;