https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6e7150ee67bd0d8e41a48…
commit 6e7150ee67bd0d8e41a48999dc255d9334082b9e
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Wed Feb 5 22:11:38 2020 +0100
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Wed Feb 26 18:19:18 2020 +0100
[WINESYNC] d3dx9_36: Add support for FOURCC surface to save_dds_surface_to_memory.
wine-staging patch by Christian Costa <titan.costa(a)gmail.com>
---
dll/directx/wine/d3dx9_36/surface.c | 8 ++++++++
..._FOURCC_surface_to_save_dds_surface_to_memory.diff | 19 +++++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/dll/directx/wine/d3dx9_36/surface.c b/dll/directx/wine/d3dx9_36/surface.c
index 01729ea9a60..185d4f44c0d 100644
--- a/dll/directx/wine/d3dx9_36/surface.c
+++ b/dll/directx/wine/d3dx9_36/surface.c
@@ -395,6 +395,14 @@ static HRESULT d3dformat_to_dds_pixel_format(struct dds_pixel_format
*pixel_form
}
}
+ /* Reuse dds_fourcc_to_d3dformat as D3DFORMAT and FOURCC are DWORD with same values
*/
+ if (dds_fourcc_to_d3dformat(d3dformat) != D3DFMT_UNKNOWN)
+ {
+ pixel_format->flags |= DDS_PF_FOURCC;
+ pixel_format->fourcc = d3dformat;
+ return D3D_OK;
+ }
+
WARN("Unknown pixel format %#x\n", d3dformat);
return E_NOTIMPL;
}
diff --git
a/sdk/tools/winesync/d3dx9_staging/0012-d3dx9_36__Add_support_for_FOURCC_surface_to_save_dds_surface_to_memory.diff
b/sdk/tools/winesync/d3dx9_staging/0012-d3dx9_36__Add_support_for_FOURCC_surface_to_save_dds_surface_to_memory.diff
new file mode 100644
index 00000000000..b1a114bf1b1
--- /dev/null
+++
b/sdk/tools/winesync/d3dx9_staging/0012-d3dx9_36__Add_support_for_FOURCC_surface_to_save_dds_surface_to_memory.diff
@@ -0,0 +1,19 @@
+diff --git a/dll/directx/wine/d3dx9_36/surface.c b/dll/directx/wine/d3dx9_36/surface.c
+index 01729ea..185d4f4 100644
+--- a/dll/directx/wine/d3dx9_36/surface.c
++++ b/dll/directx/wine/d3dx9_36/surface.c
+@@ -395,6 +395,14 @@ static HRESULT d3dformat_to_dds_pixel_format(struct dds_pixel_format
*pixel_form
+ }
+ }
+
++ /* Reuse dds_fourcc_to_d3dformat as D3DFORMAT and FOURCC are DWORD with same values
*/
++ if (dds_fourcc_to_d3dformat(d3dformat) != D3DFMT_UNKNOWN)
++ {
++ pixel_format->flags |= DDS_PF_FOURCC;
++ pixel_format->fourcc = d3dformat;
++ return D3D_OK;
++ }
++
+ WARN("Unknown pixel format %#x\n", d3dformat);
+ return E_NOTIMPL;
+ }