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

◆ GetValueTextureCube()

unsafe TextureCube Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueTextureCube ( )
inline

Definition at line 2533 of file EffectParameter.cs.

2534 {
2535 EffectParameterType paramType = _paramType;
2536 if (paramType != EffectParameterType.Texture && paramType != EffectParameterType.TextureCube)
2537 {
2538 throw new InvalidCastException();
2539 }
2540 IDirect3DBaseTexture9* ptr = null;
2541 IDirect3DCubeTexture9* ptr2 = null;
2542 TextureCube result = null;
2543 ID3DXBaseEffect* ptr3 = pEffect;
2544 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, IDirect3DBaseTexture9**, int>)(int)(*(uint*)(*(int*)ptr3 + 212)))((nint)ptr3, _handle, &ptr);
2545 if (num < 0)
2546 {
2547 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
2548 }
2549 if (ptr != null)
2550 {
2551 IDirect3DBaseTexture9* ptr4 = (IDirect3DBaseTexture9*)(int)(*(uint*)((byte*)ptr + 8));
2552 num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, _GUID*, void**, int>)(int)(*(uint*)(int)(*(uint*)ptr4)))((nint)ptr4, (_GUID*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref _003CModule_003E.IID_IDirect3DCubeTexture9), (void**)(&ptr2));
2553 if (num >= 0)
2554 {
2555 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DSURFACE_DESC d3DSURFACE_DESC);
2556 num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DSURFACE_DESC*, int>)(int)(*(uint*)(*(int*)ptr2 + 68)))((nint)ptr2, 0u, &d3DSURFACE_DESC);
2557 if (num >= 0)
2558 {
2559 result = TextureCube.GetManagedObject(ptr2, _parent.GraphicsDevice, System.Runtime.CompilerServices.Unsafe.As<_D3DSURFACE_DESC, uint>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DSURFACE_DESC, 12)));
2560 }
2561 }
2562 if (ptr != null)
2563 {
2564 IDirect3DBaseTexture9* intPtr = ptr;
2565 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint>)(int)(*(uint*)(*(int*)intPtr + 8)))((nint)intPtr);
2566 ptr = null;
2567 }
2568 if (num < 0)
2569 {
2570 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
2571 }
2572 }
2573 return result;
2574 }

References Microsoft.Xna.Framework.Graphics.EffectParameter._handle, Microsoft.Xna.Framework.Graphics.EffectParameter._paramType, Microsoft.Xna.Framework.Graphics.EffectParameter._parent, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.TextureCube.GetManagedObject(), Microsoft.Xna.Framework.Graphics.GraphicsResource.GraphicsDevice, and Microsoft.Xna.Framework.Graphics.EffectParameter.pEffect.