2016-03-10 14:51 GMT+01:00 Paul Gofman <gofmanp(a)gmail.com>:
+ unsigned i, j;
We usually avoid the bare "unsigned".
+ for (i = 0; i < parameters_count; i++) + if (params[i] && params[i]->class == D3DXPC_OBJECT && params[i]->type == D3DXPT_SAMPLER) + { + struct d3dx_sampler *sampler; + + sampler = (struct d3dx_sampler *)params[i]->data; + TRACE("sampler %s, register index %u, state count %u.\n", params[i]->name, + cdesc[i].RegisterIndex, sampler->state_count); + for (j = 0; j < sampler->state_count; j++) + { + hr = d3dx9_apply_state(effect, pass, &sampler->states[j], + cdesc[i].RegisterIndex + (vs ? D3DVERTEXTEXTURESAMPLER0 : 0)); + if (FAILED(hr)) + ret = hr; + } + }
It's better to add brackets to the for, for greater clarity.