Re: [PATCH 3/4] d3dx9: Improve ID3DXConstantTable::Set*().
Rico Schüller <kgbricola(a)web.de> writes:
+static UINT set(struct ID3DXConstantTableImpl *table, IDirect3DDevice9 *device, struct ctab_constant *constant, + const void **indata, D3DXPARAMETER_TYPE intype, UINT *size, UINT incol, D3DXPARAMETER_CLASS inclass, UINT index, + BOOL is_pointer) +{ + DWORD (*get_index)(const void **indata, UINT index) = NULL; + D3DXCONSTANT_DESC *desc = &constant->desc; + UINT l, i, regcount = 1, regsize = 1, cin = 1, rin = 1, ret, last = 0; + DWORD tmp; + + if (is_pointer) get_index = &get_index_pointer; + else get_index = &get_index_array;
It would be cleaner and easier to follow to have a simple helper with a is_pointer flag, rather than using function pointers with such trivial functions. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard