Added patch to implement ddraw7_FlipToGDISurface.

This commit is contained in:
Sebastian Lackner 2017-01-08 22:35:29 +01:00
parent a16141c94f
commit c9f8f08e41
3 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,73 @@
From 8bd90811a6f9431ffc1a966d76c80fae0ba23171 Mon Sep 17 00:00:00 2001
From: Henri Verbeet <hverbeet@codeweavers.com>
Date: Sun, 8 Jan 2017 22:32:32 +0100
Subject: ddraw: Implement ddraw7_FlipToGDISurface.
---
dlls/ddraw/ddraw.c | 7 ++++++-
dlls/ddraw/ddraw_private.h | 1 +
dlls/ddraw/surface.c | 5 +++--
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 6afa6dddcb4..b883770c537 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2058,7 +2058,12 @@ static HRESULT WINAPI d3d1_Initialize(IDirect3D *iface, REFIID riid)
*****************************************************************************/
static HRESULT WINAPI ddraw7_FlipToGDISurface(IDirectDraw7 *iface)
{
- FIXME("iface %p stub!\n", iface);
+ struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
+
+ TRACE("iface %p.\n", iface);
+
+ ddraw->flags |= DDRAW_GDI_FLIP;
+ ddraw_surface_update_frontbuffer(ddraw->primary, NULL, FALSE);
return DD_OK;
}
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index 1133bbdd07d..c18ab12a39a 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -56,6 +56,7 @@ struct FvfToDecl
#define DDRAW_NO3D 0x00000008
#define DDRAW_SCL_DDRAW1 0x00000010
#define DDRAW_SCL_RECURSIVE 0x00000020
+#define DDRAW_GDI_FLIP 0x00000040
#define DDRAW_STRIDE_ALIGNMENT 8
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 4b53ac341d5..49caa0aaeae 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -42,6 +42,7 @@ static inline struct ddraw_surface *impl_from_IDirectDrawGammaControl(IDirectDra
* to support windowless rendering first. */
HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RECT *rect, BOOL read)
{
+ struct ddraw *ddraw = surface->ddraw;
HDC surface_dc, screen_dc;
int x, y, w, h;
HRESULT hr;
@@ -62,14 +63,14 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RE
if (w <= 0 || h <= 0)
return DD_OK;
- if (surface->ddraw->swapchain_window)
+ if (ddraw->swapchain_window && !(ddraw->flags & DDRAW_GDI_FLIP))
{
/* Nothing to do, we control the frontbuffer, or at least the parts we
* care about. */
if (read)
return DD_OK;
- return wined3d_texture_blt(surface->ddraw->wined3d_frontbuffer, 0, rect,
+ return wined3d_texture_blt(ddraw->wined3d_frontbuffer, 0, rect,
surface->wined3d_texture, surface->sub_resource_idx, rect, 0, NULL, WINED3D_TEXF_POINT);
}
--
2.11.0

View File

@ -0,0 +1 @@
Fixes: [30062] Implement ddraw7_FlipToGDISurface.

View File

@ -136,6 +136,7 @@ patch_enable_all ()
enable_ddraw_Device_Caps="$1"
enable_ddraw_EnumSurfaces="$1"
enable_ddraw_Fix_Typos="$1"
enable_ddraw_FlipToGDISurface="$1"
enable_ddraw_IDirect3DTexture2_Load="$1"
enable_ddraw_Rendering_Targets="$1"
enable_ddraw_Write_Vtable="$1"
@ -601,6 +602,9 @@ patch_enable ()
ddraw-Fix_Typos)
enable_ddraw_Fix_Typos="$2"
;;
ddraw-FlipToGDISurface)
enable_ddraw_FlipToGDISurface="$2"
;;
ddraw-IDirect3DTexture2_Load)
enable_ddraw_IDirect3DTexture2_Load="$2"
;;
@ -3676,6 +3680,21 @@ if test "$enable_ddraw_Fix_Typos" -eq 1; then
) >> "$patchlist"
fi
# Patchset ddraw-FlipToGDISurface
# |
# | This patchset fixes the following Wine bugs:
# | * [#30062] Implement ddraw7_FlipToGDISurface.
# |
# | Modified files:
# | * dlls/ddraw/ddraw.c, dlls/ddraw/ddraw_private.h, dlls/ddraw/surface.c
# |
if test "$enable_ddraw_FlipToGDISurface" -eq 1; then
patch_apply ddraw-FlipToGDISurface/0001-ddraw-Implement-ddraw7_FlipToGDISurface.patch
(
echo '+ { "Henri Verbeet", "ddraw: Implement ddraw7_FlipToGDISurface.", 1 },';
) >> "$patchlist"
fi
# Patchset ddraw-IDirect3DTexture2_Load
# |
# | Modified files: