Add depth buffer support to sprites and sequences.
This commit is contained in:
@@ -228,7 +228,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
return anims.Where(b => b.IsVisible
|
||||
&& b.Animation.Animation.CurrentSequence != null)
|
||||
.Select(a => (a.Animation.Animation.Image.Size * info.Scale).ToInt2())
|
||||
.Select(a => (a.Animation.Animation.Image.Size.XY * info.Scale).ToInt2())
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
pipImages.PlayFetchIndex("groups", () => (int)group);
|
||||
pipImages.Tick();
|
||||
|
||||
var pos = basePosition - (0.5f * pipImages.Image.Size).ToInt2() + new int2(9, 5);
|
||||
var pos = basePosition - (0.5f * pipImages.Image.Size.XY).ToInt2() + new int2(9, 5);
|
||||
yield return new UISpriteRenderable(pipImages.Image, self.CenterPosition, pos, 0, pal, 1f);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var pipImages = new Animation(self.World, "pips");
|
||||
pipImages.PlayRepeating(PipStrings[0]);
|
||||
|
||||
var pipSize = pipImages.Image.Size.ToInt2();
|
||||
var pipSize = pipImages.Image.Size.XY.ToInt2();
|
||||
var pipxyBase = basePosition + new int2(1 - pipSize.X / 2, -(3 + pipSize.Y / 2));
|
||||
var pipxyOffset = new int2(0, 0);
|
||||
var pal = wr.Palette(Info.Palette);
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return Enumerable.Empty<IRenderable>();
|
||||
|
||||
var bounds = self.VisualBounds;
|
||||
var halfSize = (0.5f * Anim.Image.Size).ToInt2();
|
||||
var halfSize = (0.5f * Anim.Image.Size.XY).ToInt2();
|
||||
|
||||
var boundsOffset = new int2(bounds.Left + bounds.Right, bounds.Top + bounds.Bottom) / 2;
|
||||
var sizeOffset = -halfSize;
|
||||
|
||||
@@ -71,10 +71,10 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
struct TileInfo
|
||||
{
|
||||
public readonly float2 ScreenPosition;
|
||||
public readonly float3 ScreenPosition;
|
||||
public readonly byte Variant;
|
||||
|
||||
public TileInfo(float2 screenPosition, byte variant)
|
||||
public TileInfo(float3 screenPosition, byte variant)
|
||||
{
|
||||
ScreenPosition = screenPosition;
|
||||
Variant = variant;
|
||||
|
||||
Reference in New Issue
Block a user