did palette animation the sane way (switching palettes) rather than cycling 0x60-0x66 in the shader

This commit is contained in:
Chris Forbes
2009-10-13 23:02:46 +13:00
parent d8d1def249
commit bebe9bee85
4 changed files with 17 additions and 24 deletions

View File

@@ -13,7 +13,7 @@ namespace OpenRa.Game.Graphics
const int maxEntries = 8;
int allocated = 0;
public HardwarePalette(Renderer renderer, Map map)
public HardwarePalette(Renderer renderer, Map map, int rotate)
: base(renderer,new Size(256, maxEntries))
{
Palette pal = new Palette(FileSystem.Open(map.Theater + ".pal"));
@@ -21,6 +21,11 @@ namespace OpenRa.Game.Graphics
foreach (string remap in new string[] { "blue", "red", "orange", "teal", "salmon", "green", "gray" })
AddPalette(new Palette(pal, new PaletteRemap(FileSystem.Open(remap + ".rem"))));
using (var bitmapCopy = new Bitmap(bitmap))
for (int j = 0; j < maxEntries; j++)
for (int i = 0; i < 7; i++)
this[new Point(0x60 + i, j)] = bitmapCopy.GetPixel(0x60 + (rotate + i) % 7, j);
}
int AddPalette(Palette p)