Michael Stefaniuc : d3dx9: Merge the d3dx_effect_GetAnnotation() helper.
Alexandre Julliard
julliard at winehq.org
Tue Mar 5 15:06:30 CST 2019
Module: wine
Branch: master
Commit: 7a1df2b0069bde1a9a022c6454fb8b3e06181fd0
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7a1df2b0069bde1a9a022c6454fb8b3e06181fd0
Author: Michael Stefaniuc <mstefani at winehq.org>
Date: Mon Mar 4 23:15:58 2019 +0100
d3dx9: Merge the d3dx_effect_GetAnnotation() helper.
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3dx9_36/effect.c | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index dda460d..ea35631 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -1286,25 +1286,6 @@ static UINT get_annotation_from_object(struct d3dx9_base_effect *base,
}
}
-static D3DXHANDLE d3dx9_base_effect_get_annotation(struct d3dx9_base_effect *base,
- D3DXHANDLE object, UINT index)
-{
- struct d3dx_parameter *annotations = NULL;
- UINT annotation_count = 0;
-
- annotation_count = get_annotation_from_object(base, object, &annotations);
-
- if (index < annotation_count)
- {
- TRACE("Returning parameter %p\n", &annotations[index]);
- return get_parameter_handle(&annotations[index]);
- }
-
- WARN("Annotation not found.\n");
-
- return NULL;
-}
-
static D3DXHANDLE d3dx9_base_effect_get_annotation_by_name(struct d3dx9_base_effect *base,
D3DXHANDLE object, const char *name)
{
@@ -3513,10 +3494,22 @@ static D3DXHANDLE WINAPI d3dx_effect_GetFunctionByName(ID3DXEffect *iface, const
static D3DXHANDLE WINAPI d3dx_effect_GetAnnotation(ID3DXEffect *iface, D3DXHANDLE object, UINT index)
{
struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
+ struct d3dx_parameter *annotations = NULL;
+ unsigned int annotation_count;
TRACE("iface %p, object %p, index %u.\n", iface, object, index);
- return d3dx9_base_effect_get_annotation(&effect->base_effect, object, index);
+ annotation_count = get_annotation_from_object(&effect->base_effect, object, &annotations);
+
+ if (index < annotation_count)
+ {
+ TRACE("Returning parameter %p\n", &annotations[index]);
+ return get_parameter_handle(&annotations[index]);
+ }
+
+ WARN("Annotation not found.\n");
+
+ return NULL;
}
static D3DXHANDLE WINAPI d3dx_effect_GetAnnotationByName(ID3DXEffect *iface, D3DXHANDLE object,
More information about the wine-cvs
mailing list