add support for compressed packages (zip); strip unnecessary SharpZipLib dll. req reference to WindowsBase for System.IO.Packaging support (apparently Mono has it)

This commit is contained in:
Chris Forbes
2010-07-18 17:39:07 +12:00
parent 27ef3483ec
commit a08dacc9c2
8 changed files with 87 additions and 70 deletions

View File

@@ -8,6 +8,7 @@
*/
#endregion
using System.Drawing;
using OpenRA.FileFormats;
using OpenRA.Traits;
@@ -30,4 +31,30 @@ namespace OpenRA.Mods.RA
wr.AddPalette(info.Name, new Palette(pal, new ShroudPaletteRemap(info.IsFog)));
}
}
class ShroudPaletteRemap : IPaletteRemap
{
bool isFog;
public ShroudPaletteRemap(bool isFog) { this.isFog = isFog; }
public Color GetRemappedColor(Color original, int index)
{
if (isFog)
return new[] {
Color.Transparent, Color.Green,
Color.Blue, Color.Yellow,
Color.FromArgb(128,0,0,0),
Color.FromArgb(128,0,0,0),
Color.FromArgb(128,0,0,0),
Color.FromArgb(64,0,0,0)}[index % 8];
else
return new[] {
Color.Transparent, Color.Green,
Color.Blue, Color.Yellow,
Color.Black,
Color.FromArgb(128,0,0,0),
Color.Transparent,
Color.Transparent}[index % 8];
}
}
}