20 Jan
2011
20 Jan
'11
3:27 p.m.
2011/1/20 Travis Athougies <iammisc(a)gmail.com>:
+ /* D3DXMATRIX is a union, one of whose elements is an array, so it can be cast to a float pointer */ + if (is_vertex_shader(This->desc.Version)) + IDirect3DDevice9_SetVertexShaderConstantF(device, desc.RegisterIndex + i, (float *)(matrix + i), + desc.RegisterCount); + else + IDirect3DDevice9_SetPixelShaderConstantF(device, desc.RegisterIndex + i, (float *)(matrix + i), + desc.RegisterCount);
Can't you just pass matrix->m[i] as parameter, instead of that cast?