Remove unnecessary indirection from palette creation.

This commit is contained in:
Paul Chote
2013-02-22 12:12:45 +13:00
parent db7887687b
commit 2d10f6b739
8 changed files with 73 additions and 61 deletions

View File

@@ -76,6 +76,13 @@ namespace OpenRA.FileFormats
colors = (uint[])p.colors.Clone();
}
public Palette(uint[] data)
{
if (data.Length != 256)
throw new InvalidDataException("Attempting to create palette with incorrect array size");
colors = (uint[])data.Clone();
}
public ColorPalette AsSystemPalette()
{
ColorPalette pal;