Don't store pre-calculated texture coords in Sprite.
By storing only the four corners, we can save the object overhead of an array and 4 float elements per sprite. This results in savings of around 5 MiB to store these coordinates.
This commit is contained in:
@@ -90,10 +90,10 @@ namespace OpenRA.Graphics
|
||||
var channels = new float2(channelSelect[(int)s.channel], channelSelect[(int)s.channel + 1]);
|
||||
return new Vertex[4]
|
||||
{
|
||||
new Vertex(coord(0, 0), s.FastMapTextureCoords(0), channels),
|
||||
new Vertex(coord(su, 0), s.FastMapTextureCoords(1), channels),
|
||||
new Vertex(coord(su, sv), s.FastMapTextureCoords(3), channels),
|
||||
new Vertex(coord(0, sv), s.FastMapTextureCoords(2), channels)
|
||||
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)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user