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

◆ SetValue() [14/18]

unsafe void Microsoft.Xna.Framework.Graphics.EffectParameter.SetValue ( Vector2[] value)
inline

Definition at line 466 of file EffectParameter.cs.

467 {
468 EffectParameterClass paramClass = _paramClass;
469 if (paramClass == EffectParameterClass.Vector && pElementCollection.Count != 0)
470 {
471 if (value != null && (nint)value.LongLength > 0)
472 {
473 fixed (void* ptr = &System.Runtime.CompilerServices.Unsafe.As<Vector2, void>(ref value[0]))
474 {
475 try
476 {
477 int num = *(int*)pEffect + 128;
478 int num2 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)num))((nint)pEffect, _handle, (float*)ptr, (uint)((nint)value.LongLength << 1));
479 if (num2 < 0)
480 {
481 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
482 }
483 }
484 catch
485 {
486 //try-fault
487 ptr = null;
488 throw;
489 }
490 }
491 }
492 else
493 {
494 ID3DXBaseEffect* ptr2 = pEffect;
495 int num3 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)(*(int*)ptr2 + 128)))((nint)ptr2, _handle, null, 0u);
496 if (num3 < 0)
497 {
498 throw GraphicsHelpers.GetExceptionFromResult((uint)num3);
499 }
500 }
501 try
502 {
503 return;
504 }
505 catch
506 {
507 //try-fault
508 throw;
509 }
510 }
511 throw new InvalidCastException();
512 }

References Microsoft.Xna.Framework.Graphics.EffectParameter._handle, Microsoft.Xna.Framework.Graphics.EffectParameter._paramClass, Microsoft.Xna.Framework.Graphics.EffectParameterCollection.Count, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.EffectParameter.pEffect, Microsoft.Xna.Framework.Graphics.EffectParameter.pElementCollection, and System.value.