diff options
author | frosch <frosch@openttd.org> | 2015-02-01 20:54:24 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-02-01 20:54:24 +0000 |
commit | a8080b62563dcb9f3e3bf5180ebf2de6cf6b68ae (patch) | |
tree | 3ac628ab264823257073f281ce7e692f07e5c651 /src/sprite.cpp | |
parent | 3bc7ee3ab731c7a855f811b36356ed907b42989a (diff) | |
download | openttd-a8080b62563dcb9f3e3bf5180ebf2de6cf6b68ae.tar.xz |
(svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad().
Diffstat (limited to 'src/sprite.cpp')
-rw-r--r-- | src/sprite.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sprite.cpp b/src/sprite.cpp index 6db6966d8..22210712a 100644 --- a/src/sprite.cpp +++ b/src/sprite.cpp @@ -119,15 +119,15 @@ void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig if (dtss->IsParentSprite()) { Point pt = RemapCoords(dtss->delta_x, dtss->delta_y, dtss->delta_z); - DrawSprite(image, pal, x + UnScaleByZoom(pt.x, ZOOM_LVL_GUI), y + UnScaleByZoom(pt.y, ZOOM_LVL_GUI)); + DrawSprite(image, pal, x + UnScaleGUI(pt.x), y + UnScaleGUI(pt.y)); const Sprite *spr = GetSprite(image & SPRITE_MASK, ST_NORMAL); - child_offset.x = UnScaleByZoom(pt.x + spr->x_offs, ZOOM_LVL_GUI); - child_offset.y = UnScaleByZoom(pt.y + spr->y_offs, ZOOM_LVL_GUI); + child_offset.x = UnScaleGUI(pt.x + spr->x_offs); + child_offset.y = UnScaleGUI(pt.y + spr->y_offs); } else { int offs_x = child_offset_is_unsigned ? (uint8)dtss->delta_x : dtss->delta_x; int offs_y = child_offset_is_unsigned ? (uint8)dtss->delta_y : dtss->delta_y; - DrawSprite(image, pal, x + child_offset.x + offs_x, y + child_offset.y + offs_y); + DrawSprite(image, pal, x + child_offset.x + ScaleGUITrad(offs_x), y + child_offset.y + ScaleGUITrad(offs_y)); } } } |