Rebase against f5d7d9cccc941024f1532a9ac23427d07810f337

This commit is contained in:
Alistair Leslie-Hughes 2019-01-24 11:12:44 +11:00
parent 6cfd7b70ba
commit b39ac4692c
7 changed files with 64 additions and 299 deletions

View File

@ -1,33 +1,33 @@
From f9702dad952fdc873a72b4a2781bf2171ff3f814 Mon Sep 17 00:00:00 2001
From 4e692713dface59a0e717e4ab9e2abf6b8223995 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sun, 11 Jan 2015 16:29:30 +0100
Subject: d3dx9_36: Improve D3DXSaveTextureToFile to save simple texture to dds
file.
Subject: [PATCH] d3dx9_36: Improve D3DXSaveTextureToFile to save simple
texture to dds file.
---
dlls/d3dx9_36/d3dx9_private.h | 2 ++
dlls/d3dx9_36/surface.c | 62 ++++++++++++++++++++++++++++++++++++++++
dlls/d3dx9_36/texture.c | 5 +---
dlls/d3dx9_36/d3dx9_private.h | 2 ++
dlls/d3dx9_36/surface.c | 62 +++++++++++++++++++++++++++++++++++++++++++
dlls/d3dx9_36/texture.c | 5 +---
3 files changed, 65 insertions(+), 4 deletions(-)
diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h
index 79f3b76..41bed31 100644
index 5a28f2e..158aae3 100644
--- a/dlls/d3dx9_36/d3dx9_private.h
+++ b/dlls/d3dx9_36/d3dx9_private.h
@@ -97,6 +97,8 @@ HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *d
const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN;
HRESULT load_volume_texture_from_dds(IDirect3DVolumeTexture9 *volume_texture, const void *src_data,
const PALETTEENTRY *palette, DWORD filter, DWORD color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN;
@@ -125,6 +125,8 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, D3DLOCKED_RECT *lock,
IDirect3DSurface9 **temp_surface, BOOL write) DECLSPEC_HIDDEN;
HRESULT unlock_surface(IDirect3DSurface9 *surface, D3DLOCKED_RECT *lock,
IDirect3DSurface9 *temp_surface, BOOL update) DECLSPEC_HIDDEN;
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture,
+ const PALETTEENTRY *src_palette) DECLSPEC_HIDDEN;
unsigned short float_32_to_16(const float in) DECLSPEC_HIDDEN;
float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN;
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 58b676d..79e8d53 100644
index f5dc799..e0d84fd 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -527,6 +527,68 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
@@ -611,6 +611,68 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
return D3D_OK;
}
@ -97,10 +97,10 @@ index 58b676d..79e8d53 100644
const D3DBOX *dst_box, const void *src_data, const D3DBOX *src_box, DWORD filter, D3DCOLOR color_key,
const D3DXIMAGE_INFO *src_info)
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
index 38349e2..5c06700 100644
index e2dfab8..9f0e541 100644
--- a/dlls/d3dx9_36/texture.c
+++ b/dlls/d3dx9_36/texture.c
@@ -1873,10 +1873,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
@@ -1906,10 +1906,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL;
if (file_format == D3DXIFF_DDS)
@ -113,5 +113,5 @@ index 38349e2..5c06700 100644
type = IDirect3DBaseTexture9_GetType(src_texture);
switch (type)
--
2.6.4
1.9.1

View File

