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

@@ -87,13 +87,14 @@ namespace OpenRA.Graphics
Util.FastCopyIntoChannel(s, 1, normals);
s.sheet.CommitData();
var channels = new float2(channelSelect[(int)s.channel], channelSelect[(int)s.channel + 1]);
var channelP =channelSelect[(int)s.channel];
var channelC = channelSelect[(int)s.channel + 1];
return new Vertex[4]
{
new Vertex(coord(0, 0), s.TopLeftTextureCoords, channels),
new Vertex(coord(su, 0), s.TopRightTextureCoords, channels),
new Vertex(coord(su, sv), s.BottomRightTextureCoords, channels),
new Vertex(coord(0, sv), s.BottomLeftTextureCoords, channels)
new Vertex(coord(0, 0), s.left, s.top, channelP, channelC),
new Vertex(coord(su, 0),s.right, s.top, channelP, channelC),
new Vertex(coord(su, sv), s.right, s.bottom, channelP, channelC),
new Vertex(coord(0, sv), s.left, s.bottom, channelP, channelC)
};
}