summaryrefslogtreecommitdiff
path: root/src/aircraft_gui.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-01-21 22:57:52 +0000
committerbjarni <bjarni@openttd.org>2007-01-21 22:57:52 +0000
commitf87494587e441a21e16b99d491bc7b34a0126462 (patch)
treec7c2bf4d3d49fd5660c122673121d7bc9fe91032 /src/aircraft_gui.cpp
parent884af9d8564ae2eab0fc7467f891bb4e01566e46 (diff)
downloadopenttd-f87494587e441a21e16b99d491bc7b34a0126462.tar.xz
(svn r8332) -Codechange: moved DrawAircraftImage() and CcBuildAircraft() from build_vehicle_gui.cpp to aircraft_gui.cpp
Diffstat (limited to 'src/aircraft_gui.cpp')
-rw-r--r--src/aircraft_gui.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp
index f9e49b9a9..b5b2f95e3 100644
--- a/src/aircraft_gui.cpp
+++ b/src/aircraft_gui.cpp
@@ -20,6 +20,32 @@
#include "vehicle_gui.h"
#include "newgrf_engine.h"
+void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection)
+{
+ SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
+ DrawSprite(GetAircraftImage(v, DIR_W), pal, x + 25, y + 10);
+ if (v->subtype == 0) {
+ SpriteID rotor_sprite = GetCustomRotorSprite(v, true);
+ if (rotor_sprite == 0) rotor_sprite = SPR_ROTOR_STOPPED;
+ DrawSprite(rotor_sprite, PAL_NONE, x + 25, y + 5);
+ }
+ if (v->index == selection) {
+ DrawFrameRect(x - 1, y - 1, x + 58, y + 21, 0xF, FR_BORDERONLY);
+ }
+}
+
+void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2)
+{
+ if (success) {
+ const Vehicle *v = GetVehicle(_new_vehicle_id);
+
+ if (v->tile == _backup_orders_tile) {
+ _backup_orders_tile = 0;
+ RestoreVehicleOrders(v, _backup_orders_data);
+ }
+ ShowAircraftViewWindow(v);
+ }
+}
void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2)
{