load Dune 2000 walls directly from DATA.R8

This commit is contained in:
Matthias Mailänder
2013-08-10 18:46:55 +02:00
parent 0dbee935e7
commit a7504b5dd9
5 changed files with 60 additions and 45 deletions

View File

@@ -230,33 +230,6 @@ namespace OpenRA.Utility
frame = srcImage[f];
}
}
else if (args.Contains("--wall"))
{
// complex resorting to RA/CnC compatible frame order
var d2kBrikFrameOrder = new int[] { 1, 4, 2, 12, 5, 6, 16, 9, 3, 13, 7, 8, 14, 10, 11, 15, 17, 20, 18, 28, 21, 22, 32, 25, 19, 29, 23, 24, 30, 26, 27, 31 };
foreach (int o in d2kBrikFrameOrder)
{
var f = startFrame - 1 + o;
frame = srcImage[f];
var offsetX = Math.Abs(frame.Offset.X);
var offsetY = frame.FrameSize.Height - Math.Abs(frame.Offset.Y);
Console.WriteLine("calculated OffsetX: {0}", offsetX);
Console.WriteLine("calculated OffsetY: {0}", offsetY);
var data = bitmap.LockBits(new Rectangle(x + offsetX, 0 + offsetY, frame.Size.Width, frame.Size.Height), ImageLockMode.WriteOnly,
PixelFormat.Format8bppIndexed);
for (var i = 0; i < frame.Size.Height; i++)
Marshal.Copy(frame.Image, i * frame.Size.Width,
new IntPtr(data.Scan0.ToInt64() + i * data.Stride), frame.Size.Width);
bitmap.UnlockBits(data);
x += frame.FrameSize.Width;
}
}
else if (args.Contains("--tileset"))
{
int f = 0;

View File

@@ -64,7 +64,7 @@ namespace OpenRA.Utility
Console.WriteLine(" --extract MOD[,MOD]* FILES [--userdir] Extract files from mod packages to the current (or user) directory");
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 [--noshadow] [--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 removing the shadow.");
Console.WriteLine(" --r8 R8FILE PALETTE START END FILENAME [--noshadow] [--infrantry] [--vehicle] [--projectile] [--building] [--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 removing the shadow.");
Console.WriteLine(" --transpose SRCSHP DESTSHP START N M [START N M ...] Transpose the N*M block of frames starting at START.");
Console.WriteLine(" --docs MOD Generate trait documentation in MarkDown format.");
Console.WriteLine(" --map-hash MAPFILE Generate hash of specified oramap file.");