@ -1,4 +1,4 @@
From 30578b99bc059003a1223e2e9752bb07d449c34e Mon Sep 17 00:00:00 2001
From 076d1ae00db0f95713e64bea1d2649cbdcdf5939 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Fri, 30 Mar 2018 08:22:02 +0000
Subject: [PATCH] d3dx9_36: add DXTn support
@ -17,8 +17,8 @@ Subject: [PATCH] d3dx9_36: add DXTn support
dlls/d3dx9_34/Makefile.in | 2 +-
dlls/d3dx9_35/Makefile.in | 2 +-
dlls/d3dx9_36/Makefile.in | 2 +-
dlls/d3dx9_36/surface.c | 101 +++++++++++++++++++++++++++++++---
dlls/d3dx9_36/tests/surface.c | 8 +--
dlls/d3dx9_36/surface.c | 102 ++++++++++++++++++++++++++++++++++++++----
dlls/d3dx9_36/tests/surface.c | 8 ++--
dlls/d3dx9_37/Makefile.in | 2 +-
dlls/d3dx9_38/Makefile.in | 2 +-
dlls/d3dx9_39/Makefile.in | 2 +-
@ -26,10 +26,10 @@ Subject: [PATCH] d3dx9_36: add DXTn support
dlls/d3dx9_41/Makefile.in | 2 +-
dlls/d3dx9_42/Makefile.in | 2 +-
dlls/d3dx9_43/Makefile.in | 2 +-
22 files changed, 117 insertions(+), 32 deletions(-)
22 files changed, 118 insertions(+), 32 deletions(-)
diff --git a/dlls/d3dx9_24/Makefile.in b/dlls/d3dx9_24/Makefile.in
index 482c92d64e2..d969a55b106 100644
index 482c92d..d969a55 100644
--- a/dlls/d3dx9_24/Makefile.in
+++ b/dlls/d3dx9_24/Makefile.in
@@ -1,6 +1,6 @@
@ -41,7 +41,7 @@ index 482c92d64e2..d969a55b106 100644
C_SRCS = \
diff --git a/dlls/d3dx9_25/Makefile.in b/dlls/d3dx9_25/Makefile.in
index be4c76980e1..b232290d255 100644
index be4c769..b232290 100644
--- a/dlls/d3dx9_25/Makefile.in
+++ b/dlls/d3dx9_25/Makefile.in
@@ -1,6 +1,6 @@
@ -53,7 +53,7 @@ index be4c76980e1..b232290d255 100644
C_SRCS = \
diff --git a/dlls/d3dx9_26/Makefile.in b/dlls/d3dx9_26/Makefile.in
index c5e9e85bfb7..525009d292c 100644
index c5e9e85..525009d 100644
--- a/dlls/d3dx9_26/Makefile.in
+++ b/dlls/d3dx9_26/Makefile.in
@@ -1,6 +1,6 @@
@ -65,7 +65,7 @@ index c5e9e85bfb7..525009d292c 100644
C_SRCS = \
diff --git a/dlls/d3dx9_27/Makefile.in b/dlls/d3dx9_27/Makefile.in
index ee7f0e2449c..da98482d243 100644
index ee7f0e2..da98482 100644
--- a/dlls/d3dx9_27/Makefile.in
+++ b/dlls/d3dx9_27/Makefile.in
@@ -1,6 +1,6 @@
@ -77,7 +77,7 @@ index ee7f0e2449c..da98482d243 100644
C_SRCS = \
diff --git a/dlls/d3dx9_28/Makefile.in b/dlls/d3dx9_28/Makefile.in
index 094420013d0..d50e035853f 100644
index 0944200..d50e035 100644
--- a/dlls/d3dx9_28/Makefile.in
+++ b/dlls/d3dx9_28/Makefile.in
@@ -1,6 +1,6 @@
@ -89,7 +89,7 @@ index 094420013d0..d50e035853f 100644
C_SRCS = \
diff --git a/dlls/d3dx9_29/Makefile.in b/dlls/d3dx9_29/Makefile.in
index 88cb110ff5e..cfc1a150349 100644
index 88cb110..cfc1a15 100644
--- a/dlls/d3dx9_29/Makefile.in
+++ b/dlls/d3dx9_29/Makefile.in
@@ -1,6 +1,6 @@
@ -101,7 +101,7 @@ index 88cb110ff5e..cfc1a150349 100644
C_SRCS = \
diff --git a/dlls/d3dx9_30/Makefile.in b/dlls/d3dx9_30/Makefile.in
index 6ab2ff24514..726c92e8fd5 100644
index 6ab2ff2..726c92e 100644
--- a/dlls/d3dx9_30/Makefile.in
+++ b/dlls/d3dx9_30/Makefile.in
@@ -1,6 +1,6 @@
@ -113,7 +113,7 @@ index 6ab2ff24514..726c92e8fd5 100644
C_SRCS = \
diff --git a/dlls/d3dx9_31/Makefile.in b/dlls/d3dx9_31/Makefile.in
index 3d44da147dc..201430127ce 100644
index 3d44da1..2014301 100644
--- a/dlls/d3dx9_31/Makefile.in
+++ b/dlls/d3dx9_31/Makefile.in
@@ -1,6 +1,6 @@
@ -125,7 +125,7 @@ index 3d44da147dc..201430127ce 100644
C_SRCS = \
diff --git a/dlls/d3dx9_32/Makefile.in b/dlls/d3dx9_32/Makefile.in
index 37cc2797afd..442258d8f31 100644
index 37cc279..442258d 100644
--- a/dlls/d3dx9_32/Makefile.in
+++ b/dlls/d3dx9_32/Makefile.in
@@ -1,6 +1,6 @@
@ -137,7 +137,7 @@ index 37cc2797afd..442258d8f31 100644
C_SRCS = \
diff --git a/dlls/d3dx9_33/Makefile.in b/dlls/d3dx9_33/Makefile.in
index 5b03ec134dd..cc98ed25016 100644
index 5b03ec1..cc98ed2 100644
--- a/dlls/d3dx9_33/Makefile.in
+++ b/dlls/d3dx9_33/Makefile.in
@@ -1,6 +1,6 @@
@ -149,7 +149,7 @@ index 5b03ec134dd..cc98ed25016 100644
C_SRCS = \
diff --git a/dlls/d3dx9_34/Makefile.in b/dlls/d3dx9_34/Makefile.in
index b7f9c46d5e7..4862fe94af1 100644
index b7f9c46..4862fe9 100644
--- a/dlls/d3dx9_34/Makefile.in
+++ b/dlls/d3dx9_34/Makefile.in
@@ -1,6 +1,6 @@
@ -161,7 +161,7 @@ index b7f9c46d5e7..4862fe94af1 100644
C_SRCS = \
diff --git a/dlls/d3dx9_35/Makefile.in b/dlls/d3dx9_35/Makefile.in
index 9c196ea038b..3f529c99154 100644
index 9c196ea..3f529c9 100644
--- a/dlls/d3dx9_35/Makefile.in
+++ b/dlls/d3dx9_35/Makefile.in
@@ -1,6 +1,6 @@
@ -173,7 +173,7 @@ index 9c196ea038b..3f529c99154 100644
C_SRCS = \
diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in
index da8098dd8d1..166031e6a4e 100644
index da8098d..166031e 100644
--- a/dlls/d3dx9_36/Makefile.in
+++ b/dlls/d3dx9_36/Makefile.in
@@ -1,7 +1,7 @@
@ -186,7 +186,7 @@ index da8098dd8d1..166031e6a4e 100644
C_SRCS = \
animation.c \
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
index 7d48cc6b132..85db27acadf 100644
index cae80a8..0900d04 100644
--- a/dlls/d3dx9_36/surface.c
+++ b/dlls/d3dx9_36/surface.c
@@ -27,6 +27,8 @@
@ -198,7 +198,7 @@ index 7d48cc6b132..85db27acadf 100644
WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
@@ -1715,6 +1717,24 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
@@ -1784,6 +1786,24 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic
}
}
@ -223,14 +223,12 @@ index 7d48cc6b132..85db27acadf 100644
/************************************************************
* D3DXLoadSurfaceFromMemory
*
@@ -1753,12 +1773,14 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
DWORD filter, D3DCOLOR color_key)
@@ -1823,10 +1843,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
{
const struct pixel_format_desc *srcformatdesc, *destformatdesc;
IDirect3DSurface9 *surface;
+ void *tmp_src_memory = NULL, *tmp_dst_memory = NULL;
+ dxtn_conversion_func pre_convert = NULL, post_convert = NULL;
IDirect3DSurface9 *surface = dst_surface;
IDirect3DDevice9 *device;
D3DSURFACE_DESC surfdesc;
D3DLOCKED_RECT lockrect;
struct volume src_size, dst_size;
@ -239,7 +237,7 @@ index 7d48cc6b132..85db27acadf 100644
TRACE("(%p, %p, %s, %p, %#x, %u, %p, %s, %#x, 0x%08x)\n",
dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_memory, src_format,
@@ -1856,18 +1878,65 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
@@ -1907,18 +1929,65 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
}
else /* Stretching or format conversion. */
{
@ -254,8 +252,8 @@ index 7d48cc6b132..85db27acadf 100644
+ (!post_convert && !is_conversion_to_supported(destformatdesc)))
{
FIXME("Unsupported format conversion %#x -> %#x.\n", src_format, surfdesc.Format);
hr = E_NOTIMPL;
goto done;
unlock_surface(dst_surface, &lockrect, surface, FALSE);
return E_NOTIMPL;
}
+ /* handle pre-conversion */
@ -309,7 +307,7 @@ index 7d48cc6b132..85db27acadf 100644
}
else /* if ((filter & 0xf) == D3DX_FILTER_POINT) */
{
@@ -1876,12 +1945,22 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
@@ -1927,12 +1996,29 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
/* Always apply a point filter until D3DX_FILTER_LINEAR,
* D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */
@ -326,33 +324,27 @@ index 7d48cc6b132..85db27acadf 100644
+ WINED3DFMT_B8G8R8A8_UNORM, dst_size.width, dst_size.height))
+ {
+ hr = E_FAIL;
+ goto done;
+ }
}
}
- hr = D3D_OK;
done:
IDirect3DSurface9_UnlockRect(surface);
if (surface != dst_surface)
@@ -1893,6 +1972,12 @@ done:
IDirect3DDevice9_Release(device);
}
IDirect3DSurface9_Release(surface);
- return unlock_surface(dst_surface, &lockrect, surface, TRUE);
+done:
+ if (pre_convert)
+ HeapFree(GetProcessHeap(), 0, tmp_src_memory);
+ if (post_convert)
+ HeapFree(GetProcessHeap(), 0, tmp_dst_memory);
+
+ if (pre_convert)
+ HeapFree(GetProcessHeap(), 0, tmp_src_memory);
+ if (post_convert)
+ HeapFree(GetProcessHeap(), 0, tmp_dst_memory);
+ IDirect3DSurface9_UnlockRect(dst_surface);
}
+ unlock_surface(dst_surface, &lockrect, surface, TRUE);
+ return hr;
}
return hr;
/************************************************************
diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c
index f153cd92c65..9cdf60a54c7 100644
index 6cb1ddb..885191e 100644
--- a/dlls/d3dx9_36/tests/surface.c
+++ b/dlls/d3dx9_36/tests/surface.c
@@ -1199,7 +1199,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
@@ -1195,7 +1195,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
@ -361,7 +353,7 @@ index f153cd92c65..9cdf60a54c7 100644
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
@@ -1225,7 +1225,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
@@ -1221,7 +1221,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
@ -370,7 +362,7 @@ index f153cd92c65..9cdf60a54c7 100644
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
@@ -1238,10 +1238,10 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
@@ -1234,10 +1234,10 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_FILTER_NONE, 0);
@ -384,7 +376,7 @@ index f153cd92c65..9cdf60a54c7 100644
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
diff --git a/dlls/d3dx9_37/Makefile.in b/dlls/d3dx9_37/Makefile.in
index ab790a4d5c4..51382c7109a 100644
index ab790a4..51382c7 100644
--- a/dlls/d3dx9_37/Makefile.in
+++ b/dlls/d3dx9_37/Makefile.in
@@ -1,6 +1,6 @@
@ -396,7 +388,7 @@ index ab790a4d5c4..51382c7109a 100644
C_SRCS = \
diff --git a/dlls/d3dx9_38/Makefile.in b/dlls/d3dx9_38/Makefile.in
index 6125c2da678..f6257cbdec7 100644
index 6125c2d..f6257cb 100644
--- a/dlls/d3dx9_38/Makefile.in
+++ b/dlls/d3dx9_38/Makefile.in
@@ -1,6 +1,6 @@
@ -408,7 +400,7 @@ index 6125c2da678..f6257cbdec7 100644
C_SRCS = \
diff --git a/dlls/d3dx9_39/Makefile.in b/dlls/d3dx9_39/Makefile.in
index d97a787c67a..a68ee9f3ad5 100644
index d97a787..a68ee9f 100644
--- a/dlls/d3dx9_39/Makefile.in
+++ b/dlls/d3dx9_39/Makefile.in
@@ -1,6 +1,6 @@
@ -420,7 +412,7 @@ index d97a787c67a..a68ee9f3ad5 100644
C_SRCS = \
diff --git a/dlls/d3dx9_40/Makefile.in b/dlls/d3dx9_40/Makefile.in
index 36c5a210cdb..7f2cfe1a47c 100644
index 36c5a21..7f2cfe1 100644
--- a/dlls/d3dx9_40/Makefile.in
+++ b/dlls/d3dx9_40/Makefile.in
@@ -1,6 +1,6 @@
@ -432,7 +424,7 @@ index 36c5a210cdb..7f2cfe1a47c 100644
C_SRCS = \
diff --git a/dlls/d3dx9_41/Makefile.in b/dlls/d3dx9_41/Makefile.in
index d4552cf608e..c5c3ab1aae5 100644
index d4552cf..c5c3ab1 100644
--- a/dlls/d3dx9_41/Makefile.in
+++ b/dlls/d3dx9_41/Makefile.in
@@ -1,6 +1,6 @@
@ -444,7 +436,7 @@ index d4552cf608e..c5c3ab1aae5 100644
C_SRCS = \
diff --git a/dlls/d3dx9_42/Makefile.in b/dlls/d3dx9_42/Makefile.in
index 5806fce66c6..e9a8e89da5f 100644
index 5806fce..e9a8e89 100644
--- a/dlls/d3dx9_42/Makefile.in
+++ b/dlls/d3dx9_42/Makefile.in
@@ -1,6 +1,6 @@
@ -456,7 +448,7 @@ index 5806fce66c6..e9a8e89da5f 100644
C_SRCS = \
diff --git a/dlls/d3dx9_43/Makefile.in b/dlls/d3dx9_43/Makefile.in
index 72ba8b4c1e0..33185bf7a8a 100644
index 72ba8b4..33185bf 100644
--- a/dlls/d3dx9_43/Makefile.in
+++ b/dlls/d3dx9_43/Makefile.in
@@ -1,6 +1,6 @@
@ -468,5 +460,5 @@ index 72ba8b4c1e0..33185bf7a8a 100644
C_SRCS = \
--
2.19.1
1.9.1

View File

@ -1,59 +0,0 @@
From dcb29efe26feef864e311ab1e5974cd071482eed Mon Sep 17 00:00:00 2001
From: Henri Verbeet <hverbeet@codeweavers.com>
Date: Sun, 8 Jan 2017 22:32:32 +0100
Subject: [PATCH] ddraw: Implement ddraw7_FlipToGDISurface. (v2)
---
dlls/ddraw/ddraw.c | 9 ++++++++-
dlls/ddraw/ddraw_private.h | 1 +
dlls/ddraw/surface.c | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index ca8e2e64f7..e18c358c63 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -2093,7 +2093,14 @@ 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;
+
+ if (ddraw->primary)
+ ddraw_surface_update_frontbuffer(ddraw->primary, NULL, FALSE, 0);
return DD_OK;
}
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index b8552af287..4442919a22 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -60,6 +60,7 @@ struct FvfToDecl
#define DDRAW_SCL_DDRAW1 0x00000010
#define DDRAW_SCL_RECURSIVE 0x00000020
#define DDRAW_SWAPPED 0x00000040
+#define DDRAW_GDI_FLIP 0x00000080
#define DDRAW_STRIDE_ALIGNMENT 8
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index cb837b1f90..422081d5f4 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -70,7 +70,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface,
if (w <= 0 || h <= 0)
return DD_OK;
- if (surface->ddraw->swapchain_window)
+ if (surface->ddraw->swapchain_window && !(surface->ddraw->flags & DDRAW_GDI_FLIP))
{
/* Nothing to do, we control the frontbuffer, or at least the parts we
* care about. */
--
2.16.2

