Render lines using SpriteRenderer without breaking the batch.
This commit is contained in:
@@ -37,7 +37,8 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
if (nv > 0)
|
||||
{
|
||||
shader.SetTexture("DiffuseTexture", currentSheet.GetTexture());
|
||||
if (currentSheet != null)
|
||||
shader.SetTexture("DiffuseTexture", currentSheet.GetTexture());
|
||||
|
||||
renderer.Device.SetBlendMode(currentBlend);
|
||||
shader.Render(renderAction);
|
||||
@@ -109,6 +110,19 @@ namespace OpenRA.Graphics
|
||||
renderer.Device.SetBlendMode(BlendMode.None);
|
||||
}
|
||||
|
||||
// For RGBAColorRenderer
|
||||
internal void DrawRGBAVertices(Vertex[] v)
|
||||
{
|
||||
renderer.CurrentBatchRenderer = this;
|
||||
|
||||
if (currentBlend != BlendMode.Alpha || nv + v.Length > renderer.TempBufferSize)
|
||||
Flush();
|
||||
|
||||
currentBlend = BlendMode.Alpha;
|
||||
Array.Copy(v, 0, vertices, nv, v.Length);
|
||||
nv += v.Length;
|
||||
}
|
||||
|
||||
public void SetPalette(ITexture palette)
|
||||
{
|
||||
shader.SetTexture("Palette", palette);
|
||||
|
||||
Reference in New Issue
Block a user