Update openttd to 1.7.0-RC1

--HG--
branch : openttd
This commit is contained in:
Pavel Stupnikov
2017-03-12 16:41:12 +03:00
parent ecdb1590ab
commit 3433ae02f4
262 changed files with 5052 additions and 3913 deletions
+11 -8
View File
@@ -1,4 +1,4 @@
/* $Id: ship_gui.cpp 27134 2015-02-01 20:54:24Z frosch $ */
/* $Id: ship_gui.cpp 27667 2016-10-16 14:58:38Z frosch $ */
/*
* This file is part of OpenTTD.
@@ -35,20 +35,23 @@ 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);
int width = UnScaleGUI(real_sprite->width);
int x_offs = UnScaleGUI(real_sprite->x_offs);
Rect rect;
seq.GetBounds(&rect);
int width = UnScaleGUI(rect.right - rect.left + 1);
int x_offs = UnScaleGUI(rect.left);
int x = rtl ? right - width - x_offs : left - x_offs;
y += ScaleGUITrad(10);
DrawSprite(sprite, GetVehiclePalette(v), x, y);
seq.Draw(x, y, GetVehiclePalette(v), false);
if (v->index == selection) {
x += x_offs;
y += UnScaleGUI(real_sprite->y_offs);
DrawFrameRect(x - 1, y - 1, x + width + 1, y + UnScaleGUI(real_sprite->height) + 1, COLOUR_WHITE, FR_BORDERONLY);
y += UnScaleGUI(rect.top);
DrawFrameRect(x - 1, y - 1, x + width + 1, y + UnScaleGUI(rect.bottom - rect.top + 1) + 1, COLOUR_WHITE, FR_BORDERONLY);
}
}