Remove --transpose utility command.

The engine has supported transposed sprites for a long time now.
This commit is contained in:
Paul Chote
2014-10-05 15:24:42 +13:00
parent 2b92ce7edd
commit ad0da91ecc
2 changed files with 0 additions and 49 deletions

View File

@@ -87,7 +87,6 @@
<Compile Include="UtilityCommands\ImportLegacyMapCommand.cs" /> <Compile Include="UtilityCommands\ImportLegacyMapCommand.cs" />
<Compile Include="UtilityCommands\LegacyMapImporter.cs" /> <Compile Include="UtilityCommands\LegacyMapImporter.cs" />
<Compile Include="UtilityCommands\RemapShpCommand.cs" /> <Compile Include="UtilityCommands\RemapShpCommand.cs" />
<Compile Include="UtilityCommands\TransposeShpCommand.cs" />
<Compile Include="UtilityCommands\UpgradeMapCommand.cs" /> <Compile Include="UtilityCommands\UpgradeMapCommand.cs" />
<Compile Include="UtilityCommands\UpgradeModCommand.cs" /> <Compile Include="UtilityCommands\UpgradeModCommand.cs" />
<Compile Include="UtilityCommands\UpgradeRules.cs" /> <Compile Include="UtilityCommands\UpgradeRules.cs" />

View File

@@ -1,48 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using OpenRA.FileFormats;
namespace OpenRA.Mods.Common.UtilityCommands
{
class TransposeShpCommand : IUtilityCommand
{
public string Name { get { return "--transpose"; } }
[Desc("SRCSHP DESTSHP START N M [START N M ...]",
"Transpose the N*M block of frames starting at START.")]
public void Run(ModData modData, string[] args)
{
var srcImage = ShpReader.Load(args[1]);
var srcFrames = srcImage.Frames;
var destFrames = srcImage.Frames.ToArray();
for (var z = 3; z < args.Length - 2; z += 3)
{
var start = Exts.ParseIntegerInvariant(args[z]);
var m = Exts.ParseIntegerInvariant(args[z + 1]);
var n = Exts.ParseIntegerInvariant(args[z + 2]);
for (var i = 0; i < m; i++)
for (var j = 0; j < n; j++)
destFrames[start + i * n + j] = srcFrames[start + j * m + i];
}
using (var destStream = File.Create(args[2]))
ShpReader.Write(destStream, srcImage.Size, destFrames.Select(f => f.Data));
}
}
}