Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 95f1a07

Browse files
author
AndrewSt
committed
[Direct3D10] remove Debug.Assert
1 parent 2d97c18 commit 95f1a07

2 files changed

Lines changed: 0 additions & 25 deletions

File tree

Source/SharpDX.Direct3D10/Resource.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ public static T FromSwapChain<T>(SwapChain swapChain, int index) where T : Resou
4747
/// <returns>The loaded texture object.</returns>
4848
public static T FromFile<T>(Device device, string fileName) where T : Resource
4949
{
50-
System.Diagnostics.Debug.Assert(typeof(T) == typeof(Texture1D) || typeof(T) == typeof(Texture2D) ||
51-
typeof (T) == typeof (Texture3D));
52-
5350
IntPtr temp;
5451
Result resultOut;
5552
D3DX10.CreateTextureFromFile(device, fileName, null, IntPtr.Zero, out temp, out resultOut);
@@ -66,9 +63,6 @@ public static T FromFile<T>(Device device, string fileName) where T : Resource
6663
/// <returns>The loaded texture object.</returns>
6764
public static T FromFile<T>(Device device, string fileName, ImageLoadInformation loadInfo) where T : Resource
6865
{
69-
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
70-
typeof (T) == typeof (Texture3D));
71-
7266
IntPtr temp;
7367
Result resultOut;
7468
D3DX10.CreateTextureFromFile(device, fileName, loadInfo, IntPtr.Zero, out temp, out resultOut);
@@ -84,13 +78,8 @@ public static T FromFile<T>(Device device, string fileName, ImageLoadInformation
8478
/// <returns>The loaded texture object.</returns>
8579
public static T FromMemory<T>(Device device, byte[] memory) where T : Resource
8680
{
87-
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
88-
typeof (T) == typeof (Texture3D));
89-
9081
unsafe
9182
{
92-
System.Diagnostics.Debug.Assert(memory != null);
93-
System.Diagnostics.Debug.Assert(memory.Length > 0);
9483
IntPtr temp;
9584
Result resultOut;
9685
fixed (void* pBuffer = &memory[0])
@@ -110,13 +99,8 @@ public static T FromMemory<T>(Device device, byte[] memory) where T : Resource
11099
/// <returns>The loaded texture object.</returns>
111100
public static T FromMemory<T>(Device device, byte[] memory, ImageLoadInformation loadInfo) where T : Resource
112101
{
113-
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
114-
typeof (T) == typeof (Texture3D));
115-
116102
unsafe
117103
{
118-
System.Diagnostics.Debug.Assert(memory != null);
119-
System.Diagnostics.Debug.Assert(memory.Length > 0);
120104
IntPtr temp;
121105
Result resultOut;
122106
fixed (void* pBuffer = &memory[0])
@@ -165,9 +149,6 @@ public static T FromStream<T>(Device device, Stream stream, int sizeInBytes, Ima
165149
public static void ToFile<T>(T texture, ImageFileFormat format, string fileName)
166150
where T : Resource
167151
{
168-
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
169-
typeof (T) == typeof (Texture3D));
170-
171152
D3DX10.SaveTextureToFile(texture, format, fileName);
172153
}
173154

@@ -181,9 +162,6 @@ public static void ToFile<T>(T texture, ImageFileFormat format, string fileName)
181162
public static void ToStream<T>(T texture, ImageFileFormat format, Stream stream)
182163
where T : Resource
183164
{
184-
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
185-
typeof (T) == typeof (Texture3D));
186-
187165
Blob blob;
188166
D3DX10.SaveTextureToMemory(texture, format, out blob, 0);
189167

Source/SharpDX.Direct3D10/Texture1D.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public Texture1D(Device device, Texture1DDescription description)
4646
public Texture1D(Device device, Texture1DDescription description, DataStream data)
4747
: this(device, description, new[] {data})
4848
{
49-
System.Diagnostics.Debug.Assert(data != null);
5049
}
5150

5251
/// <summary>
@@ -58,8 +57,6 @@ public Texture1D(Device device, Texture1DDescription description, DataStream dat
5857
public Texture1D(Device device, Texture1DDescription description, DataStream[] data)
5958
: base(IntPtr.Zero)
6059
{
61-
System.Diagnostics.Debug.Assert(data != null);
62-
6360
var subResourceDatas = new DataBox[data.Length];
6461
for (int i = 0; i < subResourceDatas.Length; i++)
6562
subResourceDatas[i].DataPointer = data[i].DataPointer;

0 commit comments

Comments
 (0)