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

◆ GetValueMatrixTransposeArray()

unsafe Matrix[] Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueMatrixTransposeArray ( int count)
inline

Definition at line 2441 of file EffectParameter.cs.

2442 {
2443 if (count <= 0)
2444 {
2445 throw new ArgumentOutOfRangeException();
2446 }
2447 if (_paramClass == EffectParameterClass.Matrix && pElementCollection.Count != 0)
2448 {
2449 int num = pElementCollection.Count * 16;
2450 float[] array = new float[num];
2451 fixed (void* ptr = &System.Runtime.CompilerServices.Unsafe.As<float, void>(ref array[0]))
2452 {
2453 int num2 = count * 16;
2454 int num3 = ((num2 >= num) ? num : num2);
2455 int num4 = *(int*)pEffect + 188;
2456 int num5 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, D3DXMATRIX*, uint, int>)(int)(*(uint*)num4))((nint)pEffect, _handle, (D3DXMATRIX*)ptr, (uint)((num3 + 15) / 16));
2457 if (num5 < 0)
2458 {
2459 throw GraphicsHelpers.GetExceptionFromResult((uint)num5);
2460 }
2461 Matrix[] array2 = new Matrix[count];
2462 fixed (void* value = &System.Runtime.CompilerServices.Unsafe.As<Matrix, void>(ref array2[0]))
2463 {
2465 Marshal.Copy(array, 0, destination, num3);
2466 return array2;
2467 }
2468 }
2469 }
2470 throw new InvalidCastException();
2471 }
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(), Microsoft.Xna.Framework.Graphics.EffectParameterCollection.Count, System.count, System.destination, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.EffectParameter.pEffect, Microsoft.Xna.Framework.Graphics.EffectParameter.pElementCollection, and System.value.