Allow sequences to define a Scale factor.

This commit is contained in:
Paul Chote
2020-12-31 17:46:25 +00:00
committed by teinarss
parent fd75e03d9c
commit f6b40b2bce
9 changed files with 20 additions and 13 deletions

View File

@@ -280,7 +280,7 @@ namespace OpenRA.Mods.Common.Traits.Render
{
return anims.Where(b => b.IsVisible
&& b.Animation.Animation.CurrentSequence != null)
.Select(a => (a.Animation.Animation.Image.Size.XY * Info.Scale).ToInt2())
.Select(a => (a.Animation.Animation.Image.Size.XY * a.Animation.Animation.CurrentSequence.Scale * Info.Scale).ToInt2())
.FirstOrDefault();
}

View File

@@ -177,7 +177,7 @@ namespace OpenRA.Mods.Common.Traits.Render
var pos = self.CenterPosition - new WVec(0, 0, dat.Length);
var palette = wr.Palette(info.ShadowPalette);
var tintModifiers = shadow.CurrentSequence.IgnoreWorldTint ? TintModifiers.IgnoreWorldTint : TintModifiers.None;
return new IRenderable[] { new SpriteRenderable(shadow.Image, pos, info.ShadowOffset, info.ShadowZOffset, palette, 1, true, tintModifiers) };
return new IRenderable[] { new SpriteRenderable(shadow.Image, pos, info.ShadowOffset, info.ShadowZOffset, palette, shadow.CurrentSequence.Scale, true, tintModifiers) };
}
IEnumerable<Rectangle> IRender.ScreenBounds(Actor self, WorldRenderer wr)