91 : struct
92 {
94 Helpers.CheckDisposed(this, intPtr);
95 if (data != null && data.Length != 0)
96 {
98 {
100 }
101 if (isSetting)
102 {
103 int num = 0;
105 if (0 < parent.Textures._maxTextures)
106 {
107 do
108 {
109 if (parent.Textures[num] != this)
110 {
111 num++;
113 continue;
114 }
115 throw GraphicsHelpers.GetExceptionFromResult(2147500036u);
116 }
117 while (num < parent.Textures._maxTextures);
118 }
119 int num2 = 0;
121 if (0 < parent2.VertexTextures._maxTextures)
122 {
123 do
124 {
125 if (parent2.VertexTextures[num2] != this)
126 {
127 num2++;
129 continue;
130 }
131 throw GraphicsHelpers.GetExceptionFromResult(2147500036u);
132 }
133 while (num2 < parent2.VertexTextures._maxTextures);
134 }
135 }
136 IDirect3DCubeTexture9* ptr =
pComPtr;
138 int num3 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, _D3DSURFACE_DESC*,
int>)(
int)(*(uint*)(*(
int*)ptr + 68)))((nint)ptr, (uint)level, &d3DSURFACE_DESC);
139 if (num3 < 0)
140 {
141 throw GraphicsHelpers.GetExceptionFromResult((uint)num3);
142 }
143 Helpers.ValidateCopyParameters(data.Length,
startIndex, elementCount);
146 Texture.GetAndValidateSizes<T>(&d3DSURFACE_DESC, &dwFormatSize, &dwElementSize);
149 Texture.GetAndValidateRect(&d3DSURFACE_DESC, &dwLockWidth, &dwLockHeight, rect);
150 Texture.ValidateTotalSize(&d3DSURFACE_DESC, dwLockWidth, dwLockHeight, dwFormatSize, dwElementSize, (uint)elementCount);
151 tagRECT* ptr2 = null;
152 Rectangle rectangle = default(Rectangle);
153 if (rect.HasValue)
154 {
155 rectangle = rect.Value;
156 ptr2 = (tagRECT*)(int)(ref rectangle);
157 if (ptr2 != null)
158 {
159 *(int*)((byte*)ptr2 + 8) += *(int*)ptr2;
160 *(int*)((byte*)ptr2 + 12) += *(int*)((byte*)ptr2 + 4);
161 }
162 }
163 int num5;
166 {
167 if (!isSetting)
168 {
173 int num4 = *(
int*)GraphicsAdapter.
pComPtr + 40;
174 if (((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, _D3DDEVTYPE, _D3DFORMAT, uint, _D3DRESOURCETYPE, _D3DFORMAT,
int>)(
int)(*(uint*)num4))((nint)GraphicsAdapter.pComPtr, graphicsDevice3.Adapter.adapter, graphicsDevice2._deviceType, _003CModule_003E.ConvertXnaFormatToWindowsAdapterFormat(graphicsDevice.Adapter.CurrentDisplayMode.Format), 1u, (_D3DRESOURCETYPE)3, *(_D3DFORMAT*)(&d3DSURFACE_DESC)) < 0)
175 {
177 }
178 }
179 IDirect3DSurface9* ptr3 = null;
180 IDirect3DTexture9* ptr4 = null;
181 IDirect3DSurface9* ptr5 = null;
183 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, uint, uint, uint, _D3DFORMAT, _D3DPOOL, IDirect3DTexture9**,
void**,
int>)(
int)(*(uint*)(*(
int*)ptr6 + 92)))((nint)ptr6,
System.
Runtime.
CompilerServices.
Unsafe.As<_D3DSURFACE_DESC, uint>(ref
System.
Runtime.
CompilerServices.
Unsafe.AddByteOffset(ref d3DSURFACE_DESC, 24)),
System.
Runtime.
CompilerServices.
Unsafe.As<_D3DSURFACE_DESC, uint>(ref
System.
Runtime.
CompilerServices.
Unsafe.AddByteOffset(ref d3DSURFACE_DESC, 28)), 1u, 0u, *(_D3DFORMAT*)(&d3DSURFACE_DESC), (_D3DPOOL)2, &ptr4,
null);
184 if (num5 >= 0)
185 {
186 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, IDirect3DSurface9**,
int>)(
int)(*(uint*)(*(
int*)ptr4 + 72)))((nint)ptr4, 0u, &ptr3);
187 if (num5 >= 0)
188 {
190 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, _D3DCUBEMAP_FACES, uint, IDirect3DSurface9**,
int>)(
int)(*(uint*)(*(
int*)ptr + 72)))((nint)ptr, (_D3DCUBEMAP_FACES)cubeMapFace, (uint)level, &ptr5);
191 if (num5 >= 0)
192 {
193 if (isSetting)
194 {
196 {
197 num5 = _003CModule_003E.D3DXLoadSurfaceFromSurface(ptr3, null, null, ptr5, null, null, 1u, 0u);
198 }
199 if (num5 >= 0)
200 {
201 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, _D3DLOCKED_RECT*, tagRECT*, uint,
int>)(
int)(*(uint*)(*(
int*)ptr3 + 52)))((nint)ptr3, &d3DLOCKED_RECT, ptr2, 0u);
202 if (num5 >= 0)
203 {
204 try
205 {
206 Texture.CopyData((
void*)(int)
System.
Runtime.
CompilerServices.
Unsafe.As<_D3DLOCKED_RECT, uint>(ref
System.
Runtime.
CompilerServices.
Unsafe.AddByteOffset(ref d3DLOCKED_RECT, 4)), *(
int*)(&d3DLOCKED_RECT), data,
startIndex, elementCount, &d3DSURFACE_DESC, dwLockWidth, dwLockHeight, isSetting);
207 }
208 finally
209 {
210 IDirect3DSurface9* intPtr2 = ptr3;
211 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr,
int>)(
int)(*(uint*)(*(
int*)intPtr2 + 56)))((nint)intPtr2);
212 }
213 if (num5 >= 0)
214 {
215 num5 = _003CModule_003E.D3DXLoadSurfaceFromSurface(ptr5, null, ptr2, ptr3, null, ptr2, 1u, 0u);
216 }
217 }
218 }
219 }
220 else
221 {
222 num5 = _003CModule_003E.D3DXLoadSurfaceFromSurface(ptr3, null, ptr2, ptr5, null, ptr2, 1u, 0u);
223 if (num5 >= 0)
224 {
225 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, _D3DLOCKED_RECT*, tagRECT*, uint,
int>)(
int)(*(uint*)(*(
int*)ptr3 + 52)))((nint)ptr3, &d3DLOCKED_RECT, ptr2, 0u);
226 if (num5 >= 0)
227 {
228 try
229 {
230 Texture.CopyData((
void*)(int)
System.
Runtime.
CompilerServices.
Unsafe.As<_D3DLOCKED_RECT, uint>(ref
System.
Runtime.
CompilerServices.
Unsafe.AddByteOffset(ref d3DLOCKED_RECT, 4)), *(
int*)(&d3DLOCKED_RECT), data,
startIndex, elementCount, &d3DSURFACE_DESC, dwLockWidth, dwLockHeight, isSetting: false);
231 }
232 finally
233 {
234 IDirect3DSurface9* intPtr3 = ptr3;
235 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr,
int>)(
int)(*(uint*)(*(
int*)intPtr3 + 56)))((nint)intPtr3);
236 }
237 }
238 }
239 }
240 }
241 }
242 }
243 if (ptr5 != null)
244 {
245 IDirect3DSurface9* intPtr4 = ptr5;
246 ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint>)(
int)(*(uint*)(*(
int*)intPtr4 + 8)))((nint)intPtr4);
247 ptr5 = null;
248 }
249 if (ptr3 != null)
250 {
251 IDirect3DSurface9* intPtr5 = ptr3;
252 ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint>)(
int)(*(uint*)(*(
int*)intPtr5 + 8)))((nint)intPtr5);
253 ptr3 = null;
254 }
255 if (ptr4 != null)
256 {
257 IDirect3DTexture9* intPtr6 = ptr4;
258 ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint>)(
int)(*(uint*)(*(
int*)intPtr6 + 8)))((nint)intPtr6);
259 ptr4 = null;
260 }
261 }
262 else
263 {
265 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, _D3DCUBEMAP_FACES, uint, _D3DLOCKED_RECT*, tagRECT*, uint,
int>)(
int)(*(uint*)(*(
int*)ptr + 76)))((nint)ptr, (_D3DCUBEMAP_FACES)cubeMapFace, (uint)level, &d3DLOCKED_RECT, ptr2,
options);
266 if (num5 >= 0)
267 {
268 try
269 {
270 Texture.CopyData((
void*)(int)
System.
Runtime.
CompilerServices.
Unsafe.As<_D3DLOCKED_RECT, uint>(ref
System.
Runtime.
CompilerServices.
Unsafe.AddByteOffset(ref d3DLOCKED_RECT, 4)), *(
int*)(&d3DLOCKED_RECT), data,
startIndex, elementCount, &d3DSURFACE_DESC, dwLockWidth, dwLockHeight, isSetting);
271 }
272 finally
273 {
275 num5 = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, _D3DCUBEMAP_FACES, uint,
int>)(
int)(*(uint*)(*(
int*)ptr + 80)))((nint)ptr, (_D3DCUBEMAP_FACES)cubeMapFace, (uint)level);
276 }
277 }
278 }
280 {
281 if (isSetting)
282 {
283 return;
284 }
286 {
287 try
288 {
290
292 }
293 catch
294 {
295
296 ptr7 = null;
297 throw;
298 }
299 }
300 }
301 else
302 {
303 if (num5 < 0)
304 {
305 throw GraphicsHelpers.GetExceptionFromResult((uint)num5);
306 }
307 if (isSetting && this is IDynamicGraphicsResource dynamicGraphicsResource)
308 {
309 dynamicGraphicsResource.SetContentLost(isContentLost: false);
310 }
311 }
312 return;
313 }
315 }
unsafe IDirect3DDevice9 * pComPtr
GraphicsDevice GraphicsDevice
unsafe IDirect3DCubeTexture9 * pComPtr
bool isActiveRenderTarget
static unsafe void InitBlock(void *startAddress, byte value, uint byteCount)