Changed Vertex constructors to pass more parameters as plain floats.
This avoids callers having to construct a float2 struct, only to have the Vertex constructor unwrap it into individual components again.
This commit is contained in:
@@ -18,18 +18,18 @@ namespace OpenRA.Graphics
|
||||
public float x, y, z, u, v;
|
||||
public float p, c;
|
||||
|
||||
public Vertex(float2 xy, float2 uv, float2 pc)
|
||||
public Vertex(float2 xy, float u, float v, float p, float c)
|
||||
{
|
||||
this.x = xy.X; this.y = xy.Y; this.z = 0;
|
||||
this.u = uv.X; this.v = uv.Y;
|
||||
this.p = pc.X; this.c = pc.Y;
|
||||
this.u = u; this.v = v;
|
||||
this.p = p; this.c = c;
|
||||
}
|
||||
|
||||
public Vertex(float[] xyz, float2 uv, float2 pc)
|
||||
public Vertex(float[] xyz, float u, float v, float p, float c)
|
||||
{
|
||||
this.x = xyz[0]; this.y = xyz[1]; this.z = xyz[2];
|
||||
this.u = uv.X; this.v = uv.Y;
|
||||
this.p = pc.X; this.c = pc.Y;
|
||||
this.u = u; this.v = v;
|
||||
this.p = p; this.c = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user