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

◆ CheckTextureFormat()

static unsafe bool Microsoft.Xna.Framework.Graphics.ProfileChecker.CheckTextureFormat ( ProfileCapabilities profileCapabilities,
IDirect3D9 * pD3D,
uint adapter,
_D3DDEVTYPE deviceType,
_D3DRESOURCETYPE resourceType,
SurfaceFormat format )
inlinestaticprivate

Definition at line 601 of file ProfileChecker.cs.

602 {
603 _D3DFORMAT d3DFORMAT = _003CModule_003E.ConvertXnaFormatToWindows(format);
604 int num = *(int*)pD3D + 40;
605 if (((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DDEVTYPE, _D3DFORMAT, uint, _D3DRESOURCETYPE, _D3DFORMAT, int>)(int)(*(uint*)num))((nint)pD3D, adapter, deviceType, IRRELEVANT_ADAPTER_FORMAT, 0u, resourceType, d3DFORMAT) < 0)
606 {
607 return false;
608 }
609 int num2 = *(int*)pD3D + 40;
610 if (((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DDEVTYPE, _D3DFORMAT, uint, _D3DRESOURCETYPE, _D3DFORMAT, int>)(int)(*(uint*)num2))((nint)pD3D, adapter, deviceType, IRRELEVANT_ADAPTER_FORMAT, 2097152u, resourceType, d3DFORMAT) < 0)
611 {
612 return false;
613 }
614 if (!profileCapabilities.InvalidFilterFormats.Contains(format))
615 {
616 int num3 = *(int*)pD3D + 40;
617 if (((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DDEVTYPE, _D3DFORMAT, uint, _D3DRESOURCETYPE, _D3DFORMAT, int>)(int)(*(uint*)num3))((nint)pD3D, adapter, deviceType, IRRELEVANT_ADAPTER_FORMAT, 131072u, resourceType, d3DFORMAT) < 0)
618 {
619 return false;
620 }
621 }
622 return true;
623 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)

References System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), System.format, and Microsoft.Xna.Framework.Graphics.ProfileChecker.IRRELEVANT_ADAPTER_FORMAT.

Referenced by Microsoft.Xna.Framework.Graphics.ProfileChecker.IsProfileSupported().