Sebastian Lackner : d3dx9: Adjust ID3DXEffect interface based on DLL version.

Alexandre Julliard julliard at winehq.org
Mon May 14 06:54:24 CDT 2018


Module: wine
Branch: stable
Commit: 6f28ed8b64d2907a1b1e31b61fd6f49f9dafb6ff
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6f28ed8b64d2907a1b1e31b61fd6f49f9dafb6ff

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Tue Mar 13 22:56:10 2018 -0600

d3dx9: Adjust ID3DXEffect interface based on DLL version.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 1c8c9308e74abe5e5d85dfe722dea10e60092e7c)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/d3dx9_36/effect.c |  8 ++++++++
 include/d3dx9effect.h  | 13 ++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index f8c4803..bd1a9e1 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 D3DX_SDK_VERSION >= 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)
@@ -4370,6 +4372,7 @@ static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect *iface,
     return E_NOTIMPL;
 }
 
+#if D3DX_SDK_VERSION >= 27
 static HRESULT WINAPI ID3DXEffectImpl_SetRawValue(ID3DXEffect *iface,
         D3DXHANDLE parameter, const void *data, UINT byte_offset, UINT bytes)
 {
@@ -4378,6 +4381,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetRawValue(ID3DXEffect *iface,
 
     return E_NOTIMPL;
 }
+#endif
 
 static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl =
 {
@@ -4460,9 +4464,13 @@ static const struct ID3DXEffectVtbl ID3DXEffect_Vtbl =
     ID3DXEffectImpl_BeginParameterBlock,
     ID3DXEffectImpl_EndParameterBlock,
     ID3DXEffectImpl_ApplyParameterBlock,
+#if D3DX_SDK_VERSION >= 26
     ID3DXEffectImpl_DeleteParameterBlock,
+#endif
     ID3DXEffectImpl_CloneEffect,
+#if D3DX_SDK_VERSION >= 27
     ID3DXEffectImpl_SetRawValue
+#endif
 };
 
 static inline struct ID3DXEffectCompilerImpl *impl_from_ID3DXEffectCompiler(ID3DXEffectCompiler *iface)
diff --git a/include/d3dx9effect.h b/include/d3dx9effect.h
index 8235794..5dd1e75 100644
--- a/include/d3dx9effect.h
+++ b/include/d3dx9effect.h
@@ -197,7 +197,13 @@ DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
 
 typedef struct ID3DXEffect *LPD3DXEFFECT;
 
-DEFINE_GUID(IID_ID3DXEffect, 0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5);
+#if D3DX_SDK_VERSION <= 25
+DEFINE_GUID(IID_ID3DXEffect, 0xd165ccb1, 0x62b0, 0x4a33, 0xb3, 0xfa, 0xa9, 0x23, 0x00, 0x30, 0x5a, 0x11);
+#elif D3DX_SDK_VERSION == 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, 0x0c, 0xd5);
+#endif
 
 #define INTERFACE ID3DXEffect
 
@@ -282,10 +288,15 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
     STDMETHOD(BeginParameterBlock)(THIS) PURE;
     STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE;
     STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE parameter_block) PURE;
+#if D3DX_SDK_VERSION >= 26
     STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE parameter_block) PURE;
+#endif
     STDMETHOD(CloneEffect)(THIS_ struct IDirect3DDevice9 *device, struct ID3DXEffect **effect) PURE;
+#if D3DX_SDK_VERSION >= 27
     STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE parameter, const void *data, UINT byte_offset, UINT bytes) PURE;
+#endif
 };
+
 #undef INTERFACE
 
 typedef struct ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER;




More information about the wine-cvs mailing list