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

◆ GetValueVector3Array()

unsafe Vector3[] Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueVector3Array ( int count)
inline

Definition at line 2066 of file EffectParameter.cs.

2067 {
2068 //Discarded unreachable code: IL_00d8
2069 if (count <= 0)
2070 {
2071 throw new ArgumentOutOfRangeException();
2072 }
2073 ID3DXBaseEffect* ptr = pEffect;
2074 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DXPARAMETER_DESC d3DXPARAMETER_DESC);
2075 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, _D3DXPARAMETER_DESC*, int>)(int)(*(uint*)(*(int*)ptr + 16)))((nint)ptr, _handle, &d3DXPARAMETER_DESC);
2076 if (num < 0)
2077 {
2078 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
2079 }
2080 int num2 = System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 40)) >>> 2;
2081 int num3 = count * 3;
2082 int num4 = ((num3 >= num2) ? num2 : num3);
2083 float[] array;
2084 if (_paramClass == EffectParameterClass.Matrix)
2085 {
2086 array = GetValueSingleArray(num4);
2087 }
2088 else
2089 {
2090 array = new float[num2];
2091 fixed (float* ptr2 = &array[0])
2092 {
2093 try
2094 {
2095 int num5 = *(int*)pEffect + 132;
2096 int num6 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)num5))((nint)pEffect, _handle, ptr2, (uint)num4);
2097 if (num6 < 0)
2098 {
2099 throw GraphicsHelpers.GetExceptionFromResult((uint)num6);
2100 }
2101 }
2102 catch
2103 {
2104 //try-fault
2105 ptr2 = null;
2106 throw;
2107 }
2108 }
2109 }
2110 Vector3[] array2 = new Vector3[count];
2111 fixed (void* value = &System.Runtime.CompilerServices.Unsafe.As<Vector3, void>(ref array2[0]))
2112 {
2114 Marshal.Copy(array, 0, destination, num4);
2115 return array2;
2116 }
2117 }
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.