[PATCH] d3dx9_*: Adjust ID3DXEffect interface based on DLL version

Alex Henrie alexhenrie24 at gmail.com
Tue Mar 13 00:36:16 CDT 2018


From: Sebastian Lackner <sebastian at fds-team.de>

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
Fixes https://bugs.winehq.org/show_bug.cgi?id=25138

Patch from Wine Staging.

 dlls/d3dx9_24/Makefile.in |  1 +
 dlls/d3dx9_25/Makefile.in |  1 +
 dlls/d3dx9_26/Makefile.in |  1 +
 dlls/d3dx9_27/Makefile.in |  1 +
 dlls/d3dx9_28/Makefile.in |  1 +
 dlls/d3dx9_29/Makefile.in |  1 +
 dlls/d3dx9_30/Makefile.in |  1 +
 dlls/d3dx9_31/Makefile.in |  1 +
 dlls/d3dx9_32/Makefile.in |  1 +
 dlls/d3dx9_33/Makefile.in |  1 +
 dlls/d3dx9_34/Makefile.in |  1 +
 dlls/d3dx9_35/Makefile.in |  1 +
 dlls/d3dx9_36/Makefile.in |  1 +
 dlls/d3dx9_36/effect.c    |  8 ++++++++
 dlls/d3dx9_37/Makefile.in |  1 +
 dlls/d3dx9_38/Makefile.in |  1 +
 dlls/d3dx9_39/Makefile.in |  1 +
 dlls/d3dx9_40/Makefile.in |  1 +
 dlls/d3dx9_41/Makefile.in |  1 +
 dlls/d3dx9_42/Makefile.in |  1 +
 dlls/d3dx9_43/Makefile.in |  1 +
 include/d3dx9effect.h     | 12 ++++++++++++
 22 files changed, 40 insertions(+)

diff --git a/dlls/d3dx9_24/Makefile.in b/dlls/d3dx9_24/Makefile.in
index 482c92d64e..6810b7963c 100644
--- a/dlls/d3dx9_24/Makefile.in
+++ b/dlls/d3dx9_24/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=24
 MODULE    = d3dx9_24.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=24
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_25/Makefile.in b/dlls/d3dx9_25/Makefile.in
index be4c76980e..ba16d3d6b0 100644
--- a/dlls/d3dx9_25/Makefile.in
+++ b/dlls/d3dx9_25/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=25
 MODULE    = d3dx9_25.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=25
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_26/Makefile.in b/dlls/d3dx9_26/Makefile.in
index c5e9e85bfb..dffc238836 100644
--- a/dlls/d3dx9_26/Makefile.in
+++ b/dlls/d3dx9_26/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=26
 MODULE    = d3dx9_26.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=26
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_27/Makefile.in b/dlls/d3dx9_27/Makefile.in
index ee7f0e2449..a4223086b7 100644
--- a/dlls/d3dx9_27/Makefile.in
+++ b/dlls/d3dx9_27/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=27
 MODULE    = d3dx9_27.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=27
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_28/Makefile.in b/dlls/d3dx9_28/Makefile.in
index 094420013d..73e486f220 100644
--- a/dlls/d3dx9_28/Makefile.in
+++ b/dlls/d3dx9_28/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=28
 MODULE    = d3dx9_28.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=28
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_29/Makefile.in b/dlls/d3dx9_29/Makefile.in
index 88cb110ff5..5c3cf37c81 100644
--- a/dlls/d3dx9_29/Makefile.in
+++ b/dlls/d3dx9_29/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=29
 MODULE    = d3dx9_29.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=29
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_30/Makefile.in b/dlls/d3dx9_30/Makefile.in
index 6ab2ff2451..285ae2c94d 100644
--- a/dlls/d3dx9_30/Makefile.in
+++ b/dlls/d3dx9_30/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=30
 MODULE    = d3dx9_30.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=30
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_31/Makefile.in b/dlls/d3dx9_31/Makefile.in
index 3d44da147d..bc66d2f2d1 100644
--- a/dlls/d3dx9_31/Makefile.in
+++ b/dlls/d3dx9_31/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=31
 MODULE    = d3dx9_31.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=31
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_32/Makefile.in b/dlls/d3dx9_32/Makefile.in
index 37cc2797af..a4a9ecb5f4 100644
--- a/dlls/d3dx9_32/Makefile.in
+++ b/dlls/d3dx9_32/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=32
 MODULE    = d3dx9_32.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=32
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_33/Makefile.in b/dlls/d3dx9_33/Makefile.in
index 5b03ec134d..32a78c3e50 100644
--- a/dlls/d3dx9_33/Makefile.in
+++ b/dlls/d3dx9_33/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=33
 MODULE    = d3dx9_33.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=33
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_34/Makefile.in b/dlls/d3dx9_34/Makefile.in
index b7f9c46d5e..714518eab5 100644
--- a/dlls/d3dx9_34/Makefile.in
+++ b/dlls/d3dx9_34/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=34
 MODULE    = d3dx9_34.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=34
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_35/Makefile.in b/dlls/d3dx9_35/Makefile.in
index 9c196ea038..0a1b681069 100644
--- a/dlls/d3dx9_35/Makefile.in
+++ b/dlls/d3dx9_35/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=35
 MODULE    = d3dx9_35.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=35
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in
index da8098dd8d..6bb605d36f 100644
--- a/dlls/d3dx9_36/Makefile.in
+++ b/dlls/d3dx9_36/Makefile.in
@@ -2,6 +2,7 @@ EXTRADEFS = -DD3DX_SDK_VERSION=36
 MODULE    = d3dx9_36.dll
 IMPORTLIB = d3dx9
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=36
 
 C_SRCS = \
 	animation.c \
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index a98495e555..965caa85b5 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -4351,6 +4351,7 @@ static HRESULT WINAPI ID3DXEffectImpl_ApplyParameterBlock(ID3DXEffect* iface, D3
     return E_NOTIMPL;
 }
 
