Merge remote-tracking branch 'matt/bleed'

This commit is contained in:
Chris Forbes
2012-06-25 09:40:22 +12:00
3 changed files with 34 additions and 4 deletions

View File

@@ -465,6 +465,18 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
new string[] {"--shp", Path.Combine(PathToSHPs, "spice0.png"), "32"},
};
var SHPsToTranspose = new string[][]
{
new string[] {"--transpose", Path.Combine(PathToSHPs, "orni.shp"), Path.Combine(PathToSHPs, "orni.shp"), "0", "32", "3"},
new string[] {"--transpose", Path.Combine(PathToSHPs, "rifle.shp"), Path.Combine(PathToSHPs, "rifle.shp"), "8", "8", "6", "56", "8", "5", "112", "8", "3", "136", "8", "5"},
new string[] {"--transpose", Path.Combine(PathToSHPs, "bazooka.shp"), Path.Combine(PathToSHPs, "bazooka.shp"), "8", "8", "6", "56", "8", "5", "112", "8", "3", "136", "8", "5"},
new string[] {"--transpose", Path.Combine(PathToSHPs, "fremen.shp"), Path.Combine(PathToSHPs, "fremen.shp"), "8", "8", "6", "56", "8", "5", "112", "8", "3", "136", "8", "5"},
new string[] {"--transpose", Path.Combine(PathToSHPs, "sardaukar.shp"), Path.Combine(PathToSHPs, "sardaukar.shp"), "8", "8", "6", "56", "8", "5", "112", "8", "3", "136", "8", "5"},
new string[] {"--transpose", Path.Combine(PathToSHPs, "thumper.shp"), Path.Combine(PathToSHPs, "thumper.shp"), "8", "8", "6"},
new string[] {"--transpose", Path.Combine(PathToSHPs, "engineer.shp"), Path.Combine(PathToSHPs, "engineer.shp"), "8", "8", "6"},
new string[] {"--transpose", Path.Combine(PathToSHPs, "saboteur.shp"), Path.Combine(PathToSHPs, "saboteur.shp"), "8", "8", "4"},
};
var onError = (Action<string>)(s => Game.RunAfterTick(() =>
{
statusLabel.GetText = () => "Error: "+s;
@@ -491,6 +503,13 @@ namespace OpenRA.Mods.D2k.Widgets.Logic
File.Delete(SHPsToCreate[i][1]);
}
for (int i = 0; i < SHPsToTranspose.Length; i++)
{
progressBar.Percentage = i*100/SHPsToTranspose.Count();
statusLabel.GetText = () => "Transposing...";
Utility.Command.TransposeShp(SHPsToTranspose[i]);
}
statusLabel.GetText = () => "Building tilesets...";
int c = 0;
string[] TilesetArray = new string[] { "BASE", "BAT", "BGBS", "ICE", "TREE", "WAST" };

View File

@@ -18,6 +18,7 @@ using System.Runtime.InteropServices;
using OpenRA.FileFormats;
using OpenRA.FileFormats.Graphics;
using OpenRA.GameRules;
using OpenRA.Traits;
namespace OpenRA.Utility
{
@@ -371,9 +372,19 @@ namespace OpenRA.Utility
for (var i = 0; i < 4; i++)
remap[i] = i;
// TODO: should read that from mods/*/system.yaml
var srcRemapIndex = Enum<int[]>.Parse(args[1].Split(':')[0]);
var destRemapIndex = Enum<int[]>.Parse(args[2].Split(':')[0]);
var srcMod = Enum<string>.Parse(args[1].Split(':')[0]);
Game.modData = new ModData(srcMod);
FileSystem.LoadFromManifest(Game.modData.Manifest);
Rules.LoadRules(Game.modData.Manifest, new Map());
var srcPaletteInfo = Rules.Info["player"].Traits.Get<PlayerColorPaletteInfo>();
int[] srcRemapIndex = srcPaletteInfo.RemapIndex;
var destMod = Enum<string>.Parse(args[2].Split(':')[0]);
Game.modData = new ModData(destMod);
FileSystem.LoadFromManifest(Game.modData.Manifest);
Rules.LoadRules(Game.modData.Manifest, new Map());
var destPaletteInfo = Rules.Info["player"].Traits.Get<PlayerColorPaletteInfo>();
int[] destRemapIndex = destPaletteInfo.RemapIndex;
// the remap range is always 16 entries, but their location and order changes
for (var i = 0; i < 16; i++)

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Utility
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 SRCREMAPINDEX:PAL DESTREMAPINDEX:PAL SRCSHP DESTSHP Remap SHPs to another palette");
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.");
Console.WriteLine(" --transpose SRCSHP DESTSHP START N M [START N M ...] Transpose the N*M block of frames starting at START.");
}