From fa608e247a114a266e7eff213d8eda9b2451612a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Mon, 18 Apr 2011 10:57:53 +0200 Subject: [PATCH] d3dx9: Implement ID3DXBaseEffect::GetTechniqueByName(). --- dlls/d3dx9_36/effect.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index f11b755502f..fefb3b45310 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -605,8 +605,28 @@ static D3DXHANDLE WINAPI ID3DXBaseEffectImpl_GetTechnique(ID3DXBaseEffect *iface static D3DXHANDLE WINAPI ID3DXBaseEffectImpl_GetTechniqueByName(ID3DXBaseEffect *iface, LPCSTR name) { struct ID3DXBaseEffectImpl *This = impl_from_ID3DXBaseEffect(iface); + unsigned int i; - FIXME("iface %p, name %s stub\n", This, debugstr_a(name)); + TRACE("iface %p, name %s stub\n", This, debugstr_a(name)); + + if (!name) + { + WARN("Invalid argument specified.\n"); + return NULL; + } + + for (i = 0; i < This->technique_count; ++i) + { + struct d3dx_technique *tech = get_technique_struct(This->technique_handles[i]); + + if (!strcmp(tech->name, name)) + { + TRACE("Returning technique %p\n", This->technique_handles[i]); + return This->technique_handles[i]; + } + } + + WARN("Invalid argument specified.\n"); return NULL; }