Add depth support to TileSet.

This commit is contained in:
Paul Chote
2016-04-08 14:15:26 -04:00
parent d7f140d5a3
commit 756d2428d9
5 changed files with 30 additions and 17 deletions

View File

@@ -68,12 +68,10 @@ namespace OpenRA.Graphics
public void Update(CPos cell, Sprite sprite)
{
var xy = sprite == null ? float2.Zero :
worldRenderer.ScreenPosition(map.CenterOfCell(cell)) + sprite.Offset - 0.5f * sprite.Size;
var xyz = sprite == null ? float3.Zero :
worldRenderer.Screen3DPosition(map.CenterOfCell(cell)) + sprite.Offset - 0.5f * sprite.Size;
// TODO: Deal with sprite z offsets
var z = worldRenderer.ScreenZPosition(map.CenterOfCell(cell), 0);
Update(cell.ToMPos(map.Grid.Type), sprite, new float3(xy.X, xy.Y, z));
Update(cell.ToMPos(map.Grid.Type), sprite, xyz);
}
public void Update(MPos uv, Sprite sprite, float3 pos)