From 4df64eb18fafdd249b9e449fe5ac63690c0bef43 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 23 May 2015 09:17:25 +0100 Subject: [PATCH] Expose vertex components. --- OpenRA.Game/Graphics/Vertex.cs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/OpenRA.Game/Graphics/Vertex.cs b/OpenRA.Game/Graphics/Vertex.cs index 67acc0f49b..0b94af2230 100644 --- a/OpenRA.Game/Graphics/Vertex.cs +++ b/OpenRA.Game/Graphics/Vertex.cs @@ -15,24 +15,19 @@ namespace OpenRA.Graphics [StructLayout(LayoutKind.Sequential)] public struct Vertex { - // TODO Workaround for unused field warnings in mono 2.10 - #pragma warning disable 414 - float x, y, z, u, v; - float p, c; - #pragma warning restore + public readonly float X, Y, Z, U, V, P, C; 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 = u; this.v = v; - this.p = p; this.c = c; - } + : this(xy.X, xy.Y, 0, u, v, p, c) { } public Vertex(float[] xyz, float u, float v, float p, float c) + : this(xyz[0], xyz[1], xyz[2], u, v, p, c) { } + + public Vertex(float x, float y, float z, float u, float v, float p, float c) { - this.x = xyz[0]; this.y = xyz[1]; this.z = xyz[2]; - this.u = u; this.v = v; - this.p = p; this.c = c; + X = x; Y = y; Z = z; + U = u; V = v; + P = p; C = c; } } }