From 9fdd548d2e7b2c2e6880b4c1a4085c1b534555ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rico=20Sch=C3=BCller?= Date: Thu, 1 Oct 2009 11:55:33 +0200 Subject: [PATCH] d3d10: Implement ID3D10EffectVariable::GetMemberByName(). --- dlls/d3d10/effect.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index b203baa631b..3ae448fd877 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -1997,9 +1997,34 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_Get static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByName( ID3D10EffectVariable *iface, LPCSTR name) { - FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + struct d3d10_effect_variable *This = (struct d3d10_effect_variable *)iface; + unsigned int i; - return NULL; + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + if (!name) + { + WARN("Invalid name specified\n"); + return (ID3D10EffectVariable *)&null_variable; + } + + for (i = 0; i < This->type->member_count; ++i) + { + struct d3d10_effect_variable *m = &This->members[i]; + + if (m->name) + { + if (!strcmp(m->name, name)) + { + TRACE("Returning member %p\n", m); + return (ID3D10EffectVariable *)m; + } + } + } + + WARN("Invalid name specified\n"); + + return (ID3D10EffectVariable *)&null_variable; } static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberBySemantic(