summaryrefslogtreecommitdiff
path: root/src/sprite.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2011-11-24 12:38:48 +0000
committerpeter1138 <peter1138@openttd.org>2011-11-24 12:38:48 +0000
commit81598273e9b6bb2ee20ebdd82f3d4646a02999ba (patch)
tree2d13cc93dc84f2d99cff6fc2bb02214d4453f033 /src/sprite.cpp
parent15d0a22aac6b90a2055e68d019cab4350376a8fd (diff)
downloadopenttd-81598273e9b6bb2ee20ebdd82f3d4646a02999ba.tar.xz
(svn r23316) -Feature: Add ability to zoom in to 2x and 4x level.
Diffstat (limited to 'src/sprite.cpp')
-rw-r--r--src/sprite.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sprite.cpp b/src/sprite.cpp
index a991d315f..69a8ed92e 100644
--- a/src/sprite.cpp
+++ b/src/sprite.cpp
@@ -16,6 +16,7 @@
#include "spritecache.h"
#include "core/alloc_func.hpp"
#include "core/mem_func.hpp"
+#include "zoom_func.h"
/**
@@ -118,11 +119,11 @@ 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 + pt.x, y + pt.y);
+ DrawSprite(image, pal, x + UnScaleByZoom(pt.x, ZOOM_LVL_GUI), y + UnScaleByZoom(pt.y, ZOOM_LVL_GUI));
const Sprite *spr = GetSprite(image & SPRITE_MASK, ST_NORMAL);
- child_offset.x = pt.x + spr->x_offs;
- child_offset.y = pt.y + spr->y_offs;
+ child_offset.x = UnScaleByZoom(pt.x + spr->x_offs, ZOOM_LVL_GUI);
+ child_offset.y = UnScaleByZoom(pt.y + spr->y_offs, ZOOM_LVL_GUI);
} 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;