Skip to content

Commit

Permalink
Change how DDOVER_SHOW & DDOVER_HIDE flags work
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Dec 4, 2024
1 parent 5ba919f commit 8f1a20b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 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 7353
#define BUILD_NUMBER 7354
23 changes: 3 additions & 20 deletions ddraw/IDirectDrawSurfaceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3546,25 +3546,8 @@ HRESULT m_IDirectDrawSurfaceX::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFA
// Turns off this overlay.
if (dwFlags & DDOVER_HIDE)
{
// Remove items from the list
if ((!lpSrcRect || DoRectsMatch(*lpSrcRect, SurfaceOverlay.SrcRect)) &&
(!lpDDDestSurface || lpDDDestSurface == SurfaceOverlay.lpDDDestSurface) &&
(!lpDestRect || DoRectsMatch(*lpDestRect, SurfaceOverlay.DestRect)))
{
SurfaceOverlay.OverlayEnabled = false;
return DD_OK;
}

// No items found
LOG_LIMIT(100, __FUNCTION__ << " Error: could not find Overlay entry in list!");
return DDERR_INVALIDPARAMS;
}

// Check if need to turn on this overlay.
if (!(dwFlags & DDOVER_SHOW))
{
LOG_LIMIT(100, __FUNCTION__ << " Error: cannot find correct dwFlags: " << Logging::hex(dwFlags));
return DDERR_INVALIDPARAMS;
SurfaceOverlay.OverlayEnabled = false;
return DD_OK;
}

// Check for required DDOVERLAYFX structure
Expand Down Expand Up @@ -3666,7 +3649,7 @@ HRESULT m_IDirectDrawSurfaceX::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFA

// Add entry to overlay vector
SURFACEOVERLAY Overlay;
Overlay.OverlayEnabled = true;
Overlay.OverlayEnabled = (SurfaceOverlay.OverlayEnabled || (dwFlags & DDOVER_SHOW));
if (lpSrcRect)
{
Overlay.isSrcRectNull = false;
Expand Down

0 comments on commit 8f1a20b

Please sign in to comment.