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

◆ GetValueMatrixArray()

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

Definition at line 2359 of file EffectParameter.cs.

2360 {
2361 if (count <= 0)
2362 {
2363 throw new ArgumentOutOfRangeException();
2364 }
2365 if (_paramClass == EffectParameterClass.Matrix && pElementCollection.Count != 0)
2366 {
2367 int num = pElementCollection.Count * 16;
2368 float[] array = new float[num];
2369 fixed (void* ptr = &System.Runtime.CompilerServices.Unsafe.As<float, void>(ref array[0]))
2370 {
2371 int num2 = count * 16;
2372 int num3 = ((num2 >= num) ? num : num2);
2373 int num4 = *(int*)pEffect + 164;
2374 int num5 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, D3DXMATRIX*, uint, int>)(int)(*(uint*)num4))((nint)pEffect, _handle, (D3DXMATRIX*)ptr, (uint)((num3 + 15) / 16));
2375 if (num5 < 0)
2376 {
2377 throw GraphicsHelpers.GetExceptionFromResult((uint)num5);
2378 }
2379 Matrix[] array2 = new Matrix[count];
2380 fixed (void* value = &System.Runtime.CompilerServices.Unsafe.As<Matrix, void>(ref array2[0]))
2381 {
2383 Marshal.Copy(array, 0, destination, num3);
2384 return array2;
2385 }
2386 }
2387 }
2388 throw new InvalidCastException();
2389 }
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.

Referenced by Microsoft.Xna.Framework.Graphics.SkinnedEffect.GetBoneTransforms(), Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueBooleanArray(), Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueInt32Array(), Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueSingleArray(), Microsoft.Xna.Framework.Graphics.EffectParameter.SetValue(), Microsoft.Xna.Framework.Graphics.EffectParameter.SetValue(), and Microsoft.Xna.Framework.Graphics.EffectParameter.SetValue().