Simplify names, remove unused usings, remove redundant casts.

This commit is contained in:
RoosterDragon
2016-01-17 21:24:41 +00:00
parent aaeb715006
commit 8e89a6a696
304 changed files with 218 additions and 639 deletions

View File

@@ -9,7 +9,6 @@
#endregion
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OpenRA.Graphics

View File

@@ -12,8 +12,6 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Primitives;
namespace OpenRA.Graphics
{

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Graphics
if (defaultSrc != Src)
root.Add(new MiniYamlNode("Src", Src));
return new MiniYaml(FieldSaver.FormatValue(this, this.GetType().GetField("rect")), root);
return new MiniYaml(FieldSaver.FormatValue(this, GetType().GetField("rect")), root);
}
}
}

View File

@@ -57,7 +57,7 @@ namespace OpenRA.Graphics
var b = new Bitmap(Size, 1, PixelFormat.Format32bppArgb);
var data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
var temp = new uint[Palette.Size];
var temp = new uint[Size];
palette.CopyToArray(temp, 0);
Marshal.Copy((int[])(object)temp, 0, data.Scan0, Size);
b.UnlockBits(data);

View File

@@ -8,12 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Graphics
{
public sealed class PaletteReference

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Graphics
{
// Increase luminosity if required to represent the full ramp
var rampRange = (byte)((1 - rampFraction) * c.L);
var c1 = new HSLColor(c.H, c.S, (byte)Math.Max(rampRange, c.L)).RGB;
var c1 = new HSLColor(c.H, c.S, Math.Max(rampRange, c.L)).RGB;
var c2 = new HSLColor(c.H, c.S, (byte)Math.Max(0, c.L - rampRange)).RGB;
var baseIndex = ramp[0];
var remapRamp = ramp.Select(r => r - ramp[0]);

View File

@@ -8,9 +8,7 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
namespace OpenRA.Graphics
{

View File

@@ -9,7 +9,6 @@
#endregion
using System.Drawing;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Graphics

View File

@@ -10,9 +10,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace OpenRA.Graphics
{
@@ -50,8 +48,8 @@ namespace OpenRA.Graphics
public SequenceProvider(SequenceCache cache, Map map)
{
this.sequences = Exts.Lazy(() => cache.LoadSequences(map));
this.SpriteCache = cache.SpriteCache;
sequences = Exts.Lazy(() => cache.LoadSequences(map));
SpriteCache = cache.SpriteCache;
}
public ISpriteSequence GetSequence(string unitName, string sequenceName)

View File

@@ -12,7 +12,6 @@ using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace OpenRA.Graphics

View File

@@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
namespace OpenRA.Graphics
{

View File

@@ -10,9 +10,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Primitives;
namespace OpenRA.Graphics

View File

@@ -11,8 +11,6 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Graphics
{

View File

@@ -12,8 +12,6 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Graphics
{

View File

@@ -12,7 +12,6 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileSystem;
using OpenRA.Support;
namespace OpenRA.Graphics

View File

@@ -8,9 +8,7 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
namespace OpenRA.Graphics
{

View File

@@ -11,7 +11,6 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace OpenRA.Graphics
{

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Graphics
public VoxelRenderProxy(Sprite sprite, Sprite shadowSprite, float2[] projectedShadowBounds, float shadowDirection)
{
this.Sprite = sprite;
Sprite = sprite;
ShadowSprite = shadowSprite;
ProjectedShadowBounds = projectedShadowBounds;
ShadowDirection = shadowDirection;