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

◆ GetValueTexture3D()

unsafe Texture3D Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueTexture3D ( )
inline

Definition at line 2576 of file EffectParameter.cs.

2577 {
2578 EffectParameterType paramType = _paramType;
2579 if (paramType != EffectParameterType.Texture && paramType != EffectParameterType.Texture3D)
2580 {
2581 throw new InvalidCastException();
2582 }
2583 IDirect3DBaseTexture9* ptr = null;
2584 IDirect3DVolumeTexture9* ptr2 = null;
2585 Texture3D result = null;
2586 ID3DXBaseEffect* ptr3 = pEffect;
2587 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, IDirect3DBaseTexture9**, int>)(int)(*(uint*)(*(int*)ptr3 + 212)))((nint)ptr3, _handle, &ptr);
2588 if (num < 0)
2589 {
2590 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
2591 }
2592 if (ptr != null)
2593 {
2594 IDirect3DBaseTexture9* ptr4 = (IDirect3DBaseTexture9*)(int)(*(uint*)((byte*)ptr + 8));
2595 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_IDirect3DVolumeTexture9), (void**)(&ptr2));
2596 if (num >= 0)
2597 {
2598 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DVOLUME_DESC d3DVOLUME_DESC);
2599 num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DVOLUME_DESC*, int>)(int)(*(uint*)(*(int*)ptr2 + 68)))((nint)ptr2, 0u, &d3DVOLUME_DESC);
2600 if (num >= 0)
2601 {
2602 result = Texture3D.GetManagedObject(ptr2, _parent.GraphicsDevice, System.Runtime.CompilerServices.Unsafe.As<_D3DVOLUME_DESC, uint>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DVOLUME_DESC, 12)));
2603 }
2604 }
2605 if (ptr != null)
2606 {
2607 IDirect3DBaseTexture9* intPtr = ptr;
2608 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint>)(int)(*(uint*)(*(int*)intPtr + 8)))((nint)intPtr);
2609 ptr = null;
2610 }
2611 if (num < 0)
2612 {
2613 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
2614 }
2615 }
2616 return result;
2617 }

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.Texture3D.GetManagedObject(), Microsoft.Xna.Framework.Graphics.GraphicsResource.GraphicsDevice, and Microsoft.Xna.Framework.Graphics.EffectParameter.pEffect.