openttd updated to 1.5.0-beta2
--HG-- branch : openttd
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $Id: ship_gui.cpp 25454 2013-06-24 18:39:19Z rubidium $ */
|
||||
/* $Id: ship_gui.cpp 27134 2015-02-01 20:54:24Z frosch $ */
|
||||
|
||||
/*
|
||||
* This file is part of OpenTTD.
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
/**
|
||||
* Draws an image of a ship
|
||||
* @param v Front vehicle
|
||||
@@ -36,16 +38,17 @@ void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selec
|
||||
SpriteID sprite = v->GetImage(rtl ? DIR_E : DIR_W, image_type);
|
||||
const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL);
|
||||
|
||||
int width = UnScaleByZoom(real_sprite->width, ZOOM_LVL_GUI);
|
||||
int x_offs = UnScaleByZoom(real_sprite->x_offs, ZOOM_LVL_GUI);
|
||||
int width = UnScaleGUI(real_sprite->width);
|
||||
int x_offs = UnScaleGUI(real_sprite->x_offs);
|
||||
int x = rtl ? right - width - x_offs : left - x_offs;
|
||||
|
||||
DrawSprite(sprite, GetVehiclePalette(v), x, y + 10);
|
||||
y += ScaleGUITrad(10);
|
||||
DrawSprite(sprite, GetVehiclePalette(v), x, y);
|
||||
|
||||
if (v->index == selection) {
|
||||
x += x_offs;
|
||||
y += UnScaleByZoom(real_sprite->y_offs, ZOOM_LVL_GUI) + 10;
|
||||
DrawFrameRect(x - 1, y - 1, x + width + 1, y + UnScaleByZoom(real_sprite->height, ZOOM_LVL_GUI) + 1, COLOUR_WHITE, FR_BORDERONLY);
|
||||
y += UnScaleGUI(real_sprite->y_offs);
|
||||
DrawFrameRect(x - 1, y - 1, x + width + 1, y + UnScaleGUI(real_sprite->height) + 1, COLOUR_WHITE, FR_BORDERONLY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user