@@ -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
0 commit comments