summaryrefslogtreecommitdiff
path: root/src/viewport.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2011-11-25 23:06:17 +0000
committerpeter1138 <peter1138@openttd.org>2011-11-25 23:06:17 +0000
commit07633a064c062bc5e997c6aa74a48aa4a82e8cc8 (patch)
treea29108d2994244e2150df8b8d60f481fa4d3910d /src/viewport.cpp
parent2f05d090fb17437039c2559ece4025bbb4f47499 (diff)
downloadopenttd-07633a064c062bc5e997c6aa74a48aa4a82e8cc8.tar.xz
(svn r23329) -Fix (r23316): Scale child sprite pixel offsets unless told not to. Fixes lifts and industry graphics.
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r--src/viewport.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 56b2941aa..0d97c3d24 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -513,7 +513,7 @@ static void AddChildSpriteToFoundation(SpriteID image, PaletteID pal, const SubS
int *old_child = _vd.last_child;
_vd.last_child = _vd.last_foundation_child[foundation_part];
- AddChildSpriteScreen(image, pal, offs.x + extra_offs_x, offs.y + extra_offs_y, false, sub);
+ AddChildSpriteScreen(image, pal, offs.x + extra_offs_x, offs.y + extra_offs_y, false, sub, false);
/* Switch back to last ChildSprite list */
_vd.last_child = old_child;
@@ -611,7 +611,7 @@ static void AddCombinedSprite(SpriteID image, PaletteID pal, int x, int y, int z
return;
const ParentSpriteToDraw *pstd = _vd.parent_sprites_to_draw.End() - 1;
- AddChildSpriteScreen(image, pal, pt.x - pstd->left, pt.y - pstd->top, false, sub);
+ AddChildSpriteScreen(image, pal, pt.x - pstd->left, pt.y - pstd->top, false, sub, false);
}
/**
@@ -794,7 +794,7 @@ bool IsInsideRotatedRectangle(int x, int y)
* @param transparent if true, switch the palette between the provided palette and the transparent palette,
* @param sub Only draw a part of the sprite.
*/
-void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent, const SubSprite *sub)
+void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent, const SubSprite *sub, bool scale)
{
assert((image & SPRITE_MASK) < MAX_SPRITES);
@@ -813,8 +813,8 @@ void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool tran
cs->image = image;
cs->pal = pal;
cs->sub = sub;
- cs->x = x;
- cs->y = y;
+ cs->x = scale ? x * ZOOM_LVL_BASE : x;
+ cs->y = scale ? y * ZOOM_LVL_BASE : y;
cs->next = -1;
/* Append the sprite to the active ChildSprite list.