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

◆ GetAndValidateRect()

static unsafe void Microsoft.Xna.Framework.Graphics.Texture.GetAndValidateRect ( _D3DSURFACE_DESC * __unnamed000,
uint * pdwLockWidth,
uint * pdwLockHeight,
Rectangle? rect )
inlinestaticpackageinherited

Definition at line 221 of file Texture.cs.

222 {
223 if (__unnamed000 == null || pdwLockHeight == null || pdwLockWidth == null)
224 {
225 return;
226 }
227 *pdwLockWidth = *(uint*)((byte*)__unnamed000 + 24);
228 *pdwLockHeight = *(uint*)((byte*)__unnamed000 + 28);
229 if (!rect.HasValue)
230 {
231 return;
232 }
233 if (rect.Value.X >= 0 && rect.Value.Width > 0 && rect.Value.Y >= 0 && rect.Value.Height > 0)
234 {
235 Rectangle value = rect.Value;
236 Rectangle value2 = rect.Value;
237 if ((uint)(value.Left + value2.Width) <= (uint)(*(int*)((byte*)__unnamed000 + 24)))
238 {
239 Rectangle value3 = rect.Value;
240 Rectangle value4 = rect.Value;
241 if ((uint)(value3.Top + value4.Height) <= (uint)(*(int*)((byte*)__unnamed000 + 28)))
242 {
243 *pdwLockWidth = (uint)rect.Value.Width;
244 *pdwLockHeight = (uint)rect.Value.Height;
245 return;
246 }
247 }
248 throw new ArgumentException(FrameworkResources.InvalidRectangle, "rect");
249 }
250 throw new ArgumentException(FrameworkResources.InvalidRectangle, "rect");
251 }

References Microsoft.Xna.Framework.Rectangle.Height, Microsoft.Xna.Framework.FrameworkResources.InvalidRectangle, System.value, Microsoft.Xna.Framework.Rectangle.Width, Microsoft.Xna.Framework.Rectangle.X, and Microsoft.Xna.Framework.Rectangle.Y.

Referenced by Microsoft.Xna.Framework.Graphics.TextureCube.CopyData< T >(), Microsoft.Xna.Framework.Graphics.Texture2D.CopyData< T >(), and Microsoft.Xna.Framework.Graphics.GraphicsDevice.GetBackBufferData< T >().