https://git.reactos.org/?p=reactos.git;a=commitdiff;h=823786711613a1ef7a50e…
commit 823786711613a1ef7a50ee739460b31c83100371
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Sep 21 22:40:26 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Thu Feb 4 16:37:02 2021 +0100
[WINESYNC] d3dx9: Pass a struct d3dx_effect to the get technique helpers.
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 42839d15e3ec829f939fe1f99ac6b025f64b18de by Michael Stefaniuc
<mstefani(a)winehq.org>
---
dll/directx/wine/d3dx9_36/effect.c | 35 ++++++++++++++++++-----------------
sdk/tools/winesync/d3dx9.cfg | 2 +-
2 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/dll/directx/wine/d3dx9_36/effect.c b/dll/directx/wine/d3dx9_36/effect.c
index fe12d21e5d5..c32b1a57563 100644
--- a/dll/directx/wine/d3dx9_36/effect.c
+++ b/dll/directx/wine/d3dx9_36/effect.c
@@ -457,9 +457,10 @@ static inline D3DXHANDLE get_pass_handle(struct d3dx_pass *pass)
return (D3DXHANDLE)pass;
}
-static struct d3dx_technique *get_technique_by_name(struct d3dx9_base_effect *base, const
char *name)
+static struct d3dx_technique *get_technique_by_name(struct d3dx_effect *effect, const
char *name)
{
- UINT i;
+ struct d3dx9_base_effect *base = &effect->base_effect;
+ unsigned int i;
if (!name) return NULL;
@@ -472,8 +473,9 @@ static struct d3dx_technique *get_technique_by_name(struct
d3dx9_base_effect *ba
return NULL;
}
-static struct d3dx_technique *get_valid_technique(struct d3dx9_base_effect *base,
D3DXHANDLE technique)
+static struct d3dx_technique *get_valid_technique(struct d3dx_effect *effect, D3DXHANDLE
technique)
{
+ struct d3dx9_base_effect *base = &effect->base_effect;
unsigned int i;
for (i = 0; i < base->technique_count; ++i)
@@ -482,7 +484,7 @@ static struct d3dx_technique *get_valid_technique(struct
d3dx9_base_effect *base
return &base->techniques[i];
}
- return get_technique_by_name(base, technique);
+ return get_technique_by_name(effect, technique);
}
static struct d3dx_pass *get_valid_pass(struct d3dx9_base_effect *base, D3DXHANDLE pass)
@@ -1167,7 +1169,7 @@ static unsigned int get_annotation_from_object(struct d3dx_effect
*effect, D3DXH
struct d3dx9_base_effect *base = &effect->base_effect;
struct d3dx_parameter *param = get_valid_parameter(base, object);
struct d3dx_pass *pass = get_valid_pass(base, object);
- struct d3dx_technique *technique = get_valid_technique(base, object);
+ struct d3dx_technique *technique = get_valid_technique(effect, object);
if (pass)
{
@@ -3165,7 +3167,7 @@ static HRESULT WINAPI d3dx_effect_GetTechniqueDesc(ID3DXEffect
*iface, D3DXHANDL
D3DXTECHNIQUE_DESC *desc)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
- struct d3dx_technique *tech = technique ?
get_valid_technique(&effect->base_effect, technique) :
&effect->base_effect.techniques[0];
+ struct d3dx_technique *tech = technique ? get_valid_technique(effect, technique) :
&effect->base_effect.techniques[0];
TRACE("iface %p, technique %p, desc %p.\n", iface, technique, desc);
@@ -3361,7 +3363,7 @@ static D3DXHANDLE WINAPI d3dx_effect_GetTechnique(ID3DXEffect
*iface, UINT index
static D3DXHANDLE WINAPI d3dx_effect_GetTechniqueByName(ID3DXEffect *iface, const char
*name)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
- struct d3dx_technique *tech = get_technique_by_name(&effect->base_effect,
name);
+ struct d3dx_technique *tech = get_technique_by_name(effect, name);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
@@ -3380,7 +3382,7 @@ static D3DXHANDLE WINAPI d3dx_effect_GetTechniqueByName(ID3DXEffect
*iface, cons
static D3DXHANDLE WINAPI d3dx_effect_GetPass(ID3DXEffect *iface, D3DXHANDLE technique,
UINT index)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
- struct d3dx_technique *tech = get_valid_technique(&effect->base_effect,
technique);
+ struct d3dx_technique *tech = get_valid_technique(effect, technique);
TRACE("iface %p, technique %p, index %u.\n", iface, technique, index);
@@ -3398,7 +3400,7 @@ static D3DXHANDLE WINAPI d3dx_effect_GetPass(ID3DXEffect *iface,
D3DXHANDLE tech
static D3DXHANDLE WINAPI d3dx_effect_GetPassByName(ID3DXEffect *iface, D3DXHANDLE
technique, const char *name)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
- struct d3dx_technique *tech = get_valid_technique(&effect->base_effect,
technique);
+ struct d3dx_technique *tech = get_valid_technique(effect, technique);
TRACE("iface %p, technique %p, name %s.\n", iface, technique,
debugstr_a(name));
@@ -3864,15 +3866,14 @@ static HRESULT WINAPI d3dx_effect_GetPool(ID3DXEffect *iface,
ID3DXEffectPool **
static HRESULT WINAPI d3dx_effect_SetTechnique(ID3DXEffect *iface, D3DXHANDLE technique)
{
- struct d3dx_effect *This = impl_from_ID3DXEffect(iface);
- struct d3dx9_base_effect *base = &This->base_effect;
- struct d3dx_technique *tech = get_valid_technique(base, technique);
+ struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
+ struct d3dx_technique *tech = get_valid_technique(effect, technique);
- TRACE("iface %p, technique %p\n", This, technique);
+ TRACE("iface %p, technique %p\n", iface, technique);
if (tech)
{
- This->active_technique = tech;
+ effect->active_technique = tech;
TRACE("Technique %p\n", tech);
return D3D_OK;
}
@@ -3895,7 +3896,7 @@ static HRESULT WINAPI d3dx_effect_ValidateTechnique(ID3DXEffect
*iface, D3DXHAND
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
struct d3dx9_base_effect *base = &effect->base_effect;
- struct d3dx_technique *tech = get_valid_technique(base, technique);
+ struct d3dx_technique *tech = get_valid_technique(effect, technique);
HRESULT ret = D3D_OK;
unsigned int i, j;
@@ -3951,7 +3952,7 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect
*iface, D3D
if (technique)
{
- if (!(prev_tech = get_valid_technique(base, technique)))
+ if (!(prev_tech = get_valid_technique(effect, technique)))
return D3DERR_INVALIDCALL;
for (i = 0; i < base->technique_count; ++i)
@@ -4094,7 +4095,7 @@ static BOOL WINAPI d3dx_effect_IsParameterUsed(ID3DXEffect *iface,
D3DXHANDLE pa
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
struct d3dx_parameter *param = get_valid_parameter(&effect->base_effect,
parameter);
- struct d3dx_technique *tech = get_valid_technique(&effect->base_effect,
technique);
+ struct d3dx_technique *tech = get_valid_technique(effect, technique);
BOOL ret;
TRACE("iface %p, parameter %p, technique %p.\n", iface, parameter,
technique);
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index 3aa09dd319e..89c19b44d97 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: a33b20a0604e29c4b502a0d77e8828e926b09a62}
+tags: {wine: 42839d15e3ec829f939fe1f99ac6b025f64b18de}