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:
RoosterDragon
2014-10-10 09:38:14 +01:00
parent 31a096dcf1
commit 69125989ab
6 changed files with 32 additions and 46 deletions

View File

@@ -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;
}
}
}