Made Sheet.Texture into Sheet.GetTexture() since we will want to call it for side-effects.

Do the same for Sheet.Data since it has the side effect of generating a buffer.
This commit is contained in:
RoosterDragon
2014-10-14 17:02:48 +01:00
committed by RoosterDragon
parent ff16690b86
commit a6f5a21ed4
9 changed files with 25 additions and 31 deletions

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Graphics
{
if (nv > 0)
{
shader.SetTexture("DiffuseTexture", currentSheet.Texture);
shader.SetTexture("DiffuseTexture", currentSheet.GetTexture());
renderer.Device.SetBlendMode(currentBlend);
shader.Render(() =>
@@ -109,7 +109,7 @@ namespace OpenRA.Graphics
public void DrawVertexBuffer(IVertexBuffer<Vertex> buffer, int start, int length, PrimitiveType type, Sheet sheet)
{
shader.SetTexture("DiffuseTexture", sheet.Texture);
shader.SetTexture("DiffuseTexture", sheet.GetTexture());
renderer.Device.SetBlendMode(BlendMode.Alpha);
shader.Render(() => renderer.DrawBatch(buffer, start, length, type));
renderer.Device.SetBlendMode(BlendMode.None);