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

Commit

Permalink
[Direct3D10] remove Debug.Assert
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSt committed Jun 16, 2016
1 parent 2d97c18 commit 95f1a07
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
22 changes: 0 additions & 22 deletions Source/SharpDX.Direct3D10/Resource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ public static T FromSwapChain<T>(SwapChain swapChain, int index) where T : Resou
/// <returns>The loaded texture object.</returns>
public static T FromFile<T>(Device device, string fileName) where T : Resource
{
System.Diagnostics.Debug.Assert(typeof(T) == typeof(Texture1D) || typeof(T) == typeof(Texture2D) ||
typeof (T) == typeof (Texture3D));

IntPtr temp;
Result resultOut;
D3DX10.CreateTextureFromFile(device, fileName, null, IntPtr.Zero, out temp, out resultOut);
Expand All @@ -66,9 +63,6 @@ public static T FromFile<T>(Device device, string fileName) where T : Resource
/// <returns>The loaded texture object.</returns>
public static T FromFile<T>(Device device, string fileName, ImageLoadInformation loadInfo) where T : Resource
{
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
typeof (T) == typeof (Texture3D));

IntPtr temp;
Result resultOut;
D3DX10.CreateTextureFromFile(device, fileName, loadInfo, IntPtr.Zero, out temp, out resultOut);
Expand All @@ -84,13 +78,8 @@ public static T FromFile<T>(Device device, string fileName, ImageLoadInformation
/// <returns>The loaded texture object.</returns>
public static T FromMemory<T>(Device device, byte[] memory) where T : Resource
{
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
typeof (T) == typeof (Texture3D));

unsafe
{
System.Diagnostics.Debug.Assert(memory != null);
System.Diagnostics.Debug.Assert(memory.Length > 0);
IntPtr temp;
Result resultOut;
fixed (void* pBuffer = &memory[0])
Expand All @@ -110,13 +99,8 @@ public static T FromMemory<T>(Device device, byte[] memory) where T : Resource
/// <returns>The loaded texture object.</returns>
public static T FromMemory<T>(Device device, byte[] memory, ImageLoadInformation loadInfo) where T : Resource
{
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
typeof (T) == typeof (Texture3D));

unsafe
{
System.Diagnostics.Debug.Assert(memory != null);
System.Diagnostics.Debug.Assert(memory.Length > 0);
IntPtr temp;
Result resultOut;
fixed (void* pBuffer = &memory[0])
Expand Down Expand Up @@ -165,9 +149,6 @@ public static T FromStream<T>(Device device, Stream stream, int sizeInBytes, Ima
public static void ToFile<T>(T texture, ImageFileFormat format, string fileName)
where T : Resource
{
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
typeof (T) == typeof (Texture3D));

D3DX10.SaveTextureToFile(texture, format, fileName);
}

Expand All @@ -181,9 +162,6 @@ public static void ToFile<T>(T texture, ImageFileFormat format, string fileName)
public static void ToStream<T>(T texture, ImageFileFormat format, Stream stream)
where T : Resource
{
System.Diagnostics.Debug.Assert(typeof (T) == typeof (Texture1D) || typeof (T) == typeof (Texture2D) ||
typeof (T) == typeof (Texture3D));

Blob blob;
D3DX10.SaveTextureToMemory(texture, format, out blob, 0);

Expand Down
3 changes: 0 additions & 3 deletions Source/SharpDX.Direct3D10/Texture1D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public Texture1D(Device device, Texture1DDescription description)
public Texture1D(Device device, Texture1DDescription description, DataStream data)
: this(device, description, new[] {data})
{
System.Diagnostics.Debug.Assert(data != null);
}

/// <summary>
Expand All @@ -58,8 +57,6 @@ public Texture1D(Device device, Texture1DDescription description, DataStream dat
public Texture1D(Device device, Texture1DDescription description, DataStream[] data)
: base(IntPtr.Zero)
{
System.Diagnostics.Debug.Assert(data != null);

var subResourceDatas = new DataBox[data.Length];
for (int i = 0; i < subResourceDatas.Length; i++)
subResourceDatas[i].DataPointer = data[i].DataPointer;
Expand Down

0 comments on commit 95f1a07

Please sign in to comment.