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

◆ GetValueVector4Array()

unsafe Vector4[] Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueVector4Array ( int count)
inline

Definition at line 2161 of file EffectParameter.cs.

2162 {
2163 //Discarded unreachable code: IL_00d8
2164 if (count <= 0)
2165 {
2166 throw new ArgumentOutOfRangeException();
2167 }
2168 ID3DXBaseEffect* ptr = pEffect;
2169 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DXPARAMETER_DESC d3DXPARAMETER_DESC);
2170 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, _D3DXPARAMETER_DESC*, int>)(int)(*(uint*)(*(int*)ptr + 16)))((nint)ptr, _handle, &d3DXPARAMETER_DESC);
2171 if (num < 0)
2172 {
2173 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
2174 }
2175 int num2 = System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 40)) >>> 2;
2176 int num3 = count * 4;
2177 int num4 = ((num3 >= num2) ? num2 : num3);
2178 float[] array;
2179 if (_paramClass == EffectParameterClass.Matrix)
2180 {
2181 array = GetValueSingleArray(num4);
2182 }
2183 else
2184 {
2185 array = new float[num2];
2186 fixed (void* ptr2 = &System.Runtime.CompilerServices.Unsafe.As<float, void>(ref array[0]))
2187 {
2188 try
2189 {
2190 int num5 = *(int*)pEffect + 132;
2191 int num6 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)num5))((nint)pEffect, _handle, (float*)ptr2, (uint)num4);
2192 if (num6 < 0)
2193 {
2194 throw GraphicsHelpers.GetExceptionFromResult((uint)num6);
2195 }
2196 }
2197 catch
2198 {
2199 //try-fault
2200 ptr2 = null;
2201 throw;
2202 }
2203 }
2204 }
2205 Vector4[] array2 = new Vector4[count];
2206 fixed (void* value = &System.Runtime.CompilerServices.Unsafe.As<Vector4, void>(ref array2[0]))
2207 {
2209 Marshal.Copy(array, 0, destination, num4);
2210 return array2;
2211 }
2212 }
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.