d3d10: Implement ID3D10EffectVariable::GetAnnotationByName().
authorRico Schüller <kgbricola@web.de>
Wed, 9 Sep 2009 17:17:33 +0000 (19:17 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 10 Sep 2009 10:20:11 +0000 (12:20 +0200)
dlls/d3d10/effect.c

index ba9c6948448d33cf7df1a00096244bf1690c22e7..d0f24d451b3bbd37217af40385a5f20ae63524fa 100644 (file)
@@ -1701,9 +1701,24 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_Get
 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetAnnotationByName(
         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));
+
+    for (i = 0; i < This->annotation_count; ++i)
+    {
+        struct d3d10_effect_variable *a = &This->annotations[i];
+        if (!strcmp(a->name, name))
+        {
+            TRACE("Returning annotation %p\n", a);
+            return (ID3D10EffectVariable *)a;
+        }
+    }
+
+    WARN("Invalid name specified\n");
+
+    return (ID3D10EffectVariable *)&null_variable;
 }
 
 static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_variable_GetMemberByIndex(