d3dx9: Merge the d3dx_effect_GetTechnique() helper.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2019-03-04 23:16:05 +01:00 committed by Alexandre Julliard
parent a2e0046fc5
commit a33b20a060
1 changed files with 9 additions and 14 deletions

View File

@ -1157,19 +1157,6 @@ static HRESULT d3dx9_base_effect_get_pass_desc(struct d3dx9_base_effect *base,
return D3D_OK;
}
static D3DXHANDLE d3dx9_base_effect_get_technique(struct d3dx9_base_effect *base, UINT index)
{
if (index >= base->technique_count)
{
WARN("Invalid argument specified.\n");
return NULL;
}
TRACE("Returning technique %p.\n", &base->techniques[index]);
return get_technique_handle(&base->techniques[index]);
}
static unsigned int get_annotation_from_object(struct d3dx_effect *effect, D3DXHANDLE object,
struct d3dx_parameter **annotations)
{
@ -3356,7 +3343,15 @@ static D3DXHANDLE WINAPI d3dx_effect_GetTechnique(ID3DXEffect *iface, UINT index
TRACE("iface %p, index %u.\n", iface, index);
return d3dx9_base_effect_get_technique(&effect->base_effect, index);
if (index >= effect->base_effect.technique_count)
{
WARN("Invalid argument specified.\n");
return NULL;
}
TRACE("Returning technique %p.\n", &effect->base_effect.techniques[index]);
return get_technique_handle(&effect->base_effect.techniques[index]);
}
static D3DXHANDLE WINAPI d3dx_effect_GetTechniqueByName(ID3DXEffect *iface, const char *name)