Convert terrain rendering to world coords.

This commit is contained in:
Paul Chote
2013-09-28 13:07:03 +12:00
parent 1a31368953
commit c42a6f8386

View File

@@ -30,12 +30,15 @@ namespace OpenRA.Graphics
int nv = 0;
for (var j = map.Bounds.Top; j < map.Bounds.Bottom; j++)
{
for (var i = map.Bounds.Left; i < map.Bounds.Right; i++)
{
var tile = wr.Theater.TileSprite(map.MapTiles.Value[i, j]);
Util.FastCreateQuad(vertices, Game.CellSize * new float2(i, j), tile, terrainPalette, nv, tile.size);
var pos = wr.ScreenPosition(new CPos(i, j).CenterPosition) - 0.5f * tile.size;
Util.FastCreateQuad(vertices, pos, tile, terrainPalette, nv, tile.size);
nv += 4;
}
}
vertexBuffer = Game.Renderer.Device.CreateVertexBuffer(vertices.Length);
vertexBuffer.SetData(vertices, nv);