diff --git a/OpenRA.CrashDialog/Settings.StyleCop b/OpenRA.CrashDialog/Settings.StyleCop
new file mode 100644
index 0000000000..1590d17baa
--- /dev/null
+++ b/OpenRA.CrashDialog/Settings.StyleCop
@@ -0,0 +1,344 @@
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenRA.Irc/Settings.StyleCop b/OpenRA.Irc/Settings.StyleCop
new file mode 100644
index 0000000000..1590d17baa
--- /dev/null
+++ b/OpenRA.Irc/Settings.StyleCop
@@ -0,0 +1,344 @@
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenRA.Lint/YamlChecker.cs b/OpenRA.Lint/YamlChecker.cs
index 943a316bbd..bfebb0d566 100644
--- a/OpenRA.Lint/YamlChecker.cs
+++ b/OpenRA.Lint/YamlChecker.cs
@@ -64,7 +64,7 @@ namespace OpenRA.Lint
.Select(m => m.Map);
}
else
- maps = new [] { new Map(map) };
+ maps = new[] { new Map(map) };
foreach (var testMap in maps)
{
@@ -87,10 +87,10 @@ namespace OpenRA.Lint
{
var customPass = (ILintPass)Game.modData.ObjectCreator
.CreateBasic(customPassType);
-
+
if (verbose)
Console.WriteLine("Pass: {0}".F(customPassType.ToString()));
-
+
customPass.Run(EmitError, EmitWarning, testMap);
}
catch (Exception e)
diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs
index eec519bb0d..d4c03a05d1 100644
--- a/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs
+++ b/OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
{
public class CncIngameChromeLogic
{
- Widget ingameRoot;
+ readonly Widget ingameRoot;
readonly World world;
[ObjectCreator.UseCtor]
@@ -120,7 +120,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
powerBar.GetProvided = () => powerManager.PowerProvided;
powerBar.GetUsed = () => powerManager.PowerDrained;
powerBar.TooltipFormat = "Power Usage: {0}/{1}";
- powerBar.GetBarColor = () =>
+ powerBar.GetBarColor = () =>
{
if (powerManager.PowerState == PowerState.Critical)
return Color.Red;
diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs
index 46759be278..925c90bb76 100644
--- a/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs
+++ b/OpenRA.Mods.Cnc/Widgets/Logic/ProductionTooltipLogic.cs
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
var lowpower = pm.PowerState != PowerState.Normal;
var time = palette.CurrentQueue.GetBuildTime(actor)
- * ((lowpower) ? palette.CurrentQueue.Info.LowPowerSlowdown : 1);
+ * (lowpower ? palette.CurrentQueue.Info.LowPowerSlowdown : 1);
var timeString = "T: {0}".F(WidgetUtils.FormatTime(time));
timeLabel.GetText = () => timeString;
timeLabel.GetColor = () => lowpower ? Color.Red : Color.White;
diff --git a/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs b/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs
index 63f2c4cfc3..133db405ba 100644
--- a/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs
+++ b/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs
@@ -281,7 +281,7 @@ namespace OpenRA.Mods.Cnc.Widgets
if (hotkey == Game.Settings.Keys.NextProductionTabKey)
return SelectNextTab(false);
- else if (hotkey == Game.Settings.Keys.PreviousProductionTabKey)
+ else if (hotkey == Game.Settings.Keys.PreviousProductionTabKey)
return SelectNextTab(true);
return false;
diff --git a/OpenRA.Mods.D2k/D2kResourceLayer.cs b/OpenRA.Mods.D2k/D2kResourceLayer.cs
index 48984f5b4a..26ea2e87c2 100644
--- a/OpenRA.Mods.D2k/D2kResourceLayer.cs
+++ b/OpenRA.Mods.D2k/D2kResourceLayer.cs
@@ -33,9 +33,9 @@ namespace OpenRA.Traits
BottomRight = 0x80,
All = 0xFF
- };
+ }
- static readonly Dictionary variants = new Dictionary()
+ static readonly Dictionary Variants = new Dictionary()
{
{ "cleara", new[] { 0, 50 } },
{ "clearb", new[] { 1, 51 } },
@@ -43,7 +43,7 @@ namespace OpenRA.Traits
{ "cleard", new[] { 0, 53 } },
};
- static readonly Dictionary spriteMap = new Dictionary()
+ static readonly Dictionary SpriteMap = new Dictionary()
{
{ ClearSides.None, 0 },
{ ClearSides.Left | ClearSides.Top | ClearSides.TopLeft | ClearSides.TopRight | ClearSides.BottomLeft | ClearSides.BottomRight, 2 },
@@ -111,16 +111,16 @@ namespace OpenRA.Traits
if (render[p.X - 1, p.Y - 1].Type != t)
ret |= ClearSides.TopLeft;
-
+
if (render[p.X + 1, p.Y - 1].Type != t)
ret |= ClearSides.TopRight;
-
+
if (render[p.X - 1, p.Y + 1].Type != t)
ret |= ClearSides.BottomLeft;
-
+
if (render[p.X + 1, p.Y + 1].Type != t)
ret |= ClearSides.BottomRight;
-
+
return ret;
}
@@ -134,11 +134,11 @@ namespace OpenRA.Traits
if (clear == ClearSides.None)
{
- var sprites = variants[t.Variant];
+ var sprites = Variants[t.Variant];
var frame = t.Density > t.Type.Info.MaxDensity / 2 ? 1 : 0;
t.Sprite = t.Type.Variants.First().Value[sprites[frame]];
}
- else if (spriteMap.TryGetValue(clear, out index))
+ else if (SpriteMap.TryGetValue(clear, out index))
t.Sprite = t.Type.Variants.First().Value[index];
else
t.Sprite = null;
@@ -165,7 +165,7 @@ namespace OpenRA.Traits
protected override string ChooseRandomVariant(ResourceType t)
{
- return variants.Keys.Random(Game.CosmeticRandom);
+ return Variants.Keys.Random(Game.CosmeticRandom);
}
}
}
diff --git a/OpenRA.Mods.D2k/ThrowsShrapnel.cs b/OpenRA.Mods.D2k/ThrowsShrapnel.cs
index c5b6f8e110..a9e31de30a 100644
--- a/OpenRA.Mods.D2k/ThrowsShrapnel.cs
+++ b/OpenRA.Mods.D2k/ThrowsShrapnel.cs
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.D2k
{
readonly ThrowsShrapnelInfo info;
- public ThrowsShrapnel(ThrowsShrapnelInfo info)
+ public ThrowsShrapnel(ThrowsShrapnelInfo info)
{
this.info = info;
}
@@ -46,7 +46,7 @@ namespace OpenRA.Mods.D2k
var args = new ProjectileArgs
{
Weapon = wep,
- Facing = self.World.SharedRandom.Next(-1,255),
+ Facing = self.World.SharedRandom.Next(-1, 255),
FirepowerModifier = self.TraitsImplementing()
.Select(a => a.GetFirepowerModifier())
.Product(),
diff --git a/OpenRA.Mods.TS/Widgets/Logic/TSInstallFromCDLogic.cs b/OpenRA.Mods.TS/Widgets/Logic/TSInstallFromCDLogic.cs
index 5203eb8c9f..c1c82d7a7e 100755
--- a/OpenRA.Mods.TS/Widgets/Logic/TSInstallFromCDLogic.cs
+++ b/OpenRA.Mods.TS/Widgets/Logic/TSInstallFromCDLogic.cs
@@ -45,11 +45,11 @@ namespace OpenRA.Mods.TS.Widgets.Logic
}
void CheckForDisk()
- {
- Func ValidDiskFilter = diskRoot => File.Exists(diskRoot+Path.DirectorySeparatorChar+"multi.mix") &&
+ {
+ Func validDiskFilter = diskRoot => File.Exists(diskRoot + Path.DirectorySeparatorChar + "multi.mix") &&
File.Exists(new string[] { diskRoot, "install", "tibsun.mix" }.Aggregate(Path.Combine));
- var path = InstallUtils.GetMountedDisk(ValidDiskFilter);
+ var path = InstallUtils.GetMountedDisk(validDiskFilter);
if (path != null)
Install(path);
@@ -67,27 +67,27 @@ namespace OpenRA.Mods.TS.Widgets.Logic
insertDiskContainer.IsVisible = () => false;
installingContainer.IsVisible = () => true;
- var dest = new string[] { Platform.SupportDir, "Content", "ts" }.Aggregate(Path.Combine);
- var copyFiles = new string[] { "install/tibsun.mix", "scores.mix", "multi.mix"};
+ var dest = new string[] { Platform.SupportDir, "Content", "ts" }.Aggregate(Path.Combine);
+ var copyFiles = new string[] { "install/tibsun.mix", "scores.mix", "multi.mix" };
var installCounter = 0;
var installTotal = copyFiles.Count();
var onProgress = (Action)(s => Game.RunAfterTick(() =>
- {
- progressBar.Percentage = installCounter*100/installTotal;
+ {
+ progressBar.Percentage = installCounter * 100 / installTotal;
installCounter++;
statusLabel.GetText = () => s;
}));
var onError = (Action)(s => Game.RunAfterTick(() =>
- {
- statusLabel.GetText = () => "Error: "+s;
+ {
+ statusLabel.GetText = () => "Error: " + s;
backButton.IsDisabled = () => false;
retryButton.IsDisabled = () => false;
}));
- var t = new Thread( _ =>
+ var t = new Thread(_ =>
{
try
{
@@ -108,5 +108,4 @@ namespace OpenRA.Mods.TS.Widgets.Logic
t.Start();
}
}
-}
-
+}
diff --git a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs
index 5044cfdae2..9549640352 100755
--- a/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs
+++ b/OpenRA.Renderer.Sdl2/Sdl2GraphicsDevice.cs
@@ -90,7 +90,7 @@ namespace OpenRA.Renderer.Sdl2
if (SDL.SDL_GL_ExtensionSupported("GL_EXT_framebuffer_object") == SDL.SDL_bool.SDL_FALSE)
{
ErrorHandler.WriteGraphicsLog("OpenRA requires the OpenGL extension GL_EXT_framebuffer_object.\n"
- +"Please try updating your GPU driver to the latest version provided by the manufacturer.");
+ + "Please try updating your GPU driver to the latest version provided by the manufacturer.");
throw new InvalidProgramException("Missing OpenGL extension GL_EXT_framebuffer_object. See graphics.log for details.");
}
@@ -200,13 +200,13 @@ namespace OpenRA.Renderer.Sdl2
ErrorHandler.CheckGlError();
}
- public void GrabWindowMouseFocus()
+ public void GrabWindowMouseFocus()
{
SDL.SDL_SetWindowGrab(window, SDL.SDL_bool.SDL_TRUE);
}
public void ReleaseWindowMouseFocus()
- {
+ {
SDL.SDL_SetWindowGrab(window, SDL.SDL_bool.SDL_FALSE);
}
diff --git a/OpenRA.Renderer.Sdl2/VertexBuffer.cs b/OpenRA.Renderer.Sdl2/VertexBuffer.cs
index 882aeabb4d..a5655e4cd1 100644
--- a/OpenRA.Renderer.Sdl2/VertexBuffer.cs
+++ b/OpenRA.Renderer.Sdl2/VertexBuffer.cs
@@ -28,8 +28,7 @@ namespace OpenRA.Renderer.Sdl2
GL.BufferData(BufferTarget.ArrayBuffer,
new IntPtr(VertexSize * size),
new T[size],
- BufferUsageHint.DynamicDraw
- );
+ BufferUsageHint.DynamicDraw);
ErrorHandler.CheckGlError();
}
diff --git a/OpenRA.TilesetBuilder/FormBuilder.cs b/OpenRA.TilesetBuilder/FormBuilder.cs
index 99c2410197..86ed83f1ac 100644
--- a/OpenRA.TilesetBuilder/FormBuilder.cs
+++ b/OpenRA.TilesetBuilder/FormBuilder.cs
@@ -40,39 +40,39 @@ namespace OpenRA.TilesetBuilder
{
this.Show();
using (var formNew = new FormNew { })
- if (DialogResult.OK == formNew.ShowDialog())
- {
- PaletteFromImage = formNew.PaletteFromImage;
- PaletteFile = formNew.PaletteFile;
- ImageFile = formNew.ImageFile;
- TileSize = formNew.TileSize;
-
- srcfile = ImageFile;
- this.size = TileSize;
- surface1.TileSize = TileSize;
-
- Bitmap rbitmap;
- using (var fbitmap = new Bitmap(ImageFile))
- rbitmap = fbitmap.Clone(new Rectangle(0, 0, fbitmap.Width, fbitmap.Height),
- fbitmap.PixelFormat);
-
- int[] shadowIndex = { };
-
- if (!PaletteFromImage)
+ if (DialogResult.OK == formNew.ShowDialog())
{
- TerrainPalette = Palette.Load(PaletteFile, shadowIndex);
- rbitmap.Palette = TerrainPalette.AsSystemPalette();
+ PaletteFromImage = formNew.PaletteFromImage;
+ PaletteFile = formNew.PaletteFile;
+ ImageFile = formNew.ImageFile;
+ TileSize = formNew.TileSize;
+
+ srcfile = ImageFile;
+ this.size = TileSize;
+ surface1.TileSize = TileSize;
+
+ Bitmap rbitmap;
+ using (var fbitmap = new Bitmap(ImageFile))
+ rbitmap = fbitmap.Clone(new Rectangle(0, 0, fbitmap.Width, fbitmap.Height),
+ fbitmap.PixelFormat);
+
+ int[] shadowIndex = { };
+
+ if (!PaletteFromImage)
+ {
+ TerrainPalette = Palette.Load(PaletteFile, shadowIndex);
+ rbitmap.Palette = TerrainPalette.AsSystemPalette();
+ }
+
+ surface1.Image = (Bitmap)rbitmap;
+ surface1.TilesPerRow = surface1.Image.Size.Width / surface1.TileSize;
+ surface1.Image.SetResolution(96, 96); // people keep being noobs about DPI, and GDI+ cares.
+ surface1.TerrainTypes = new int[surface1.Image.Width / size, surface1.Image.Height / size]; /* all passable by default */
+ surface1.Templates = new List();
+ surface1.Size = surface1.Image.Size;
+ surface1.Enabled = true;
+ Load();
}
-
- surface1.Image = (Bitmap)rbitmap;
- surface1.TilesPerRow = surface1.Image.Size.Width / surface1.TileSize;
- surface1.Image.SetResolution(96, 96); // people keep being noobs about DPI, and GDI+ cares.
- surface1.TerrainTypes = new int[surface1.Image.Width / size, surface1.Image.Height / size]; /* all passable by default */
- surface1.Templates = new List();
- surface1.Size = surface1.Image.Size;
- surface1.Enabled = true;
- Load();
- }
}
public FormBuilder(string src, string tsize, bool autoExport, string outputDir)
@@ -89,7 +89,7 @@ namespace OpenRA.TilesetBuilder
TerrainType = new TerrainTypeInfo[terrainDefinition.Keys.Count];
var title = this.Text;
- surface1.UpdateMouseTilePosition += (x, y, tileNr) =>
+ surface1.UpdateMouseTilePosition += (x, y, tileNr) =>
{
this.Text = "{0} - {1} ({2,3}, {3,3}) tileNr: {4,3}".F(title, txtTilesetName.Text, x, y, tileNr);
};
@@ -104,8 +104,8 @@ namespace OpenRA.TilesetBuilder
{
for (var y = 0; y < icon.Height; y++)
{
- var newColor = deftype.Value.Color;
- icon.SetPixel(x, y, newColor);
+ var newColor = deftype.Value.Color;
+ icon.SetPixel(x, y, newColor);
}
}
@@ -149,17 +149,17 @@ namespace OpenRA.TilesetBuilder
public new void Load()
{
- try
- {
- var doc = new XmlDocument();
- doc.Load(Path.ChangeExtension(srcfile, "tsx"));
+ try
+ {
+ var doc = new XmlDocument();
+ doc.Load(Path.ChangeExtension(srcfile, "tsx"));
- foreach (var e in doc.SelectNodes("//name").OfType())
- txtTilesetName.Text = e.GetAttribute("value");
-
- foreach (var e in doc.SelectNodes("//terrain").OfType())
- surface1.TerrainTypes[int.Parse(e.GetAttribute("x")),
- int.Parse(e.GetAttribute("y"))] = int.Parse(e.GetAttribute("t"));
+ foreach (var e in doc.SelectNodes("//name").OfType())
+ txtTilesetName.Text = e.GetAttribute("value");
+
+ foreach (var e in doc.SelectNodes("//terrain").OfType())
+ surface1.TerrainTypes[int.Parse(e.GetAttribute("x")),
+ int.Parse(e.GetAttribute("y"))] = int.Parse(e.GetAttribute("t"));
foreach (var e in doc.SelectNodes("//template").OfType())
surface1.Templates.Add(new Template
@@ -168,13 +168,13 @@ namespace OpenRA.TilesetBuilder
.Select(f => new int2(int.Parse(f.GetAttribute("x")), int.Parse(f.GetAttribute("y"))))
.ToDictionary(a => a, a => true)
});
- }
- catch { }
+ }
+ catch { }
}
public void Save()
{
- using (var w = XmlWriter.Create(Path.ChangeExtension(srcfile, "tsx"),
+ using (var w = XmlWriter.Create(Path.ChangeExtension(srcfile, "tsx"),
new XmlWriterSettings { Indent = true, IndentChars = " " }))
{
var tilesetName = txtTilesetName.Text;
@@ -227,9 +227,9 @@ namespace OpenRA.TilesetBuilder
innerTsb.Checked = false;
tsb.Checked = true;
}
-
+
void SaveClicked(object sender, EventArgs e) { Save(); }
- void ShowOverlaysClicked(object sender, EventArgs e)
+ void ShowOverlaysClicked(object sender, EventArgs e)
{
surface1.ShowTerrainTypes = ((ToolStripButton)sender).Checked;
surface1.Invalidate();
@@ -296,7 +296,7 @@ namespace OpenRA.TilesetBuilder
for (var j = 0; j < tileSize; j++)
for (var i = 0; i < tileSize; i++)
{
- bw.Write(q[i + j * data.Stride]);
+ bw.Write(q[i + j * data.Stride]);
}
}
else
@@ -368,8 +368,7 @@ namespace OpenRA.TilesetBuilder
id: tilesetID.ToUpper(),
palette: tilesetPalette.ToLower(),
extensions: new string[] { ext[0], ext[1] },
- terrainInfo: TerrainType
- );
+ terrainInfo: TerrainType);
// List of files to add to the mix file
var fileList = new List();
@@ -398,8 +397,7 @@ namespace OpenRA.TilesetBuilder
id: cur,
image: "{0}{1:00}".F(txtTilesetName.Text, cur),
size: new int2(tp.Width, tp.Height),
- tiles: tiles
- );
+ tiles: tiles);
tileset.Templates.Add(cur, template);
cur++;
@@ -422,11 +420,11 @@ namespace OpenRA.TilesetBuilder
var idx = (t.Key.X - tp.Left) + tp.Width * (t.Key.Y - tp.Top);
// TemplateID CellID tilenr TemplateW TemplateH XinTilesPNG YinTilesPNG
- Console.WriteLine("{0} {1} {2} {3} {4} {5} {6}",
- cur,
+ Console.WriteLine("{0} {1} {2} {3} {4} {5} {6}",
+ cur,
idx,
- ((t.Key.Y * surface1.TilesPerRow) + t.Key.X),
- tp.Width,
+ t.Key.Y * surface1.TilesPerRow + t.Key.X,
+ tp.Width,
tp.Height,
t.Key.X,
t.Key.Y);
diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs
index 9c8432650f..dce309b497 100644
--- a/OpenRA.Utility/Command.cs
+++ b/OpenRA.Utility/Command.cs
@@ -91,10 +91,10 @@ namespace OpenRA.Utility
var shadowIndex = new int[] { };
if (args.Contains("--noshadow"))
{
- Array.Resize(ref shadowIndex, shadowIndex.Length + 3);
- shadowIndex[shadowIndex.Length - 1] = 1;
- shadowIndex[shadowIndex.Length - 2] = 3;
- shadowIndex[shadowIndex.Length - 3] = 4;
+ Array.Resize(ref shadowIndex, shadowIndex.Length + 3);
+ shadowIndex[shadowIndex.Length - 1] = 1;
+ shadowIndex[shadowIndex.Length - 2] = 3;
+ shadowIndex[shadowIndex.Length - 3] = 4;
}
var palette = Palette.Load(args[2], shadowIndex);
@@ -357,7 +357,7 @@ namespace OpenRA.Utility
var inner = outer.SelectMany(i => i.GetGenericArguments()).ToArray();
// Remove the namespace and the trailing "Info"
- return inner.Select(i => i.Name.Split(new [] { '.' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault())
+ return inner.Select(i => i.Name.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault())
.Select(s => s.EndsWith("Info") ? s.Remove(s.Length - 4, 4) : s)
.ToArray();
}
diff --git a/OpenRA.Utility/ExtractLanguageStrings.cs b/OpenRA.Utility/ExtractLanguageStrings.cs
index e967af7c22..65e8618c01 100644
--- a/OpenRA.Utility/ExtractLanguageStrings.cs
+++ b/OpenRA.Utility/ExtractLanguageStrings.cs
@@ -56,13 +56,12 @@ namespace OpenRA.Utility
if (translatables.Contains(node.Key) && !alreadyTranslated)
{
var translationKey = "{0}-{1}-{2}".F(container.Replace('_', '-'), parentLabel.Replace('_', '-'), node.Key.ToUpper());
- Console.WriteLine("\t{0}: {1}", translationKey , node.Value.Value);
+ Console.WriteLine("\t{0}: {1}", translationKey, node.Value.Value);
node.Value.Value = "@{0}@".F(translationKey);
}
FromChromeLayout(ref node.Value.Nodes, node, translatables, container);
}
}
-
}
}
diff --git a/OpenRA.Utility/Glob.cs b/OpenRA.Utility/Glob.cs
index 1314976b81..46f32d57b8 100644
--- a/OpenRA.Utility/Glob.cs
+++ b/OpenRA.Utility/Glob.cs
@@ -37,9 +37,7 @@ namespace OpenRA.Utility
yield break;
}
- //
// Split using DirectorySeparators but keep the separators
- //
var parts = new List();
for (var startIndex = 0; startIndex < filePath.Length;)
diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs
index 687b949ba9..5d0b29e315 100644
--- a/OpenRA.Utility/Program.cs
+++ b/OpenRA.Utility/Program.cs
@@ -18,7 +18,7 @@ namespace OpenRA.Utility
{
class Program
{
- static Dictionary> Actions = new Dictionary>()
+ static readonly Dictionary> Actions = new Dictionary>()
{
{ "--settings-value", Command.Settings },
{ "--shp", Command.ConvertPngToShp },
diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs
index afa0296b20..5d707c7f00 100644
--- a/OpenRA.Utility/UpgradeRules.cs
+++ b/OpenRA.Utility/UpgradeRules.cs
@@ -316,7 +316,7 @@ namespace OpenRA.Utility
if (engineVersion < 20140615)
{
- if (depth == 2 && parentKey == "Warhead" && node.Key == "Ore" )
+ if (depth == 2 && parentKey == "Warhead" && node.Key == "Ore")
node.Key = "DestroyResources";
}