From 8f1a20bd6d1e236f59b0b9db04d5829784955103 Mon Sep 17 00:00:00 2001 From: Elisha Riedlinger Date: Tue, 3 Dec 2024 22:46:12 -0800 Subject: [PATCH] Change how DDOVER_SHOW & DDOVER_HIDE flags work --- Dllmain/BuildNo.rc | 2 +- ddraw/IDirectDrawSurfaceX.cpp | 23 +++-------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/Dllmain/BuildNo.rc b/Dllmain/BuildNo.rc index 543f7b4f..2ba73fcf 100644 --- a/Dllmain/BuildNo.rc +++ b/Dllmain/BuildNo.rc @@ -1 +1 @@ -#define BUILD_NUMBER 7353 +#define BUILD_NUMBER 7354 diff --git a/ddraw/IDirectDrawSurfaceX.cpp b/ddraw/IDirectDrawSurfaceX.cpp index 069738dc..c891304d 100644 --- a/ddraw/IDirectDrawSurfaceX.cpp +++ b/ddraw/IDirectDrawSurfaceX.cpp @@ -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 @@ -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;