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

◆ SetValue() [10/18]

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

Definition at line 262 of file EffectParameter.cs.

263 {
264 EffectParameterClass paramClass = _paramClass;
265 if (paramClass == EffectParameterClass.Vector && pElementCollection.Count != 0)
266 {
267 if (value != null && (nint)value.LongLength > 0)
268 {
269 fixed (void* ptr = &System.Runtime.CompilerServices.Unsafe.As<Quaternion, void>(ref value[0]))
270 {
271 try
272 {
273 int num = *(int*)pEffect + 128;
274 int num2 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)num))((nint)pEffect, _handle, (float*)ptr, (uint)((nint)value.LongLength << 2));
275 if (num2 < 0)
276 {
277 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
278 }
279 }
280 catch
281 {
282 //try-fault
283 ptr = null;
284 throw;
285 }
286 }
287 }
288 else
289 {
290 ID3DXBaseEffect* ptr2 = pEffect;
291 int num3 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, D3DXVECTOR4*, uint, int>)(int)(*(uint*)(*(int*)ptr2 + 144)))((nint)ptr2, _handle, null, 0u);
292 if (num3 < 0)
293 {
294 throw GraphicsHelpers.GetExceptionFromResult((uint)num3);
295 }
296 }
297 try
298 {
299 return;
300 }
301 catch
302 {
303 //try-fault
304 throw;
305 }
306 }
307 throw new InvalidCastException();
308 }

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.