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

◆ SaveDataForRecreation() [1/2]

virtual unsafe int Microsoft.Xna.Framework.Graphics.VertexBuffer.SaveDataForRecreation ( )
inlinepackagevirtual

Implements Microsoft.Xna.Framework.Graphics.IGraphicsResource.

Reimplemented in Microsoft.Xna.Framework.Graphics.DynamicVertexBuffer, and Microsoft.Xna.Framework.Graphics.DynamicVertexBuffer.

Definition at line 319 of file VertexBuffer.cs.

320 {
321 if (pComPtr == null)
322 {
323 return 0;
324 }
325 int num = 0;
326 if ((_usage & 8) == 8)
327 {
328 goto IL_0088;
329 }
330 void* ptr = null;
331 if ((pBufferData = _003CModule_003E.new_005B_005D(_size)) == null)
332 {
333 return -2147024882;
334 }
335 IDirect3DVertexBuffer9* ptr2 = pComPtr;
336 num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, uint, void**, uint, int>)(int)(*(uint*)(*(int*)ptr2 + 44)))((nint)ptr2, 0u, 0u, &ptr, 0u);
337 if (num >= 0)
338 {
339 uint size = _size;
340 _003CModule_003E.memcpy_s(pBufferData, size, ptr, size);
341 ptr2 = pComPtr;
342 IDirect3DVertexBuffer9* intPtr = ptr2;
343 num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, int>)(int)(*(uint*)(*(int*)intPtr + 48)))((nint)intPtr);
344 if (num >= 0)
345 {
346 goto IL_0088;
347 }
348 }
349 void* ptr3 = pBufferData;
350 if (ptr3 != null)
351 {
352 _003CModule_003E.delete_005B_005D(ptr3);
353 pBufferData = null;
354 }
355 goto IL_00a8;
356 IL_0088:
357 ReleaseNativeObject(disposeManagedResource: false);
358 goto IL_00a8;
359 IL_00a8:
360 return num;
361 }
virtual unsafe void ReleaseNativeObject([MarshalAs(UnmanagedType.U1)] bool disposeManagedResource)
unsafe IDirect3DVertexBuffer9 * pComPtr

References Microsoft.Xna.Framework.Graphics.VertexBuffer._size, Microsoft.Xna.Framework.Graphics.VertexBuffer._usage, Microsoft.Xna.Framework.Graphics.VertexBuffer.pBufferData, Microsoft.Xna.Framework.Graphics.VertexBuffer.pComPtr, and Microsoft.Xna.Framework.Graphics.VertexBuffer.ReleaseNativeObject().

Referenced by Microsoft.Xna.Framework.Graphics.VertexBuffer.SaveDataForRecreation().