https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aa84d04a6692db45ea55b…
commit aa84d04a6692db45ea55bd2caad8087a95a33686
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Sep 21 22:40:25 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Thu Feb 4 16:37:01 2021 +0100
[WINESYNC] d3dx9: Merge the d3dx_effect_GetParameterElement() helper.
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 3899e79fc429b0c668166ccc98efbd60f5c63aa4 by Michael Stefaniuc
<mstefani(a)winehq.org>
---
dll/directx/wine/d3dx9_36/effect.c | 49 ++++++++++++++++----------------------
sdk/tools/winesync/d3dx9.cfg | 2 +-
2 files changed, 22 insertions(+), 29 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c
index f9df86400cc..61baa3b778e 100644
--- a/dll/directx/wine/d3dx9_36/effect.c
+++ b/dll/directx/wine/d3dx9_36/effect.c
@@ -1181,33 +1181,6 @@ static HRESULT d3dx9_base_effect_get_pass_desc(struct
d3dx9_base_effect *base,
return D3D_OK;
}
-static D3DXHANDLE d3dx9_base_effect_get_parameter_element(struct d3dx9_base_effect
*base,
- D3DXHANDLE parameter, UINT index)
-{
- struct d3dx_parameter *param = get_valid_parameter(base, parameter);
-
- if (!param)
- {
- if (index < base->parameter_count)
- {
- TRACE("Returning parameter %p.\n",
&base->parameters[index]);
- return get_parameter_handle(&base->parameters[index].param);
- }
- }
- else
- {
- if (index < param->element_count)
- {
- TRACE("Returning parameter %p.\n", ¶m->members[index]);
- return get_parameter_handle(¶m->members[index]);
- }
- }
-
- WARN("Parameter not found.\n");
-
- return NULL;
-}
-
static D3DXHANDLE d3dx9_base_effect_get_technique(struct d3dx9_base_effect *base, UINT
index)
{
if (index >= base->technique_count)
@@ -3467,10 +3440,30 @@ static D3DXHANDLE WINAPI
d3dx_effect_GetParameterBySemantic(ID3DXEffect *iface,
static D3DXHANDLE WINAPI d3dx_effect_GetParameterElement(ID3DXEffect *iface, D3DXHANDLE
parameter, UINT index)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
+ struct d3dx_parameter *param = get_valid_parameter(&effect->base_effect,
parameter);
TRACE("iface %p, parameter %p, index %u.\n", iface, parameter, index);
- return d3dx9_base_effect_get_parameter_element(&effect->base_effect,
parameter, index);
+ if (!param)
+ {
+ if (index < effect->base_effect.parameter_count)
+ {
+ TRACE("Returning parameter %p.\n",
&effect->base_effect.parameters[index]);
+ return
get_parameter_handle(&effect->base_effect.parameters[index].param);
+ }
+ }
+ else
+ {
+ if (index < param->element_count)
+ {
+ TRACE("Returning parameter %p.\n", ¶m->members[index]);
+ return get_parameter_handle(¶m->members[index]);
+ }
+ }
+
+ WARN("Parameter not found.\n");
+
+ return NULL;
}
static D3DXHANDLE WINAPI d3dx_effect_GetTechnique(ID3DXEffect *iface, UINT index)
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index a2f4dcbeb65..d497f60f37a 100644
--- a/sdk/tools/winesync/d3dx9.cfg
+++ b/sdk/tools/winesync/d3dx9.cfg
@@ -15,4 +15,4 @@ files: {include/d3dx9.h: sdk/include/dxsdk/d3dx9.h, include/d3dx9anim.h:
sdk/inc
include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h:
sdk/include/dxsdk/d3dx9of.h,
include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h:
sdk/include/dxsdk/d3dx9shape.h,
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h:
sdk/include/dxsdk/d3dx9xof.h}
-tags: {wine: 04c838fa605fe586e850b4ef2dd4f9f80d5daa2e}
+tags: {wine: 3899e79fc429b0c668166ccc98efbd60f5c63aa4}