summaryrefslogtreecommitdiff
path: root/src/aircraft_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/aircraft_gui.cpp')
-rw-r--r--src/aircraft_gui.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp
index c3379d395..752e0da90 100644
--- a/src/aircraft_gui.cpp
+++ b/src/aircraft_gui.cpp
@@ -83,8 +83,10 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s
{
bool rtl = _current_text_dir == TD_RTL;
- SpriteID sprite = v->GetImage(rtl ? DIR_E : DIR_W, image_type);
- const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL);
+ VehicleSpriteSeq seq;
+ v->GetImage(rtl ? DIR_E : DIR_W, image_type, &seq);
+
+ const Sprite *real_sprite = GetSprite(seq.sprite, ST_NORMAL);
int width = UnScaleGUI(real_sprite->width);
int x_offs = UnScaleGUI(real_sprite->x_offs);
@@ -95,13 +97,14 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s
int heli_offs = 0;
PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
- DrawSprite(sprite, pal, x, y + y_offs);
+ DrawSprite(seq.sprite, pal, x, y + y_offs);
if (helicopter) {
const Aircraft *a = Aircraft::From(v);
- SpriteID rotor_sprite = GetCustomRotorSprite(a, true, image_type);
- if (rotor_sprite == 0) rotor_sprite = SPR_ROTOR_STOPPED;
+ VehicleSpriteSeq rotor_seq;
+ GetCustomRotorSprite(a, true, image_type, &rotor_seq);
+ if (!rotor_seq.IsValid()) rotor_seq.Set(SPR_ROTOR_STOPPED);
heli_offs = ScaleGUITrad(5);
- DrawSprite(rotor_sprite, PAL_NONE, x, y + y_offs - heli_offs);
+ DrawSprite(rotor_seq.sprite, PAL_NONE, x, y + y_offs - heli_offs);
}
if (v->index == selection) {
x += x_offs;