git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1199 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-13 13:06:41 +00:00
parent 0293544f89
commit 37b0d0cb57
11 changed files with 165 additions and 248 deletions

View File

@@ -19,9 +19,16 @@ namespace OpenRa.Game
Texture paletteTexture;
public HardwarePalette(GraphicsDevice device)
public HardwarePalette(GraphicsDevice device, Map map)
{
this.device = device;
Palette pal = new Palette(File.OpenRead("../../../" + map.Theater + ".pal"));
AddPalette(pal);
foreach (string remap in new string[] { "blue", "red", "orange", "teal", "salmon", "green", "gray" })
AddPalette(new Palette(pal, new PaletteRemap(
File.OpenRead("../../../" + remap + ".rem"))));
}
void Resolve()
@@ -44,7 +51,7 @@ namespace OpenRa.Game
}
}
public int AddPalette(Palette p)
int AddPalette(Palette p)
{
for (int i = 0; i < 256; i++)
bitmap.SetPixel(i, allocated, p.GetColor(i));