Scale is now set via a field on Render* and interacts properly with chronoshift and building previews.

This commit is contained in:
Paul Chote
2010-11-27 13:30:08 +13:00
parent 840ade5b78
commit 00a0aac7a3
10 changed files with 25 additions and 76 deletions

View File

@@ -100,12 +100,7 @@ namespace OpenRA.Traits
public static Renderable Centered(Actor self, Sprite s, float2 location)
{
var pal = self.Owner == null ? "player0" : self.Owner.Palette;
var scale = self.TraitOrDefault<Scale>();
var scaleModifier = 1f;
if (scale != null)
scaleModifier = scale.Info.Value;
var loc = location - 0.5f * s.size * scaleModifier;
var loc = location - 0.5f * s.size;
return new Renderable(s, loc.Round(), pal, (int)self.CenterLocation.Y);
}