Skip to content

Commit

Permalink
Better handling of surface and lock emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Dec 8, 2024
1 parent 52ec0d1 commit 85766f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 7367
#define BUILD_NUMBER 7368
4 changes: 2 additions & 2 deletions ddraw/IDirectDrawSurfaceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4593,7 +4593,7 @@ HRESULT m_IDirectDrawSurfaceX::CreateD9Surface()
// Get texture format
surface.Format = GetDisplayFormat(surfaceDesc2.ddpfPixelFormat);
surface.BitCount = GetBitCount(surface.Format);
const bool CanUseEmulation = (!IsDepthStencil() && !(surface.Format & 0xFF000000 /*FOURCC or D3DFMT_DXTx*/) && !surface.UsingSurfaceMemory);
const bool CanUseEmulation = (!IsSurface3D() && !IsDepthStencil() && !(surface.Format & 0xFF000000 /*FOURCC or D3DFMT_DXTx*/) && !surface.UsingSurfaceMemory);
SurfaceRequiresEmulation = (CanUseEmulation && (Config.DdrawEmulateSurface || ShouldEmulate == SC_FORCE_EMULATED ||
surface.Format == D3DFMT_A8B8G8R8 || surface.Format == D3DFMT_X8B8G8R8 || surface.Format == D3DFMT_B8G8R8 || surface.Format == D3DFMT_R8G8B8));
const bool CreateSurfaceEmulated = (CanUseEmulation && (SurfaceRequiresEmulation ||
Expand Down Expand Up @@ -5762,7 +5762,7 @@ void m_IDirectDrawSurfaceX::LockEmuLock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDD
DWORD BBP = surface.BitCount;
LONG NewPitch = (BBP / 8) * lpDDSurfaceDesc->dwWidth;

bool LockOffPlain = (Config.DdrawEmulateLock && !IsSurfaceTexture() && (lpDDSurfaceDesc->ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY));
bool LockOffPlain = Config.DdrawEmulateLock;
bool LockByteAlign = (Config.DdrawFixByteAlignment && lpDDSurfaceDesc->lPitch != NewPitch);

// Emulate lock for offscreen surfaces
Expand Down

0 comments on commit 85766f7

Please sign in to comment.