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

◆ GetValueVector4()

unsafe Vector4 Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueVector4 ( )
inline

Definition at line 2119 of file EffectParameter.cs.

2120 {
2121 Vector4 result = default(Vector4);
2122 ID3DXBaseEffect* ptr;
2123 if (pElementCollection.Count == 0)
2124 {
2125 switch (_paramClass)
2126 {
2127 case EffectParameterClass.Scalar:
2128 {
2129 ptr = pEffect;
2130 System.Runtime.CompilerServices.Unsafe.SkipInit(out float num);
2131 int num2 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, float*, int>)(int)(*(uint*)(*(int*)ptr + 124)))((nint)ptr, _handle, &num);
2132 if (num2 < 0)
2133 {
2134 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
2135 }
2136 result.W = num;
2137 result.Z = num;
2138 result.Y = num;
2139 result.X = num;
2140 return result;
2141 }
2142 case EffectParameterClass.Vector:
2143 break;
2144 default:
2145 throw new InvalidCastException();
2146 }
2147 if (_columns != 4 || _rows != 1)
2148 {
2149 throw new InvalidCastException();
2150 }
2151 }
2152 ptr = pEffect;
2153 int num3 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, D3DXVECTOR4*, int>)(int)(*(uint*)(*(int*)ptr + 140)))((nint)ptr, _handle, (D3DXVECTOR4*)(&result));
2154 if (num3 < 0)
2155 {
2156 throw GraphicsHelpers.GetExceptionFromResult((uint)num3);
2157 }
2158 return result;
2159 }

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

Referenced by Microsoft.Xna.Framework.Graphics.EffectAnnotation.GetValueVector4().