https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c45448a2ef1032c5e693a…
commit c45448a2ef1032c5e693a1ab40717c2e74d39ee6
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_GetParameterBySemantic() 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 04c838fa605fe586e850b4ef2dd4f9f80d5daa2e by Michael Stefaniuc
<mstefani(a)winehq.org>
---
dll/directx/wine/d3dx9_36/effect.c | 113 +++++++++++++++++--------------------
sdk/tools/winesync/d3dx9.cfg | 2 +-
2 files changed, 54 insertions(+), 61 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c
index c3ee6791911..f9df86400cc 100644
--- a/dll/directx/wine/d3dx9_36/effect.c
+++ b/dll/directx/wine/d3dx9_36/effect.c
@@ -1181,65 +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_by_semantic(struct d3dx9_base_effect
*base,
- D3DXHANDLE parameter, const char *semantic)
-{
- struct d3dx_parameter *param = get_valid_parameter(base, parameter);
- struct d3dx_parameter *temp_param;
- UINT i;
-
- if (!parameter)
- {
- for (i = 0; i < base->parameter_count; ++i)
- {
- temp_param = &base->parameters[i].param;
-
- if (!temp_param->semantic)
- {
- if (!semantic)
- {
- TRACE("Returning parameter %p\n", temp_param);
- return get_parameter_handle(temp_param);
- }
- continue;
- }
-
- if (!strcasecmp(temp_param->semantic, semantic))
- {
- TRACE("Returning parameter %p\n", temp_param);
- return get_parameter_handle(temp_param);
- }
- }
- }
- else if (param)
- {
- for (i = 0; i < param->member_count; ++i)
- {
- temp_param = ¶m->members[i];
-
- if (!temp_param->semantic)
- {
- if (!semantic)
- {
- TRACE("Returning parameter %p\n", temp_param);
- return get_parameter_handle(temp_param);
- }
- continue;
- }
-
- if (!strcasecmp(temp_param->semantic, semantic))
- {
- TRACE("Returning parameter %p\n", temp_param);
- return get_parameter_handle(temp_param);
- }
- }
- }
-
- WARN("Parameter not found.\n");
-
- return NULL;
-}
-
static D3DXHANDLE d3dx9_base_effect_get_parameter_element(struct d3dx9_base_effect
*base,
D3DXHANDLE parameter, UINT index)
{
@@ -3465,10 +3406,62 @@ static D3DXHANDLE WINAPI
d3dx_effect_GetParameterBySemantic(ID3DXEffect *iface,
const char *semantic)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
+ struct d3dx_parameter *param = get_valid_parameter(&effect->base_effect,
parameter);
+ struct d3dx_parameter *temp_param;
+ unsigned int i;
TRACE("iface %p, parameter %p, semantic %s.\n", iface, parameter,
debugstr_a(semantic));
- return d3dx9_base_effect_get_parameter_by_semantic(&effect->base_effect,
parameter, semantic);
+ if (!parameter)
+ {
+ for (i = 0; i < effect->base_effect.parameter_count; ++i)
+ {
+ temp_param = &effect->base_effect.parameters[i].param;
+
+ if (!temp_param->semantic)
+ {
+ if (!semantic)
+ {
+ TRACE("Returning parameter %p\n", temp_param);
+ return get_parameter_handle(temp_param);
+ }
+ continue;
+ }
+
+ if (!strcasecmp(temp_param->semantic, semantic))
+ {
+ TRACE("Returning parameter %p\n", temp_param);
+ return get_parameter_handle(temp_param);
+ }
+ }
+ }
+ else if (param)
+ {
+ for (i = 0; i < param->member_count; ++i)
+ {
+ temp_param = ¶m->members[i];
+
+ if (!temp_param->semantic)
+ {
+ if (!semantic)
+ {
+ TRACE("Returning parameter %p\n", temp_param);
+ return get_parameter_handle(temp_param);
+ }
+ continue;
+ }
+
+ if (!strcasecmp(temp_param->semantic, semantic))
+ {
+ TRACE("Returning parameter %p\n", temp_param);
+ return get_parameter_handle(temp_param);
+ }
+ }
+ }
+
+ WARN("Parameter not found.\n");
+
+ return NULL;
}
static D3DXHANDLE WINAPI d3dx_effect_GetParameterElement(ID3DXEffect *iface, D3DXHANDLE
parameter, UINT index)
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index 0d15ede72e0..a2f4dcbeb65 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: 2f1ba910d133b93a3da55de4d0b3577936fd8224}
+tags: {wine: 04c838fa605fe586e850b4ef2dd4f9f80d5daa2e}