Remove obsolete code.
This commit is contained in:
@@ -12,7 +12,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -448,8 +447,6 @@ namespace OpenRA
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Rectangle Bounds(this Bitmap b) { return new Rectangle(0, 0, b.Width, b.Height); }
|
|
||||||
|
|
||||||
public static int ToBits(this IEnumerable<bool> bits)
|
public static int ToBits(this IEnumerable<bool> bits)
|
||||||
{
|
{
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -450,29 +449,6 @@ namespace OpenRA
|
|||||||
return InvalidValueAction(value, fieldType, fieldName);
|
return InvalidValueAction(value, fieldType, fieldName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fieldType == typeof(ImageFormat))
|
|
||||||
{
|
|
||||||
if (value != null)
|
|
||||||
{
|
|
||||||
switch (value.ToLowerInvariant())
|
|
||||||
{
|
|
||||||
case "bmp":
|
|
||||||
return ImageFormat.Bmp;
|
|
||||||
case "gif":
|
|
||||||
return ImageFormat.Gif;
|
|
||||||
case "jpg":
|
|
||||||
case "jpeg":
|
|
||||||
return ImageFormat.Jpeg;
|
|
||||||
case "tif":
|
|
||||||
case "tiff":
|
|
||||||
return ImageFormat.Tiff;
|
|
||||||
default:
|
|
||||||
return ImageFormat.Png;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return InvalidValueAction(value, fieldType, fieldName);
|
|
||||||
}
|
|
||||||
else if (fieldType == typeof(bool))
|
else if (fieldType == typeof(bool))
|
||||||
return ParseYesNo(value, fieldType, fieldName);
|
return ParseYesNo(value, fieldType, fieldName);
|
||||||
else if (fieldType == typeof(int2[]))
|
else if (fieldType == typeof(int2[]))
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -88,11 +87,6 @@ namespace OpenRA
|
|||||||
return ((HSLColor)v).ToHexString();
|
return ((HSLColor)v).ToHexString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t == typeof(ImageFormat))
|
|
||||||
{
|
|
||||||
return ((ImageFormat)v).ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (t == typeof(Rectangle))
|
if (t == typeof(Rectangle))
|
||||||
{
|
{
|
||||||
var r = (Rectangle)v;
|
var r = (Rectangle)v;
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -12,10 +12,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace OpenRA.Graphics
|
namespace OpenRA.Graphics
|
||||||
{
|
{
|
||||||
@@ -36,30 +33,6 @@ namespace OpenRA.Graphics
|
|||||||
return Color.FromArgb((int)palette[index]);
|
return Color.FromArgb((int)palette[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ColorPalette AsSystemPalette(this IPalette palette)
|
|
||||||
{
|
|
||||||
ColorPalette pal;
|
|
||||||
using (var b = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
|
|
||||||
pal = b.Palette;
|
|
||||||
|
|
||||||
for (var i = 0; i < Size; i++)
|
|
||||||
pal.Entries[i] = palette.GetColor(i);
|
|
||||||
|
|
||||||
return pal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Bitmap AsBitmap(this IPalette palette)
|
|
||||||
{
|
|
||||||
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[Size];
|
|
||||||
palette.CopyToArray(temp, 0);
|
|
||||||
Marshal.Copy((int[])(object)temp, 0, data.Scan0, Size);
|
|
||||||
b.UnlockBits(data);
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IPalette AsReadOnly(this IPalette palette)
|
public static IPalette AsReadOnly(this IPalette palette)
|
||||||
{
|
{
|
||||||
if (palette is ImmutablePalette)
|
if (palette is ImmutablePalette)
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
|
|
||||||
namespace OpenRA.Graphics
|
namespace OpenRA.Graphics
|
||||||
|
|||||||
@@ -11,10 +11,8 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Primitives;
|
using OpenRA.Primitives;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user