From d2393b4f6c89b75a90452fe68ab8a1cfbd8c353f Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 16 Oct 2016 14:57:56 +0000 Subject: (svn r27666) -Codechange: Pass vehicle sprites around using a struct VehicleSpriteSeq. --- src/ship_gui.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ship_gui.cpp') diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp index 7ad2e8473..f827b0a31 100644 --- a/src/ship_gui.cpp +++ b/src/ship_gui.cpp @@ -35,15 +35,17 @@ void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selec { 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); int x = rtl ? right - width - x_offs : left - x_offs; y += ScaleGUITrad(10); - DrawSprite(sprite, GetVehiclePalette(v), x, y); + DrawSprite(seq.sprite, GetVehiclePalette(v), x, y); if (v->index == selection) { x += x_offs; -- cgit v1.2.3-54-g00ecf