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

◆ GetValueQuaternionArray()

unsafe Quaternion[] Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueQuaternionArray ( int count)
inline

Definition at line 2256 of file EffectParameter.cs.

2257 {
2258 //Discarded unreachable code: IL_00d8
2259 if (count <= 0)
2260 {
2261 throw new ArgumentOutOfRangeException();
2262 }
2263 ID3DXBaseEffect* ptr = pEffect;
2264 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DXPARAMETER_DESC d3DXPARAMETER_DESC);
2265 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, _D3DXPARAMETER_DESC*, int>)(int)(*(uint*)(*(int*)ptr + 16)))((nint)ptr, _handle, &d3DXPARAMETER_DESC);
2266 if (num < 0)
2267 {
2268 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
2269 }
2270 int num2 = System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 40)) >>> 2;
2271 int num3 = count * 4;
2272 int num4 = ((num3 >= num2) ? num2 : num3);
2273 float[] array;
2274 if (_paramClass == EffectParameterClass.Matrix)
2275 {
2276 array = GetValueSingleArray(num4);
2277 }
2278 else
2279 {
2280 array = new float[num2];
2281 fixed (void* ptr2 = &System.Runtime.CompilerServices.Unsafe.As<float, void>(ref array[0]))
2282 {
2283 try
2284 {
2285 int num5 = *(int*)pEffect + 132;
2286 int num6 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, uint, int>)(int)(*(uint*)num5))((nint)pEffect, _handle, (float*)ptr2, (uint)num4);
2287 if (num6 < 0)
2288 {
2289 throw GraphicsHelpers.GetExceptionFromResult((uint)num6);
2290 }
2291 }
2292 catch
2293 {
2294 //try-fault
2295 ptr2 = null;
2296 throw;
2297 }
2298 }
2299 }
2300 Quaternion[] array2 = new Quaternion[count];
2301 fixed (void* value = &System.Runtime.CompilerServices.Unsafe.As<Quaternion, void>(ref array2[0]))
2302 {
2304 Marshal.Copy(array, 0, destination, num4);
2305 return array2;
2306 }
2307 }
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(), System.count, System.destination, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueSingleArray(), Microsoft.Xna.Framework.Graphics.EffectParameter.pEffect, and System.value.