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

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

static unsafe void Microsoft.Xna.Framework.Graphics.Texture3D.GetAndValidateSizes< T > ( _D3DVOLUME_DESC * pVolume,
uint * pdwFormatSize,
uint * pdwElementSize )
inlinestaticpackage
Type Constraints
T :struct 

Definition at line 323 of file Texture3D.cs.

323 : struct
324 {
325 if (pVolume == null || pdwFormatSize == null || pdwElementSize == null)
326 {
327 return;
328 }
329 *pdwFormatSize = Texture.GetExpectedByteSizeFromFormat(*(_D3DFORMAT*)pVolume);
330 uint num = (*pdwElementSize = (uint)System.Runtime.CompilerServices.Unsafe.SizeOf<T>());
331 uint num2 = *pdwFormatSize;
332 if (num != num2)
333 {
334 if (num2 <= num)
335 {
336 throw new ArgumentException(FrameworkResources.InvalidDataSize);
337 }
338 if (num2 % num != 0)
339 {
340 throw new ArgumentException(FrameworkResources.InvalidDataSize);
341 }
342 }
343 }

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

Referenced by Microsoft.Xna.Framework.Graphics.Texture3D.CopyData< T >().