481 {
482 IDirect3DVolumeTexture9* ptr =
pComPtr;
483 if (ptr == null)
484 {
485 return 0;
486 }
488 int num = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, _D3DVOLUME_DESC*,
int>)(
int)(*(uint*)(*(
int*)ptr + 68)))((nint)ptr, 0u, &d3DVOLUME_DESC);
489 if (num >= 0)
490 {
491 if (isStoring)
492 {
494 }
498 byte expectedByteSizeFromFormat =
Texture.GetExpectedByteSizeFromFormat(*(_D3DFORMAT*)(&d3DVOLUME_DESC));
499 int num5 = 0;
500 int num6 = 0;
502 {
504 do
505 {
506 byte* ptr2 = null;
507 int num7;
508 if (!isStoring)
509 {
511 num5++;
512 ptr2 = (byte*)reference.ToPointer();
513 num7 = 0;
514 }
515 else
516 {
517 num7 = 16;
518 }
520 num = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint, _D3DLOCKED_BOX*, _D3DBOX*, uint,
int>)(
int)(*(uint*)(*(
int*)ptr + 76)))((nint)ptr, (uint)num6, &d3DLOCKED_BOX,
null, (uint)num7);
521 if (num < 0)
522 {
523 break;
524 }
525 uint num8 = expectedByteSizeFromFormat * num2;
526 if (isStoring)
527 {
528 ptr2 = (byte*)_003CModule_003E.new_005B_005D(num8 * num4 * num3);
529 }
530 byte* ptr3 = ptr2;
532 if (0 < num4)
533 {
534 uint num9 = num4;
535 do
536 {
537 byte* ptr5 = ptr4;
538 if (0 < num3)
539 {
540 uint num10 = num3;
541 do
542 {
543 if (isStoring)
544 {
545 _003CModule_003E.memcpy_s(ptr3, num8 * num3, ptr5, num8);
546 }
547 else
548 {
549 _003CModule_003E.memcpy_s(ptr5, *(uint*)(&d3DLOCKED_BOX), ptr3, num8);
550 }
551 ptr5 = *(int*)(&d3DLOCKED_BOX) + ptr5;
552 ptr3 = (int)num8 + ptr3;
553 num10--;
554 }
555 while (num10 != 0);
556 }
558 num9--;
559 }
560 while (num9 != 0);
561 }
563 num = ((delegate* unmanaged[Stdcall, Stdcall]<
IntPtr, uint,
int>)(
int)(*(uint*)(*(
int*)ptr + 80)))((nint)ptr, (uint)num6);
564 if (num < 0)
565 {
566 break;
567 }
568 if (isStoring)
569 {
572 num5++;
573 reference2 = intPtr;
574 }
575 num2 = ((num2 <= 1) ? 1u : (num2 >> 1));
576 num3 = ((num3 <= 1) ? 1u : (num3 >> 1));
577 num4 = ((num4 <= 1) ? 1u : (num4 >> 1));
578 num6++;
579 }
581 }
582 }
583 return num;
584 }
unsafe IDirect3DVolumeTexture9 * pComPtr