+#if _D3DX9_VER >= 26
 static HRESULT WINAPI ID3DXEffectImpl_DeleteParameterBlock(ID3DXEffect* iface, D3DXHANDLE parameter_block)
 {
     struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface);
@@ -4359,6 +4360,7 @@ static HRESULT WINAPI ID3DXEffectImpl_DeleteParameterBlock(ID3DXEffect* iface, D
 
     return E_NOTIMPL;
 }
+#endif
 
 static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect *iface,
         struct IDirect3DDevice9 *device, struct ID3DXEffect **effect)
@@ -4379,6 +4381,7 @@ static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect *iface,
     return E_NOTIMPL;
 }
 
+#if _D3DX9_VER >= 27
 static HRESULT WINAPI ID3DXEffectImpl_SetRawValue(ID3DXEffect *iface,
         D3DXHANDLE parameter, const void *data, UINT byte_offset, UINT bytes)
 {
@@ -4387,6 +4390,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetRawValue(ID3DXEffect *iface,
 
     return E_NOTIMPL;
 }
+#endif
 
 static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl =
 {
@@ -4469,9 +4473,13 @@ static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl =
     ID3DXEffectImpl_BeginParameterBlock,
     ID3DXEffectImpl_EndParameterBlock,
     ID3DXEffectImpl_ApplyParameterBlock,
+#if _D3DX9_VER >= 26
     ID3DXEffectImpl_DeleteParameterBlock,
+#endif
     ID3DXEffectImpl_CloneEffect,
+#if _D3DX9_VER >= 27
     ID3DXEffectImpl_SetRawValue
+#endif
 };
 
 static inline struct ID3DXEffectCompilerImpl *impl_from_ID3DXEffectCompiler(ID3DXEffectCompiler *iface)
diff --git a/dlls/d3dx9_37/Makefile.in b/dlls/d3dx9_37/Makefile.in
index ab790a4d5c..01df6b40a1 100644
--- a/dlls/d3dx9_37/Makefile.in
+++ b/dlls/d3dx9_37/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=37
 MODULE    = d3dx9_37.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=37
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_38/Makefile.in b/dlls/d3dx9_38/Makefile.in
index 6125c2da67..089abd5b25 100644
--- a/dlls/d3dx9_38/Makefile.in
+++ b/dlls/d3dx9_38/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=38
 MODULE    = d3dx9_38.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=38
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_39/Makefile.in b/dlls/d3dx9_39/Makefile.in
index d97a787c67..21071cc1e1 100644
--- a/dlls/d3dx9_39/Makefile.in
+++ b/dlls/d3dx9_39/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=39
 MODULE    = d3dx9_39.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=39
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_40/Makefile.in b/dlls/d3dx9_40/Makefile.in
index 36c5a210cd..6f08759abe 100644
--- a/dlls/d3dx9_40/Makefile.in
+++ b/dlls/d3dx9_40/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=40
 MODULE    = d3dx9_40.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=40
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_41/Makefile.in b/dlls/d3dx9_41/Makefile.in
index d4552cf608..9c1baab924 100644
--- a/dlls/d3dx9_41/Makefile.in
+++ b/dlls/d3dx9_41/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=41
 MODULE    = d3dx9_41.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=41
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_42/Makefile.in b/dlls/d3dx9_42/Makefile.in
index 5806fce66c..a843d1b3db 100644
--- a/dlls/d3dx9_42/Makefile.in
+++ b/dlls/d3dx9_42/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=42
 MODULE    = d3dx9_42.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=42
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/dlls/d3dx9_43/Makefile.in b/dlls/d3dx9_43/Makefile.in
index 72ba8b4c1e..d0f1b9f8dd 100644
--- a/dlls/d3dx9_43/Makefile.in
+++ b/dlls/d3dx9_43/Makefile.in
@@ -1,6 +1,7 @@
 EXTRADEFS = -DD3DX_SDK_VERSION=43
 MODULE    = d3dx9_43.dll
 IMPORTS   = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32
+EXTRADEFS = -D_D3DX9_VER=43
 PARENTSRC = ../d3dx9_36
 
 C_SRCS = \
diff --git a/include/d3dx9effect.h b/include/d3dx9effect.h
index 8235794a31..83e19cfe53 100644
--- a/include/d3dx9effect.h
+++ b/include/d3dx9effect.h
@@ -1,5 +1,6 @@
 /*
  * Copyright 2010 Christian Costa
+ * Copyright 2015 Sebastian Lackner
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -197,7 +198,13 @@ DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
 
 typedef struct ID3DXEffect *LPD3DXEFFECT;
 
+#if defined(_D3DX9_VER) && _D3DX9_VER <= 25
+DEFINE_GUID(IID_ID3DXEffect, 0xd165ccb1, 0x62b0, 0x4a33, 0xb3, 0xfa, 0xa9, 0x23, 0x0, 0x30, 0x5a, 0x11);
+#elif defined(_D3DX9_VER) && _D3DX9_VER == 26
+DEFINE_GUID(IID_ID3DXEffect, 0xc7b17651, 0x5420, 0x490e, 0x8a, 0x7f, 0x92, 0x36, 0x75, 0xa2, 0xd6, 0x87);
+#else
 DEFINE_GUID(IID_ID3DXEffect, 0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5);
+#endif
 
 #define INTERFACE ID3DXEffect
 
@@ -282,10 +289,15 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
     STDMETHOD(BeginParameterBlock)(THIS) PURE;
     STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE;
     STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE parameter_block) PURE;
+#if !defined(_D3DX9_VER) || _D3DX9_VER >= 26
     STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE parameter_block) PURE;
+#endif
     STDMETHOD(CloneEffect)(THIS_ struct IDirect3DDevice9 *device, struct ID3DXEffect **effect) PURE;
+#if !defined(_D3DX9_VER) || _D3DX9_VER >= 27
     STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE parameter, const void *data, UINT byte_offset, UINT bytes) PURE;
+#endif
 };
+
 #undef INTERFACE
 
 typedef struct ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER;
-- 
2.16.2




More information about the wine-devel mailing list