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

◆ SetValue() [16/18]

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

Definition at line 398 of file EffectParameter.cs.

399 {
400 EffectParameterClass paramClass = _paramClass;
401 if (paramClass == EffectParameterClass.Vector && pElementCollection.Count != 0)
402 {
403 if (value != null && (nint)value.LongLength > 0)
404 {
405 fixed (void* ptr = &System.Runtime.CompilerServices.Unsafe.As<Vector3, void>(ref value[0]))
406 {
407 try
408 {
409 int num = *(int*)pEffect + 128;
410 int num2 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)num))((nint)pEffect, _handle, (float*)ptr, (uint)((nint)value.LongLength * 3));
411 if (num2 < 0)
412 {
413 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
414 }
415 }
416 catch
417 {
418 //try-fault
419 ptr = null;
420 throw;
421 }
422 }
423 }
424 else
425 {
426 ID3DXBaseEffect* ptr2 = pEffect;
427 int num3 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)(*(int*)ptr2 + 128)))((nint)ptr2, _handle, null, 0u);
428 if (num3 < 0)
429 {
430 throw GraphicsHelpers.GetExceptionFromResult((uint)num3);
431 }
432 }
433 try
434 {
435 return;
436 }
437 catch
438 {
439 //try-fault
440 throw;
441 }
442 }
443 throw new InvalidCastException();
444 }

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.