From af6660d6cac4f543e55f907319a9b1a5884eefb5 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 14 Aug 2010 23:36:41 +1200 Subject: [PATCH] Fix palette remaps --- OpenRA.FileFormats/Palette.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenRA.FileFormats/Palette.cs b/OpenRA.FileFormats/Palette.cs index 13ef0e2fc9..0d4333244d 100644 --- a/OpenRA.FileFormats/Palette.cs +++ b/OpenRA.FileFormats/Palette.cs @@ -57,14 +57,16 @@ namespace OpenRA.FileFormats colors[0] = 0; if (remapTransparent) { - colors[3] = (uint)178 << 24; - colors[4] = (uint)140 << 24; + colors[3] = 178u << 24; + colors[4] = 140u << 24; } } public Palette(Palette p, IPaletteRemap r) { - colors = p.colors; + colors = new uint[256]; + for(int i = 0; i < 256; i++) + colors[i] = (uint)r.GetRemappedColor(Color.FromArgb((int)p.colors[i]),i).ToArgb(); } public Palette(Palette p)