From 49a758f031296380728f29ec00dc4a28895a3b10 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 4 Oct 2011 22:31:02 +1300 Subject: [PATCH] add --transparent flag to shp->png conversion utility --- OpenRA.Utility/Command.cs | 3 ++- OpenRA.Utility/Program.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs index 33562b27e1..667feb7310 100644 --- a/OpenRA.Utility/Command.cs +++ b/OpenRA.Utility/Command.cs @@ -79,7 +79,8 @@ namespace OpenRA.Utility var dest = Path.ChangeExtension(src, ".png"); var srcImage = ShpReader.Load(src); - var palette = Palette.Load(args[2], false); + var shouldRemap = args.Contains( "--transparent" ); + var palette = Palette.Load(args[2], shouldRemap); using (var bitmap = new Bitmap(srcImage.ImageCount * srcImage.Width, srcImage.Height, PixelFormat.Format8bppIndexed)) { diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 78776d5c77..e9fcc04e32 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -57,7 +57,7 @@ namespace OpenRA.Utility Console.WriteLine(); Console.WriteLine(" --settings-value KEY Get value of KEY from settings.yaml"); Console.WriteLine(" --shp PNGFILE FRAMEWIDTH Convert a PNG containing one or more frames to a SHP"); - Console.WriteLine(" --png SHPFILE PALETTE Convert a SHP to a PNG containing all of its frames"); + Console.WriteLine(" --png SHPFILE PALETTE [--transparent] Convert a SHP to a PNG containing all of its frames, optionally setting up transparency"); Console.WriteLine(" --extract MOD[,MOD]* FILES Extract files from mod packages"); }