Fix aircraft shadow render order.
This commit is contained in:
@@ -23,8 +23,8 @@ namespace OpenRA.Graphics
|
|||||||
|
|
||||||
public int Compare(IRenderable x, IRenderable y)
|
public int Compare(IRenderable x, IRenderable y)
|
||||||
{
|
{
|
||||||
var xOrder = wr.ScreenZPosition(x.Pos) + x.ZOffset;
|
var xOrder = wr.ScreenZPosition(x.Pos, x.ZOffset);
|
||||||
var yOrder = wr.ScreenZPosition(y.Pos) + y.ZOffset;
|
var yOrder = wr.ScreenZPosition(y.Pos, y.ZOffset);
|
||||||
return xOrder.CompareTo(yOrder);
|
return xOrder.CompareTo(yOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,6 +219,6 @@ namespace OpenRA.Graphics
|
|||||||
return new int2((int)Math.Round(px.X), (int)Math.Round(px.Y));
|
return new int2((int)Math.Round(px.X), (int)Math.Round(px.Y));
|
||||||
}
|
}
|
||||||
|
|
||||||
public float ScreenZPosition(WPos pos) { return (pos.Y + pos.Z)*Game.CellSize/1024f; }
|
public float ScreenZPosition(WPos pos, int zOffset) { return (pos.Y + pos.Z + zOffset)*Game.CellSize/1024f; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Render
|
|||||||
? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
|
? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
|
||||||
|
|
||||||
var shadowSprites = r.Select(a => a.WithPalette(wr.Palette("shadow"))
|
var shadowSprites = r.Select(a => a.WithPalette(wr.Palette("shadow"))
|
||||||
.WithPos(a.Pos - new WVec(0, 0, a.Pos.Z)).WithZOffset(-24));
|
.WithPos(a.Pos - new WVec(0, 0, a.Pos.Z)).WithZOffset(a.ZOffset + a.Pos.Z));
|
||||||
|
|
||||||
var flyingSprites = (move.Altitude <= 0) ? r :
|
var flyingSprites = (move.Altitude <= 0) ? r :
|
||||||
r.Select(a => a.WithPos(a.Pos - new WVec(0,0,43*visualOffset)));
|
r.Select(a => a.WithPos(a.Pos - new WVec(0,0,43*visualOffset)));
|
||||||
|
|||||||
Reference in New Issue
Block a user