summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-17 20:54:18 +0000
committerrubidium <rubidium@openttd.org>2008-05-17 20:54:18 +0000
commit8ff56af53d3c160d97db831a579b222413c4e10f (patch)
treea6539103a8675f69e55e00b8315b178a88fcb37e /src
parent107371a26b71659521c29b3bfc964df135af2acb (diff)
downloadopenttd-8ff56af53d3c160d97db831a579b222413c4e10f.tar.xz
(svn r13146) -Codechange: vehicle_base.h doesn't need to be included in vehicle_gui.h.
Diffstat (limited to 'src')
-rw-r--r--src/autoreplace_cmd.cpp2
-rw-r--r--src/misc.cpp1
-rw-r--r--src/vehicle.cpp4
-rw-r--r--src/vehicle_gui.h16
4 files changed, 4 insertions, 19 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 8b7688107..59cb0ac75 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -216,7 +216,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost, con
// 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;
diff --git a/src/misc.cpp b/src/misc.cpp
index 0546a6465..e50685895 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -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"
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 53a38e239..a4f8789a5 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -2805,11 +2805,11 @@ Vehicle *BackuppedVehicle::Restore(Vehicle *v, Player *p)
{
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. */
diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h
index e34282cc2..b9ff7cf02 100644
--- a/src/vehicle_gui.h
+++ b/src/vehicle_gui.h
@@ -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 @@ void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection, int c
* 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;