Skip to content

Commit

Permalink
Update Lock() and Clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Aug 22, 2023
1 parent 79427b8 commit d6c42f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 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 6776
#define BUILD_NUMBER 6777
4 changes: 2 additions & 2 deletions ddraw/IDirect3DDeviceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ HRESULT m_IDirect3DDeviceX::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlag
}

// Clear primary surface
if (dwFlags & D3DCLEAR_TARGET)
/*if (dwFlags & D3DCLEAR_TARGET)
{
m_IDirectDrawSurfaceX* PrimarySurface = ddrawParent->GetPrimarySurface();
if (PrimarySurface)
Expand All @@ -1791,7 +1791,7 @@ HRESULT m_IDirect3DDeviceX::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlag
PrimarySurface->ColorFill(nullptr, dwColor);
}
}
}
}*/

return (*d3d9Device)->Clear(dwCount, lpRects, dwFlags, dwColor, dvZ, dwStencil);
}
Expand Down
7 changes: 5 additions & 2 deletions ddraw/IDirectDrawSurfaceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2176,9 +2176,12 @@ HRESULT m_IDirectDrawSurfaceX::Lock2(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSur
{
// Lock surface
HRESULT ret = LockD39Surface(&LockedRect, &DestRect, Flags);
if (FAILED(ret) && IsSurfaceLocked() && !IsLockedFromOtherThread())
if (FAILED(ret))
{
LOG_LIMIT(100, __FUNCTION__ << " Warning: attempting to lock surface twice!");
if (IsSurfaceLocked())
{
LOG_LIMIT(100, __FUNCTION__ << " Warning: attempting to lock surface twice!");
}
UnlockD39Surface();
ret = LockD39Surface(&LockedRect, &DestRect, Flags);
}
Expand Down

0 comments on commit d6c42f0

Please sign in to comment.