diff --git a/OpenRA.Game/Graphics/PlatformInterfaces.cs b/OpenRA.Game/Graphics/PlatformInterfaces.cs index 2fbfe1d2fa..3b56b99746 100644 --- a/OpenRA.Game/Graphics/PlatformInterfaces.cs +++ b/OpenRA.Game/Graphics/PlatformInterfaces.cs @@ -124,7 +124,6 @@ namespace OpenRA public interface ITexture : IDisposable { - void SetData(uint[,] colors); void SetData(byte[] colors, int width, int height); void SetFloatData(float[] data, int width, int height); byte[] GetData(); diff --git a/OpenRA.Platforms.Default/Texture.cs b/OpenRA.Platforms.Default/Texture.cs index 3ee88980a3..dcbe19842f 100644 --- a/OpenRA.Platforms.Default/Texture.cs +++ b/OpenRA.Platforms.Default/Texture.cs @@ -92,24 +92,6 @@ namespace OpenRA.Platforms.Default } } - // An array of RGBA - public void SetData(uint[,] colors) - { - VerifyThreadAffinity(); - var width = colors.GetUpperBound(1) + 1; - var height = colors.GetUpperBound(0) + 1; - - if (!Exts.IsPowerOf2(width) || !Exts.IsPowerOf2(height)) - throw new InvalidDataException($"Non-power-of-two array {width}x{height}"); - - Size = new Size(width, height); - unsafe - { - fixed (uint* ptr = &colors[0, 0]) - SetData(new IntPtr(ptr), width, height); - } - } - public void SetFloatData(float[] data, int width, int height) { VerifyThreadAffinity(); diff --git a/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs b/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs index 7a637fe282..2fef38fd65 100644 --- a/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs +++ b/OpenRA.Platforms.Default/ThreadedGraphicsContext.cs @@ -557,7 +557,6 @@ namespace OpenRA.Platforms.Default readonly Func getSize; readonly Action setEmpty; readonly Func getData; - readonly Func setData1; readonly Action setData2; readonly Func setData3; readonly Action setData4; @@ -573,7 +572,6 @@ namespace OpenRA.Platforms.Default getSize = () => texture.Size; setEmpty = tuple => { var t = (ValueTuple)tuple; texture.SetEmpty(t.Item1, t.Item2); }; getData = () => texture.GetData(); - setData1 = colors => { texture.SetData((uint[,])colors); return null; }; setData2 = tuple => { var t = (ValueTuple)tuple; texture.SetData(t.Item1, t.Item2, t.Item3); }; setData3 = tuple => { setData2(tuple); return null; }; setData4 = tuple => { var t = (ValueTuple)tuple; texture.SetFloatData(t.Item1, t.Item2, t.Item3); }; @@ -602,12 +600,6 @@ namespace OpenRA.Platforms.Default return device.Send(getData); } - public void SetData(uint[,] colors) - { - // We can't return until we are finished with the data, so we must Send here. - device.Send(setData1, colors); - } - public void SetData(byte[] colors, int width, int height) { // Objects 85000 bytes or more will be directly allocated in the Large Object Heap (LOH).