diff options
author | frosch <frosch@openttd.org> | 2016-10-16 14:57:56 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2016-10-16 14:57:56 +0000 |
commit | d2393b4f6c89b75a90452fe68ab8a1cfbd8c353f (patch) | |
tree | c7934b2d2a19fa55c53ac063b91cc519fb4b753a /src/train_gui.cpp | |
parent | f5409c713b002012c6a2218de1720a91282eab67 (diff) | |
download | openttd-d2393b4f6c89b75a90452fe68ab8a1cfbd8c353f.tar.xz |
(svn r27666) -Codechange: Pass vehicle sprites around using a struct VehicleSpriteSeq.
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r-- | src/train_gui.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 219d016ec..42ba87c84 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -124,7 +124,9 @@ void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID select if (rtl ? px + width > 0 : px - width < max_width) { PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); - DrawSprite(v->GetImage(dir, image_type), pal, px + (rtl ? -offset.x : offset.x), height / 2 + offset.y); + VehicleSpriteSeq seq; + v->GetImage(dir, image_type, &seq); + DrawSprite(seq.sprite, pal, px + (rtl ? -offset.x : offset.x), height / 2 + offset.y); } if (!v->IsArticulatedPart()) sel_articulated = false; @@ -383,7 +385,9 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po pitch = ScaleGUITrad(e->GetGRF()->traininfo_vehicle_pitch); } PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); - DrawSprite(u->GetImage(dir, EIT_IN_DETAILS), pal, px + (rtl ? -offset.x : offset.x), y - line_height * vscroll_pos + sprite_y_offset + pitch); + VehicleSpriteSeq seq; + u->GetImage(dir, EIT_IN_DETAILS, &seq); + DrawSprite(seq.sprite, pal, px + (rtl ? -offset.x : offset.x), y - line_height * vscroll_pos + sprite_y_offset + pitch); } px += rtl ? -width : width; dx += width; |