Automatically flush line renderer when changing width.
This commit is contained in:
@@ -15,9 +15,8 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
public class LineRenderer : Renderer.IBatchRenderer
|
||||
{
|
||||
public float LineWidth = 1f;
|
||||
static float2 offset = new float2(0.5f,0.5f);
|
||||
|
||||
static float2 offset = new float2(0.5f, 0.5f);
|
||||
float lineWidth = 1f;
|
||||
Renderer renderer;
|
||||
IShader shader;
|
||||
|
||||
@@ -30,6 +29,19 @@ namespace OpenRA.Graphics
|
||||
this.shader = shader;
|
||||
}
|
||||
|
||||
|
||||
public float LineWidth
|
||||
{
|
||||
get { return lineWidth; }
|
||||
set
|
||||
{
|
||||
if (LineWidth != value)
|
||||
Flush();
|
||||
|
||||
lineWidth = value;
|
||||
}
|
||||
}
|
||||
|
||||
public void Flush()
|
||||
{
|
||||
if (nv > 0)
|
||||
|
||||
Reference in New Issue
Block a user