Support rendering sprites into non-rectangular quads.

This commit is contained in:
Paul Chote
2013-06-13 05:07:47 +12:00
parent 7a71f87d9f
commit 2215f74959
2 changed files with 27 additions and 8 deletions

View File

@@ -81,6 +81,21 @@ namespace OpenRA.Graphics
DrawSprite(s, location, 0, size);
}
public void DrawSprite(Sprite s, float2 a, float2 b, float2 c, float2 d)
{
Renderer.CurrentBatchRenderer = this;
if (s.sheet != currentSheet)
Flush();
if (nv + 4 > Renderer.TempBufferSize)
Flush();
currentSheet = s.sheet;
Util.FastCreateQuad(vertices, a, b, c, d, s, 0, nv);
nv += 4;
}
public void DrawVertexBuffer(IVertexBuffer<Vertex> buffer, int start, int length, PrimitiveType type, Sheet sheet)
{
shader.SetTexture("DiffuseTexture", sheet.Texture);