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

◆ SetValue() [8/18]

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

Definition at line 196 of file EffectParameter.cs.

197 {
198 if (_paramClass == EffectParameterClass.Matrix)
199 {
200 EffectParameterCollection effectParameterCollection = pElementCollection;
201 if ((nint)value.LongLength <= effectParameterCollection.Count && pElementCollection.Count != 0)
202 {
203 if (value != null && (nint)value.LongLength > 0)
204 {
205 fixed (void* ptr = &System.Runtime.CompilerServices.Unsafe.As<Matrix, void>(ref value[0]))
206 {
207 try
208 {
209 int num = *(int*)pEffect + 160;
210 int num2 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, D3DXMATRIX*, uint, int>)(int)(*(uint*)num))((nint)pEffect, _handle, (D3DXMATRIX*)ptr, (uint)value.Length);
211 if (num2 < 0)
212 {
213 throw GraphicsHelpers.GetExceptionFromResult((uint)num2);
214 }
215 }
216 catch
217 {
218 //try-fault
219 ptr = null;
220 throw;
221 }
222 }
223 }
224 else
225 {
226 ID3DXBaseEffect* ptr2 = pEffect;
227 int num3 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, D3DXMATRIX*, uint, int>)(int)(*(uint*)(*(int*)ptr2 + 160)))((nint)ptr2, _handle, null, 0u);
228 if (num3 < 0)
229 {
230 throw GraphicsHelpers.GetExceptionFromResult((uint)num3);
231 }
232 }
233 try
234 {
235 return;
236 }
237 catch
238 {
239 //try-fault
240 throw;
241 }
242 }
243 }
244 throw new InvalidCastException();
245 }

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.