added TilesetBuilder command line, added Tileset extractor

removing all copyrighted raw tileset files
This commit is contained in:
Matthias Mailänder
2012-06-08 19:31:10 +02:00
parent 8f1d06ff31
commit f140c6ec9c
298 changed files with 4582 additions and 6931 deletions

View File

@@ -214,6 +214,35 @@ namespace OpenRA.Utility
x += frame.FrameWidth;
}
}
else if (args.Contains("--tileset"))
{
int f = 0;
var tileset = new Bitmap(frame.FrameWidth * 20, frame.FrameHeight * 40, PixelFormat.Format8bppIndexed);
tileset.Palette = palette.AsSystemPalette();
for (int h = 0; h < 40; h++)
{
for (int w = 0; w < 20; w++)
{
if (h * 20 + w < FrameCount)
{
Console.WriteLine(f);
frame = srcImage[f];
var data = tileset.LockBits(new Rectangle(w * frame.Width, h * frame.Height, frame.Width, frame.Height),
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
for (var i = 0; i < frame.Height; i++)
Marshal.Copy(frame.Image, i * frame.Width,
new IntPtr(data.Scan0.ToInt64() + i * data.Stride), frame.Width);
tileset.UnlockBits(data);
f++;
}
}
}
bitmap = tileset;
}
else
{
for (int f = startFrame; f < endFrame; f++)

View File

@@ -54,14 +54,13 @@ namespace OpenRA.Utility
{
Console.WriteLine("Usage: OpenRA.Utility.exe [OPTION] [ARGS]");
Console.WriteLine();
Console.WriteLine(" --settings-value KEY Get value of KEY from settings.yaml");
Console.WriteLine(" --shp PNGFILE FRAMEWIDTH Convert a single PNG with multiple frames appended after another to a SHP");
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");
Console.WriteLine(" --tmp-png MOD[,MOD]* THEATER FILES Extract terrain tiles to PNG");
Console.WriteLine(" --remap SRCMOD:PAL DESTMOD:PAL SRCSHP DESTSHP Remap SHPs to another palette");
Console.WriteLine(" --r8 R8FILE PALETTE STARTFRAME ENDFRAME FILENAME [--transparent]");
Console.WriteLine(" [--infrantry] [--vehicle] [--projectile] [--building] [--wall] Convert Dune 2000 DATA.R8 to PNGs choosing start- and endframe as well as unit type for correct offset to append multiple frames to one PNG named by filename optionally setting up transparency");
Console.WriteLine(" --settings-value KEY Get value of KEY from settings.yaml");
Console.WriteLine(" --shp PNGFILE FRAMEWIDTH Convert a single PNG with multiple frames appended after another to a SHP");
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");
Console.WriteLine(" --tmp-png MOD[,MOD]* THEATER FILES Extract terrain tiles to PNG");
Console.WriteLine(" --remap SRCMOD:PAL DESTMOD:PAL SRCSHP DESTSHP Remap SHPs to another palette");
Console.WriteLine(" --r8 R8FILE PALETTE START END FILENAME [--transparent] [--infrantry] [--vehicle] [--projectile] [--building] [--wall] [--tileset] Convert Dune 2000 DATA.R8 to PNGs choosing start- and endframe as well as type for correct offset to append multiple frames to one PNG named by filename optionally setting up transparency.");
}
static string GetNamedArg(string[] args, string arg)