Mercurial > hg > openttd
changeset 5780:10c1b221d4bc draft
(svn r8332) -Codechange: moved DrawAircraftImage() and CcBuildAircraft() from build_vehicle_gui.cpp to aircraft_gui.cpp
author | bjarni <bjarni@openttd.org> |
---|---|
date | Sun, 21 Jan 2007 22:57:52 +0000 |
parents | c51484ffbf87 |
children | 614f7d033762 |
files | src/aircraft.h src/aircraft_gui.cpp src/build_vehicle_gui.cpp |
diffstat | 3 files changed, 27 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/src/aircraft.h +++ b/src/aircraft.h @@ -20,6 +20,7 @@ uint16 AircraftDefaultCargoCapacity(CargoID cid, EngineID engine_type); +void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2); void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2); void HandleAircraftEnterHangar(Vehicle *v);
--- 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) {
--- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -488,33 +488,6 @@ } } -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); - } -} - /* Figure out what train EngineIDs to put in the list */ static void GenerateBuildTrainList(Window *w) {