Sliders change the preview palette and update client data; Need a better algorithm for picking color2

This commit is contained in:
Paul Chote
2010-07-16 23:34:42 +12:00
parent 4fb3f67a9d
commit c4442f07da
7 changed files with 63 additions and 19 deletions

View File

@@ -72,7 +72,18 @@ namespace OpenRA.Graphics
}
return allocated++;
}
public void UpdatePalette(string name, Palette p)
{
palettes[name] = p;
var j = indices[name];
for (int i = 0; i < 256; i++)
{
this[new Point(i, j)] = p.GetColor(i);
}
}
public void Update(IEnumerable<IPaletteModifier> paletteMods)
{
var b = new Bitmap(Bitmap);