From 429891b1ec2c469b4d2488b367524307b06d298c Mon Sep 17 00:00:00 2001 From: WinterSnowfall Date: Mon, 6 Jan 2025 21:46:40 +0200 Subject: [PATCH] Revert clearing rect/volume content on surface/volume locks (#190) --- source/d3d8to9_surface.cpp | 12 ------------ source/d3d8to9_volume.cpp | 8 -------- 2 files changed, 20 deletions(-) diff --git a/source/d3d8to9_surface.cpp b/source/d3d8to9_surface.cpp index 198ad0f..b325be7 100644 --- a/source/d3d8to9_surface.cpp +++ b/source/d3d8to9_surface.cpp @@ -91,18 +91,6 @@ HRESULT STDMETHODCALLTYPE Direct3DSurface8::GetDesc(D3DSURFACE_DESC8 *pDesc) } HRESULT STDMETHODCALLTYPE Direct3DSurface8::LockRect(D3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags) { - D3DSURFACE_DESC8 SurfaceDesc; - - const HRESULT hr = GetDesc(&SurfaceDesc); - - // D3D8 clears the contents of pLockedRect for all - // surfaces except those of type D3DRTYPE_TEXTURE - if (SUCCEEDED(hr) && pLockedRect != nullptr && SurfaceDesc.Type != D3DRTYPE_TEXTURE) - { - pLockedRect->pBits = nullptr; - pLockedRect->Pitch = 0; - } - return ProxyInterface->LockRect(pLockedRect, pRect, Flags); } HRESULT STDMETHODCALLTYPE Direct3DSurface8::UnlockRect() diff --git a/source/d3d8to9_volume.cpp b/source/d3d8to9_volume.cpp index 3e3ffad..3bb9428 100644 --- a/source/d3d8to9_volume.cpp +++ b/source/d3d8to9_volume.cpp @@ -90,14 +90,6 @@ HRESULT STDMETHODCALLTYPE Direct3DVolume8::GetDesc(D3DVOLUME_DESC8 *pDesc) } HRESULT STDMETHODCALLTYPE Direct3DVolume8::LockBox(D3DLOCKED_BOX *pLockedVolume, const D3DBOX *pBox, DWORD Flags) { - if (pLockedVolume != nullptr) - { - // D3D8 clears the contents of pLockedVolume - pLockedVolume->pBits = nullptr; - pLockedVolume->RowPitch = 0; - pLockedVolume->SlicePitch = 0; - } - return ProxyInterface->LockBox(pLockedVolume, pBox, Flags); } HRESULT STDMETHODCALLTYPE Direct3DVolume8::UnlockBox()