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

◆ SetValue() [18/18]

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

Definition at line 330 of file EffectParameter.cs.

331 {
332 EffectParameterClass paramClass = _paramClass;
333 if (paramClass == EffectParameterClass.Vector && pElementCollection.Count != 0)
334 {
335 if (value != null && (nint)value.LongLength > 0)
336 {
337 fixed (void* ptr = &System.Runtime.CompilerServices.Unsafe.As<Vector4, void>(ref value[0]))
338 {
339 try
340 {
341 int num = *(int*)pEffect + 128;
342 int num2 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)num))((nint)pEffect, _handle, (float*)ptr, (uint)((nint)value.LongLength << 2));
343 if (num2 < 0)
344 {
345 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
346 }
347 }
348 catch
349 {
350 //try-fault
351 ptr = null;
352 throw;
353 }
354 }
355 }
356 else
357 {
358 ID3DXBaseEffect* ptr2 = pEffect;
359 int num3 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, D3DXVECTOR4*, uint, int>)(int)(*(uint*)(*(int*)ptr2 + 144)))((nint)ptr2, _handle, null, 0u);
360 if (num3 < 0)
361 {
362 throw GraphicsHelpers.GetExceptionFromResult((uint)num3);
363 }
364 }
365 try
366 {
367 return;
368 }
369 catch
370 {
371 //try-fault
372 throw;
373 }
374 }
375 throw new InvalidCastException();
376 }

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.