Changeset - r18475:32c5c57322ff
[Not reviewed]
master
0 2 0
peter1138 - 13 years ago 2011-11-25 23:06:17
peter1138@openttd.org
(svn r23329) -Fix (r23316): Scale child sprite pixel offsets unless told not to. Fixes lifts and industry graphics.
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/viewport.cpp
Show inline comments
 
@@ -513,7 +513,7 @@ static void AddChildSpriteToFoundation(S
 
	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 i
 
		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
 
 * @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
 
	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.
src/viewport_func.h
Show inline comments
 
@@ -50,7 +50,7 @@ void OffsetGroundSprite(int x, int y);
 
void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub = NULL, int extra_offs_x = 0, int extra_offs_y = 0);
 
void DrawGroundSpriteAt(SpriteID image, PaletteID pal, int32 x, int32 y, int z, const SubSprite *sub = NULL, int extra_offs_x = 0, int extra_offs_y = 0);
 
void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent = false, int bb_offset_x = 0, int bb_offset_y = 0, int bb_offset_z = 0, const SubSprite *sub = NULL);
 
void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent = false, const SubSprite *sub = NULL);
 
void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent = false, const SubSprite *sub = NULL, bool scale = true);
 
void ViewportAddString(const DrawPixelInfo *dpi, ZoomLevel small_from, const ViewportSign *sign, StringID string_normal, StringID string_small, StringID string_small_shadow, uint64 params_1, uint64 params_2 = 0, Colours colour = INVALID_COLOUR);
 

	
 

	
0 comments (0 inline, 0 general)