Commit adc1b5a8 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3dx9: Move param_tree out of struct d3dx9_base_effect.

parent 4e2f48ce
......@@ -162,7 +162,6 @@ struct d3dx9_base_effect
ULONG64 version_counter;
struct wine_rb_tree param_tree;
char *full_name_tmp;
unsigned int full_name_tmp_size;
};
......@@ -176,6 +175,7 @@ struct d3dx_effect
unsigned int parameter_count;
unsigned int object_count;
struct d3dx_object *objects;
struct wine_rb_tree param_tree;
struct ID3DXEffectStateManager *manager;
struct IDirect3DDevice9 *device;
......@@ -903,6 +903,7 @@ static struct d3dx_parameter *get_annotation_by_name(struct d3dx_effect *effect,
struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base,
struct d3dx_parameter *parameter, const char *name)
{
struct d3dx_effect *effect = base->effect;
struct d3dx_parameter *temp_parameter;
unsigned int name_len, param_name_len;
unsigned int i, count, length;
......@@ -917,7 +918,7 @@ struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base,
if (!parameter)
{
if ((entry = wine_rb_get(&base->param_tree, name)))
if ((entry = wine_rb_get(&effect->param_tree, name)))
return WINE_RB_ENTRY_VALUE(entry, struct d3dx_parameter, rb_entry);
return NULL;
}
......@@ -946,7 +947,7 @@ struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base,
memcpy(full_name + param_name_len + 1, name, name_len);
full_name[param_name_len + 1 + name_len] = 0;
if ((entry = wine_rb_get(&base->param_tree, full_name)))
if ((entry = wine_rb_get(&effect->param_tree, full_name)))
return WINE_RB_ENTRY_VALUE(entry, struct d3dx_parameter, rb_entry);
return NULL;
}
......@@ -5129,7 +5130,7 @@ static void add_param_to_tree(struct d3dx_effect *effect, struct d3dx_parameter
memcpy(param->full_name, param->name, len);
}
TRACE("Full name is %s.\n", param->full_name);
wine_rb_put(&effect->base_effect.param_tree, param->full_name, &param->rb_entry);
wine_rb_put(&effect->param_tree, param->full_name, &param->rb_entry);
if (is_top_level_parameter(param))
for (i = 0; i < param->top_level_param->annotation_count; ++i)
......@@ -5992,7 +5993,7 @@ static HRESULT d3dx_parse_effect(struct d3dx_effect *effect, const char *data, U
goto err_out;
}
wine_rb_init(&base->param_tree, param_rb_compare);
wine_rb_init(&effect->param_tree, param_rb_compare);
if (effect->parameter_count)
{
base->parameters = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment