From 245e32a10efb0dc924289a8cdec089cd13f3b47d Mon Sep 17 00:00:00 2001 From: michi_cc Date: Sun, 23 Dec 2012 01:00:25 +0000 Subject: (svn r24839) -Feature [FS#5271]: [NewGRF] Support oversized purchase list sprites. (Based on patch by Eddi) --- src/ship_cmd.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/ship_cmd.cpp') diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 9bf97fbd9..5c2056081 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -86,17 +86,22 @@ void DrawShipEngine(int left, int right, int preferred_x, int y, EngineID engine } /** - * Get the size of the sprite of a ship sprite heading west (used for lists) - * @param engine The engine to get the sprite from - * @param width The width of the sprite - * @param height The height of the sprite + * Get the size of the sprite of a ship sprite heading west (used for lists). + * @param engine The engine to get the sprite from. + * @param[out] width The width of the sprite. + * @param[out] height The height of the sprite. + * @param[out] xoffs Number of pixels to shift the sprite to the right. + * @param[out] yoffs Number of pixels to shift the sprite downwards. + * @param image_type Context the sprite is used in. */ -void GetShipSpriteSize(EngineID engine, uint &width, uint &height, EngineImageType image_type) +void GetShipSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, int &yoffs, EngineImageType image_type) { const Sprite *spr = GetSprite(GetShipIcon(engine, image_type), ST_NORMAL); width = UnScaleByZoom(spr->width, ZOOM_LVL_GUI); height = UnScaleByZoom(spr->height, ZOOM_LVL_GUI); + xoffs = UnScaleByZoom(spr->x_offs, ZOOM_LVL_GUI); + yoffs = UnScaleByZoom(spr->y_offs, ZOOM_LVL_GUI); } SpriteID Ship::GetImage(Direction direction, EngineImageType image_type) const -- cgit v1.2.3-54-g00ecf