[PATCH] wined3d: Use StretchBlt() in swapchain_blit_gdi().
Paul Gofman
pgofman at codeweavers.com
Fri Feb 11 06:19:58 CST 2022
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
Fixes Serious Sam: The Random Encounter which has the contents presented
in a smaller rectangle in the upper left corner of the screen since
commit 6181b0ea270dfe0be2a0246bb391568559cc01af. While at the same time
the game benefits from that commit as it solves the issue which happens when
display aspect ration doesn't match the game's one (in which case it should present
letterboxed image which black parts get garbage without the commit).
The actual issue is probably in the earlier commit 70418f69dd49da5625bb1893d9fc2bef3fe97b5e
which doesn't account for possibly different source and destination rectangle dimensions.
dlls/wined3d/swapchain.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 49a40f3e1d6..5fcbfc58779 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -459,8 +459,9 @@ static void swapchain_blit_gdi(struct wined3d_swapchain *swapchain,
if (!(dst_dc = GetDCEx(swapchain->win_handle, 0, DCX_USESTYLE | DCX_CACHE)))
ERR("Failed to get destination DC.\n");
- if (!BitBlt(dst_dc, dst_rect->left, dst_rect->top, dst_rect->right - dst_rect->left,
- dst_rect->bottom - dst_rect->top, src_dc, src_rect->left, src_rect->top, SRCCOPY))
+ if (!StretchBlt(dst_dc, dst_rect->left, dst_rect->top, dst_rect->right - dst_rect->left,
+ dst_rect->bottom - dst_rect->top, src_dc, src_rect->left, src_rect->top,
+ src_rect->right - src_rect->left, src_rect->bottom - src_rect->top, SRCCOPY))
ERR("Failed to blit.\n");
ReleaseDC(swapchain->win_handle, dst_dc);
--
2.34.1
More information about the wine-devel
mailing list