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

◆ GetValueVector2Array()

unsafe Vector2[] Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueVector2Array ( int count)
inline

Definition at line 1968 of file EffectParameter.cs.

1969 {
1970 //Discarded unreachable code: IL_00d8
1971 if (count <= 0)
1972 {
1973 throw new ArgumentOutOfRangeException();
1974 }
1975 ID3DXBaseEffect* ptr = pEffect;
1976 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DXPARAMETER_DESC d3DXPARAMETER_DESC);
1977 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, _D3DXPARAMETER_DESC*, int>)(int)(*(uint*)(*(int*)ptr + 16)))((nint)ptr, _handle, &d3DXPARAMETER_DESC);
1978 if (num < 0)
1979 {
1980 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
1981 }
1982 int num2 = System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 40)) >>> 2;
1983 int num3 = count * 2;
1984 int num4 = ((num3 >= num2) ? num2 : num3);
1985 float[] array;
1986 if (_paramClass == EffectParameterClass.Matrix)
1987 {
1988 array = GetValueSingleArray(num4);
1989 }
1990 else
1991 {
1992 array = new float[num2];
1993 fixed (float* ptr2 = &array[0])
1994 {
1995 try
1996 {
1997 int num5 = *(int*)pEffect + 132;
1998 int num6 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)num5))((nint)pEffect, _handle, ptr2, (uint)num4);
1999 if (num6 < 0)
2000 {
2001 throw GraphicsHelpers.GetExceptionFromResult((uint)num6);
2002 }
2003 }
2004 catch
2005 {
2006 //try-fault
2007 ptr2 = null;
2008 throw;
2009 }
2010 }
2011 }
2012 Vector2[] array2 = new Vector2[count];
2013 fixed (void* value = &System.Runtime.CompilerServices.Unsafe.As<Vector2, void>(ref array2[0]))
2014 {
2016 Marshal.Copy(array, 0, destination, num4);
2017 return array2;
2018 }
2019 }
static void Copy(int[] source, int startIndex, IntPtr destination, int length)
Definition Marshal.cs:800

References Microsoft.Xna.Framework.Graphics.EffectParameter._handle, Microsoft.Xna.Framework.Graphics.EffectParameter._paramClass, System.array, System.Runtime.InteropServices.Marshal.Copy(), System.count, System.destination, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueSingleArray(), Microsoft.Xna.Framework.Graphics.EffectParameter.pEffect, and System.value.