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

◆ ResetState()

unsafe void Microsoft.Xna.Framework.Graphics.TextureCollection.ResetState ( )
inlinepackage

Definition at line 151 of file TextureCollection.cs.

152 {
153 int num = 0;
154 if (0 >= _maxTextures)
155 {
156 return;
157 }
158 while (true)
159 {
160 IntPtr pComPtr = (IntPtr)_parent.pComPtr;
161 Helpers.CheckDisposed(_parent, pComPtr);
162 if (num < 0 || num >= _maxTextures)
163 {
164 break;
165 }
166 int num2 = _textureOffset + num;
167 int num3 = ((num2 < 257) ? num2 : (num2 - 241));
168 uint num4 = (uint)(1 << num3);
169 EffectPass activePass = _parent.activePass;
170 if (activePass != null && (activePass._textureFlags & num4) != 0)
171 {
172 activePass.EndPass();
173 _parent.activePass = null;
174 }
175 IDirect3DDevice9* pComPtr2 = _parent.pComPtr;
176 int num5 = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, IDirect3DBaseTexture9*, int>)(int)(*(uint*)(*(int*)pComPtr2 + 260)))((nint)pComPtr2, (uint)num2, null);
177 if (num5 >= 0)
178 {
179 StateTrackerDevice* pStateTracker = _parent.pStateTracker;
180 uint num6 = ~num4;
181 *(int*)((byte*)pStateTracker + 136) &= (int)num6;
182 *(int*)((byte*)pStateTracker + 140) &= (int)num6;
183 num++;
184 if (num >= _maxTextures)
185 {
186 return;
187 }
188 continue;
189 }
190 throw GraphicsHelpers.GetExceptionFromResult((uint)num5);
191 }
192 throw new ArgumentOutOfRangeException("index");
193 }

References Microsoft.Xna.Framework.Graphics.TextureCollection._maxTextures, Microsoft.Xna.Framework.Graphics.TextureCollection._parent, Microsoft.Xna.Framework.Graphics.EffectPass._textureFlags, Microsoft.Xna.Framework.Graphics.TextureCollection._textureOffset, Microsoft.Xna.Framework.Graphics.GraphicsDevice.activePass, Microsoft.Xna.Framework.Helpers.CheckDisposed(), Microsoft.Xna.Framework.Graphics.EffectPass.EndPass(), Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.pComPtr, and Microsoft.Xna.Framework.Graphics.GraphicsDevice.pStateTracker.

Referenced by Microsoft.Xna.Framework.Graphics.GraphicsDevice.Reset().