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

Matteo Bruni matteo.mystral at gmail.com
Tue Mar 13 13:46:38 CDT 2018


2018-03-13 6:36 GMT+01:00 Alex Henrie <alexhenrie24 at gmail.com>:
> 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

You should simply use the already existing (and "official")
D3DX_SDK_VERSION define instead.

>  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
>  };
>

Were you able to find any source for this, aside from Rico's comment 4
in bug 25138?
Not a deal breaker if not, but it would be a "nice to have".

> diff --git a/include/d3dx9effect.h b/include/d3dx9effect.h
> index 8235794a31..83e19cfe53 100644
> --- a/include/d3dx9effect.h
> +++ b/include/d3dx9effect.h
> @@ -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
>  };
> +

You can get rid of the !defined() part (after switching to D3DX_SDK_VERSION).



More information about the wine-devel mailing list