summaryrefslogtreecommitdiff
path: root/src/ship_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-10-16 14:57:56 +0000
committerfrosch <frosch@openttd.org>2016-10-16 14:57:56 +0000
commitd2393b4f6c89b75a90452fe68ab8a1cfbd8c353f (patch)
treec7934b2d2a19fa55c53ac063b91cc519fb4b753a /src/ship_gui.cpp
parentf5409c713b002012c6a2218de1720a91282eab67 (diff)
downloadopenttd-d2393b4f6c89b75a90452fe68ab8a1cfbd8c353f.tar.xz
(svn r27666) -Codechange: Pass vehicle sprites around using a struct VehicleSpriteSeq.
Diffstat (limited to 'src/ship_gui.cpp')
-rw-r--r--src/ship_gui.cpp8
1 files changed, 5 insertions, 3 deletions
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;