diff options
author | rubidium <rubidium@openttd.org> | 2009-11-16 22:25:01 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-11-16 22:25:01 +0000 |
commit | a808623b24b247d3a8b3b08875dd6cd2e22a85c6 (patch) | |
tree | 9f899d3a21ba89f4155651ef014a83b4e8392786 /src/aircraft_gui.cpp | |
parent | 6204c56d99d934c0fb04bf6194a7fa29e46953b8 (diff) | |
download | openttd-a808623b24b247d3a8b3b08875dd6cd2e22a85c6.tar.xz |
(svn r18133) -Codechange: pass the 'maximum' left/right positions to Draw*Image
Diffstat (limited to 'src/aircraft_gui.cpp')
-rw-r--r-- | src/aircraft_gui.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index 689411a4d..21cfb7960 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -69,18 +69,26 @@ void DrawAircraftDetails(const Aircraft *v, int left, int right, int y) } -void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection) +/** + * Draws an image of an aircraft + * @param v Front vehicle + * @param left The minimum horizontal position + * @param right The maximum horizontal position + * @param y Vertical position to draw at + * @param selection Selected vehicle to draw a frame around + */ +void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID selection) { SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); - DrawSprite(v->GetImage(DIR_W), pal, x + 25, y + 10); + DrawSprite(v->GetImage(DIR_W), pal, left + 25, y + 10); if (v->subtype == AIR_HELICOPTER) { const Aircraft *a = Aircraft::From(v); SpriteID rotor_sprite = GetCustomRotorSprite(a, true); if (rotor_sprite == 0) rotor_sprite = SPR_ROTOR_STOPPED; - DrawSprite(rotor_sprite, PAL_NONE, x + 25, y + 5); + DrawSprite(rotor_sprite, PAL_NONE, left + 25, y + 5); } if (v->index == selection) { - DrawFrameRect(x - 1, y - 1, x + 58, y + 21, COLOUR_WHITE, FR_BORDERONLY); + DrawFrameRect(left - 1, y - 1, left + 58, y + 21, COLOUR_WHITE, FR_BORDERONLY); } } |