diff --git a/OpenRA.FileFormats/PlayerColorRemap.cs b/OpenRA.FileFormats/PlayerColorRemap.cs index ec07d24235..e2387c64b8 100755 --- a/OpenRA.FileFormats/PlayerColorRemap.cs +++ b/OpenRA.FileFormats/PlayerColorRemap.cs @@ -19,12 +19,6 @@ namespace OpenRA.FileFormats { Dictionary remapColors; - static int[] GetRemapRamp(int[] Ramp) - { - var RemapRamp = Ramp.Select(r => r - Ramp[0]).ToArray(); - return RemapRamp; - } - public static int GetRemapIndex(int[] Ramp, int i) { return Ramp[i]; @@ -33,11 +27,18 @@ namespace OpenRA.FileFormats public PlayerColorRemap(int[] Ramp, ColorRamp c) { var c1 = c.GetColor(0); - var c2 = c.GetColor(1); /* temptemp: this can be expressed better */ + var c2 = c.GetColor(1); // temptemp: this can be expressed better var baseIndex = Ramp[0]; - var RemapRamp = GetRemapRamp(Ramp); + var RemapRamp = Ramp.Select(r => r - Ramp[0]).ToArray(); + if (Ramp[0] > Ramp[15]) // reversed remapping + { + baseIndex = Ramp[15]; + for (int i=15; i>0; i--) + RemapRamp = Ramp.Select(r => r - Ramp[15]).ToArray(); + } + remapColors = RemapRamp.Select((x, i) => Pair.New(baseIndex + i, Exts.ColorLerp(x / 16f, c1, c2))) .ToDictionary(u => u.First, u => u.Second); } diff --git a/mods/d2k/TODO b/mods/d2k/TODO index a7ed1b8fb7..faf7e6c858 100644 --- a/mods/d2k/TODO +++ b/mods/d2k/TODO @@ -20,7 +20,7 @@ # rework chrome UI, dialoges, tabs # add sonic tank weapon (currently uses tesla) # starport prices should vary -# black spots on buildings should be fading team colors +# some transparent tiles (see Atreides Hightech Factory) should be white # gamefile extraction (setup/setup.z) from CD fails # support patch 1.06 gamefiles: DATA.R8 has more frames and currently fails to extract, also featuring new terrain with white houses and new units: grenade thrower, stealth raider icon # put TilesetBuilder.Export into OpenRA.Utility to call the functions directly when extracting game-files (instead of opening a GUI) diff --git a/mods/d2k/rules/system.yaml b/mods/d2k/rules/system.yaml index 0b23b5d932..0e78f11d9f 100644 --- a/mods/d2k/rules/system.yaml +++ b/mods/d2k/rules/system.yaml @@ -53,7 +53,7 @@ Player: SquadSize: 10 PlayerColorPalette: BasePalette: d2k - RemapIndex: 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + RemapIndex: 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240 BaseAttackNotifier: HarvesterAttackNotifier: