Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetAndValidateSizes< T >() [1/2]

static unsafe void Microsoft.Xna.Framework.Graphics.Texture.GetAndValidateSizes< T > ( _D3DSURFACE_DESC * pSurface,
uint * pdwFormatSize,
uint * pdwElementSize )
inlinestaticpackageinherited
Type Constraints
T :struct 

Definition at line 199 of file Texture.cs.

199 : struct
200 {
201 if (pSurface == null || pdwFormatSize == null || pdwElementSize == null)
202 {
203 return;
204 }
205 *pdwFormatSize = GetExpectedByteSizeFromFormat(*(_D3DFORMAT*)pSurface);
206 uint num = (*pdwElementSize = (uint)System.Runtime.CompilerServices.Unsafe.SizeOf<T>());
207 uint num2 = *pdwFormatSize;
208 if (num != num2)
209 {
210 if (num2 <= num)
211 {
212 throw new ArgumentException(FrameworkResources.InvalidDataSize);
213 }
214 if (num2 % num != 0)
215 {
216 throw new ArgumentException(FrameworkResources.InvalidDataSize);
217 }
218 }
219 }
static byte GetExpectedByteSizeFromFormat(_D3DFORMAT format)
Definition Texture.cs:72

References Microsoft.Xna.Framework.Graphics.Texture.GetExpectedByteSizeFromFormat(), and Microsoft.Xna.Framework.FrameworkResources.InvalidDataSize.