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

◆ ClearDirtyBuffers()

unsafe void Microsoft.Xna.Framework.Graphics.GraphicsDevice.ClearDirtyBuffers ( )
inlineprivate

Definition at line 2138 of file GraphicsDevice.cs.

2139 {
2140 Color color = new Color(68, 34, 136, 255);
2141 int num = currentRenderTargetCount;
2142 if (num <= 0)
2143 {
2144 Clear((ClearOptions)lazyClearFlags, color, 1f, 0);
2145 }
2146 else
2147 {
2148 if (((uint)lazyClearFlags & (true ? 1u : 0u)) != 0)
2149 {
2150 int num2 = 0;
2151 if (0 < num)
2152 {
2153 do
2154 {
2155 RenderTargetHelper renderTargetHelper = currentRenderTargets[num2];
2156 if (renderTargetHelper.usage == RenderTargetUsage.DiscardContents)
2157 {
2158 IDirect3DSurface9* renderTargetSurface = renderTargetHelper.GetRenderTargetSurface(currentRenderTargetBindings[num2]._cubeMapFace);
2159 uint num3 = (uint)(color.A << 8);
2160 uint num4 = (color.R | num3) << 8;
2161 uint num5 = (color.G | num4) << 8;
2162 uint num6 = color.B | num5;
2163 IDirect3DDevice9* ptr = pComPtr;
2164 int num7 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, IDirect3DSurface9*, tagRECT*, uint, int>)(int)(*(uint*)(*(int*)ptr + 140)))((nint)ptr, renderTargetSurface, null, num6);
2165 if (renderTargetSurface != null)
2166 {
2167 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint>)(int)(*(uint*)(*(int*)renderTargetSurface + 8)))((nint)renderTargetSurface);
2168 }
2169 if (num7 < 0)
2170 {
2171 throw GraphicsHelpers.GetExceptionFromResult((uint)num7);
2172 }
2173 }
2174 num2++;
2175 }
2176 while (num2 < currentRenderTargetCount);
2177 }
2178 }
2179 int num8 = lazyClearFlags & 6;
2180 if (num8 != 0)
2181 {
2182 Clear((ClearOptions)num8, color, 1f, 0);
2183 }
2184 }
2185 lazyClearFlags = 0;
2186 }
unsafe IDirect3DSurface9 * GetRenderTargetSurface(CubeMapFace faceType)

References Microsoft.Xna.Framework.Color.A, System.Clear, Microsoft.Xna.Framework.Graphics.Color, Microsoft.Xna.Framework.Graphics.GraphicsDevice.currentRenderTargetBindings, Microsoft.Xna.Framework.Graphics.GraphicsDevice.currentRenderTargetCount, Microsoft.Xna.Framework.Graphics.GraphicsDevice.currentRenderTargets, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.RenderTargetHelper.GetRenderTargetSurface(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.lazyClearFlags, Microsoft.Xna.Framework.Graphics.GraphicsDevice.pComPtr, and Microsoft.Xna.Framework.Graphics.RenderTargetHelper.usage.

Referenced by Microsoft.Xna.Framework.Graphics.GraphicsDevice.GetBackBufferData< T >(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.Present(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetRenderTargets(), and Microsoft.Xna.Framework.Graphics.GraphicsDevice.VerifyCanDraw().