2009/8/21 Rico Schüller kgbricola@web.de:
- if( index < This->local_buffer_variable_count )
Please use consistent style.
for (i = 0; i < This->local_buffer_count; ++i)
{
struct d3d10_effect_local_buffer *l = &This->local_buffers[i];
unsigned int j;
for (j = 0; j < l->variable_count; ++j)
{
struct d3d10_effect_variable *v = &l->variables[j];
if (nr == index)
{
TRACE("Returning variable %p.\n", v);
return (ID3D10EffectVariable *)v;
}
nr++;
}
}
This is unnecessary, you can just keep subtracting "l->variable_count" from "index" until "l->variable_count > index", at which point "index" should have the right value to index "l->variables".