View File

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

View File

@ -1,128 +0,0 @@
From 9148a362cb4a728762584e1daf47d8c09c24d9ba Mon Sep 17 00:00:00 2001
From: Gijs Vermeulen <gijsvrm@gmail.com>
Date: Mon, 14 Jan 2019 18:07:35 +0100
Subject: [PATCH] msvcp140: Export _Equivalent and port tests.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46465
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
---
dlls/msvcp140/msvcp140.spec | 2 +-
dlls/msvcp140/tests/msvcp140.c | 69 ++++++++++++++++++++++++++++++++++
2 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec
index 245389e61e..6a4eb14c04 100644
--- a/dlls/msvcp140/msvcp140.spec
+++ b/dlls/msvcp140/msvcp140.spec
@@ -3638,7 +3638,7 @@
@ cdecl _Current_set(wstr) tr2_sys__Current_set_wchar
@ extern _Denorm _Denorm
@ cdecl _Dtest(ptr) _Dtest
-@ stub _Equivalent
+@ cdecl _Equivalent(wstr wstr) tr2_sys__Equivalent_wchar
@ cdecl _Exp(ptr double long) _Exp
@ stub _FCosh
@ extern _FDenorm _FDenorm
diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c
index 5705882c88..2ba809dc50 100644
--- a/dlls/msvcp140/tests/msvcp140.c
+++ b/dlls/msvcp140/tests/msvcp140.c
@@ -176,6 +176,7 @@ static void (__cdecl *p__Release_chore)(_Threadpool_chore*);
static void (__cdecl *p_Close_dir)(void*);
static MSVCP_bool (__cdecl *p_Current_get)(WCHAR *);
static MSVCP_bool (__cdecl *p_Current_set)(WCHAR const *);
+static int (__cdecl *p_Equivalent)(WCHAR const*, WCHAR const*);
static ULONGLONG (__cdecl *p_File_size)(WCHAR const *);
static __int64 (__cdecl *p_Last_write_time)(WCHAR const*);
static void (__cdecl *p_Set_last_write_time)(WCHAR const*, __int64);
@@ -267,6 +268,7 @@ static BOOL init(void)
SET(p_Close_dir, "_Close_dir");
SET(p_Current_get, "_Current_get");
SET(p_Current_set, "_Current_set");
+ SET(p_Equivalent, "_Equivalent");
SET(p_File_size, "_File_size");
SET(p_Last_write_time, "_Last_write_time");
SET(p_Set_last_write_time, "_Set_last_write_time");
@@ -1360,6 +1362,72 @@ static void test__Winerror_map(void)
}
}
+static void test_Equivalent(void)
+{
+ int val, i;
+ HANDLE file;
+ WCHAR temp_path[MAX_PATH], current_path[MAX_PATH];
+ static const WCHAR wine_test_dirW[] =
+ {'w','i','n','e','_','t','e','s','t','_','d','i','r',0};
+ static const WCHAR f1W[] =
+ {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','f','1',0};
+ static const WCHAR f1W_backslash[] =
+ {'w','i','n','e','_','t','e','s','t','_','d','i','r','\\','f','1',0};
+ static const WCHAR f1W_subdir[] =
+ {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','.','/','f','1',0};
+ static const WCHAR f1W_long[] =
+ {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','.','.','/','w','i','n','e','_','t','e','s','t','_','d','i','r','/','f','1',0};
+ static const WCHAR f2W[] =
+ {'w','i','n','e','_','t','e','s','t','_','d','i','r','/','f','2',0};
+ static const WCHAR not_existW[] =
+ {'n','o','t','_','e','x','i','s','t','s','_','f','i','l','e',0};
+ static const struct {
+ const WCHAR *path1;
+ const WCHAR *path2;
+ int equivalent;
+ } tests[] = {
+ { NULL, NULL, -1 },
+ { NULL, f1W, 0 },
+ { f1W, NULL, 0 },
+ { f1W, wine_test_dirW, 0 },
+ { wine_test_dirW, f1W, 0 },
+ { wine_test_dirW, wine_test_dirW, -1 },
+ { f1W_subdir, f2W, 0 },
+ { f1W, f1W, 1 },
+ { not_existW, f1W, 0 },
+ { f1W_backslash, f1W_subdir, 1 },
+ { not_existW, not_existW, -1 },
+ { f1W, not_existW, 0 },
+ { f1W_long, f1W, 1 }
+ };
+
+ memset(current_path, 0, MAX_PATH);
+ GetCurrentDirectoryW(MAX_PATH, current_path);
+ memset(temp_path, 0, MAX_PATH);
+ GetTempPathW(MAX_PATH, temp_path);
+ ok(SetCurrentDirectoryW(temp_path), "SetCurrentDirectoryW to temp_path failed\n");
+ CreateDirectoryW(wine_test_dirW, NULL);
+
+ file = CreateFileW(f1W, 0, 0, NULL, CREATE_ALWAYS, 0, NULL);
+ ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n");
+ CloseHandle(file);
+ file = CreateFileW(f2W, 0, 0, NULL, CREATE_ALWAYS, 0, NULL);
+ ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n");
+ CloseHandle(file);
+
+ for(i=0; i<ARRAY_SIZE(tests); i++) {
+ errno = 0xdeadbeef;
+ val = p_Equivalent(tests[i].path1, tests[i].path2);
+ ok(tests[i].equivalent == val, "_Equivalent(): test %d expect: %d, got %d\n", i+1, tests[i].equivalent, val);
+ ok(errno == 0xdeadbeef, "errno = %d\n", errno);
+ }
+
+ ok(DeleteFileW(f1W), "expect wine_test_dir/f1 to exist\n");
+ ok(DeleteFileW(f2W), "expect wine_test_dir/f2 to exist\n");
+ ok(p_Remove_dir(wine_test_dirW), "expect wine_test_dir to exist\n");
+ ok(SetCurrentDirectoryW(current_path), "SetCurrentDirectoryW failed\n");
+}
+
START_TEST(msvcp140)
{
if(!init()) return;
@@ -1383,5 +1451,6 @@ START_TEST(msvcp140)
test_Last_write_time();
test__Winerror_message();
test__Winerror_map();
+ test_Equivalent();
FreeLibrary(msvcp);
}
--
2.20.1

View File

@ -1 +0,0 @@
Fixes: [46465] msvcp140: Forward _Equivalent to tr2_sys__Equivalent_wchar

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "6b42eae19f3bd9a4f4412fcb21c2f46a4c95bbfd"
echo "f5d7d9cccc941024f1532a9ac23427d07810f337"
}
# Show version information
@ -127,7 +127,6 @@ 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_Silence_FIXMEs="$1"
@ -181,7 +180,6 @@ patch_enable_all ()
enable_msi_MsiGetDatabaseState="$1"
enable_msi_msi_vcl_get_cost="$1"
enable_msidb_Implementation="$1"
enable_msvcp140__Equivalent="$1"
enable_msvcrt_Math_Precision="$1"
enable_msvfw32_ICGetDisplayFormat="$1"
enable_ntdll_APC_Performance="$1"
@ -544,9 +542,6 @@ patch_enable ()
ddraw-Fix_Typos)
enable_ddraw_Fix_Typos="$2"
;;
ddraw-FlipToGDISurface)
enable_ddraw_FlipToGDISurface="$2"
;;
ddraw-IDirect3DTexture2_Load)
enable_ddraw_IDirect3DTexture2_Load="$2"
;;
@ -706,9 +701,6 @@ patch_enable ()
msidb-Implementation)
enable_msidb_Implementation="$2"
;;
msvcp140-_Equivalent)
enable_msvcp140__Equivalent="$2"
;;
msvcrt-Math_Precision)
enable_msvcrt_Math_Precision="$2"
;;
@ -3235,21 +3227,6 @@ 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
(
printf '%s\n' '+ { "Henri Verbeet", "ddraw: Implement ddraw7_FlipToGDISurface.", 2 },';
) >> "$patchlist"
fi
# Patchset ddraw-IDirect3DTexture2_Load
# |
# | Modified files:
@ -4222,21 +4199,6 @@ if test "$enable_msidb_Implementation" -eq 1; then
) >> "$patchlist"
fi
# Patchset msvcp140-_Equivalent
# |
# | This patchset fixes the following Wine bugs:
# | * [#46465] msvcp140: Forward _Equivalent to tr2_sys__Equivalent_wchar
# |
# | Modified files:
# | * dlls/msvcp140/msvcp140.spec, dlls/msvcp140/tests/msvcp140.c
# |
if test "$enable_msvcp140__Equivalent" -eq 1; then
patch_apply msvcp140-_Equivalent/0001-msvcp140-Export-_Equivalent-and-port-tests.patch
(
printf '%s\n' '+ { "Gijs Vermeulen", "msvcp140: Export _Equivalent and port tests.", 1 },';
) >> "$patchlist"
fi
# Patchset msvcrt-Math_Precision
# |
# | This patchset fixes the following Wine bugs: