wined3d: Get rid of the WINED3DMATRIX typedef.

This commit is contained in:
Henri Verbeet 2011-11-17 20:11:41 +01:00 committed by Alexandre Julliard
parent 8e6f5c34a2
commit 37a0f7ad65
9 changed files with 49 additions and 43 deletions

View File

@ -1231,9 +1231,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(IDirect3DDevice8 *iface,
TRACE("iface %p, state %#x, matrix %p.\n", iface, State, lpMatrix);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_set_transform(This->wined3d_device, State, (const WINED3DMATRIX *)lpMatrix);
hr = wined3d_device_set_transform(This->wined3d_device, State, (const struct wined3d_matrix *)lpMatrix);
wined3d_mutex_unlock();
return hr;
@ -1247,9 +1247,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetTransform(IDirect3DDevice8 *iface,
TRACE("iface %p, state %#x, matrix %p.\n", iface, State, pMatrix);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_get_transform(This->wined3d_device, State, (WINED3DMATRIX *)pMatrix);
hr = wined3d_device_get_transform(This->wined3d_device, State, (struct wined3d_matrix *)pMatrix);
wined3d_mutex_unlock();
return hr;
@ -1263,9 +1263,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_MultiplyTransform(IDirect3DDevice8 *i
TRACE("iface %p, state %#x, matrix %p.\n", iface, State, pMatrix);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_multiply_transform(This->wined3d_device, State, (const WINED3DMATRIX *)pMatrix);
hr = wined3d_device_multiply_transform(This->wined3d_device, State, (const struct wined3d_matrix *)pMatrix);
wined3d_mutex_unlock();
return hr;

View File

@ -1249,9 +1249,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetTransform(IDirect3DDevice9Ex *ifac
TRACE("iface %p, state %#x, matrix %p.\n", iface, State, lpMatrix);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_set_transform(This->wined3d_device, State, (const WINED3DMATRIX *)lpMatrix);
hr = wined3d_device_set_transform(This->wined3d_device, State, (const struct wined3d_matrix *)lpMatrix);
wined3d_mutex_unlock();
return hr;
@ -1265,9 +1265,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetTransform(IDirect3DDevice9Ex *ifac
TRACE("iface %p, state %#x, matrix %p.\n", iface, State, pMatrix);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_get_transform(This->wined3d_device, State, (WINED3DMATRIX *)pMatrix);
hr = wined3d_device_get_transform(This->wined3d_device, State, (struct wined3d_matrix *)pMatrix);
wined3d_mutex_unlock();
return hr;
@ -1281,9 +1281,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_MultiplyTransform(IDirect3DDevice9Ex
TRACE("iface %p, state %#x, matrix %p.\n", iface, State, pMatrix);
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_multiply_transform(This->wined3d_device, State, (const WINED3DMATRIX *)pMatrix);
hr = wined3d_device_multiply_transform(This->wined3d_device, State, (const struct wined3d_matrix *)pMatrix);
wined3d_mutex_unlock();
return hr;

View File

@ -1385,13 +1385,16 @@ IDirect3DDeviceImpl_1_SetMatrix(IDirect3DDevice *iface,
*m = *D3DMatrix;
if (D3DMatHandle == This->world)
wined3d_device_set_transform(This->wined3d_device, WINED3DTS_WORLDMATRIX(0), (WINED3DMATRIX *)D3DMatrix);
wined3d_device_set_transform(This->wined3d_device,
WINED3DTS_WORLDMATRIX(0), (struct wined3d_matrix *)D3DMatrix);
if (D3DMatHandle == This->view)
wined3d_device_set_transform(This->wined3d_device, WINED3DTS_VIEW, (WINED3DMATRIX *)D3DMatrix);
wined3d_device_set_transform(This->wined3d_device,
WINED3DTS_VIEW, (struct wined3d_matrix *)D3DMatrix);
if (D3DMatHandle == This->proj)
wined3d_device_set_transform(This->wined3d_device, WINED3DTS_PROJECTION, (WINED3DMATRIX *)D3DMatrix);
wined3d_device_set_transform(This->wined3d_device,
WINED3DTS_PROJECTION, (struct wined3d_matrix *)D3DMatrix);
wined3d_mutex_unlock();
@ -3198,9 +3201,9 @@ IDirect3DDeviceImpl_7_SetTransform(IDirect3DDevice7 *iface,
if (!Matrix)
return DDERR_INVALIDPARAMS;
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_set_transform(This->wined3d_device, type, (WINED3DMATRIX *)Matrix);
hr = wined3d_device_set_transform(This->wined3d_device, type, (struct wined3d_matrix *)Matrix);
wined3d_mutex_unlock();
return hr;
@ -3289,9 +3292,9 @@ IDirect3DDeviceImpl_7_GetTransform(IDirect3DDevice7 *iface,
if(!Matrix)
return DDERR_INVALIDPARAMS;
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_get_transform(This->wined3d_device, type, (WINED3DMATRIX *)Matrix);
hr = wined3d_device_get_transform(This->wined3d_device, type, (struct wined3d_matrix *)Matrix);
wined3d_mutex_unlock();
return hr;
@ -3378,10 +3381,10 @@ IDirect3DDeviceImpl_7_MultiplyTransform(IDirect3DDevice7 *iface,
default: type = TransformStateType;
}
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_mutex_lock();
hr = wined3d_device_multiply_transform(This->wined3d_device,
type, (WINED3DMATRIX *)D3DMatrix);
type, (struct wined3d_matrix *)D3DMatrix);
wined3d_mutex_unlock();
return hr;

View File

@ -314,13 +314,13 @@ HRESULT d3d_execute_buffer_execute(IDirect3DExecuteBufferImpl *This,
TRACE("PROCESSVERTICES (%d)\n", count);
/* Get the transform and world matrix */
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
wined3d_device_get_transform(lpDevice->wined3d_device,
D3DTRANSFORMSTATE_VIEW, (WINED3DMATRIX *)&view_mat);
D3DTRANSFORMSTATE_VIEW, (struct wined3d_matrix *)&view_mat);
wined3d_device_get_transform(lpDevice->wined3d_device,
D3DTRANSFORMSTATE_PROJECTION, (WINED3DMATRIX *)&proj_mat);
D3DTRANSFORMSTATE_PROJECTION, (struct wined3d_matrix *)&proj_mat);
wined3d_device_get_transform(lpDevice->wined3d_device,
WINED3DTS_WORLDMATRIX(0), (WINED3DMATRIX *)&world_mat);
WINED3DTS_WORLDMATRIX(0), (struct wined3d_matrix *)&world_mat);
for (i = 0; i < count; i++) {
LPD3DPROCESSVERTICES ci = (LPD3DPROCESSVERTICES) instr;

View File

@ -397,11 +397,11 @@ IDirect3DViewportImpl_TransformVertices(IDirect3DViewport3 *iface,
wined3d_mutex_lock();
wined3d_device_get_transform(This->active_device->wined3d_device,
D3DTRANSFORMSTATE_VIEW, (WINED3DMATRIX *)&view_mat);
D3DTRANSFORMSTATE_VIEW, (struct wined3d_matrix *)&view_mat);
wined3d_device_get_transform(This->active_device->wined3d_device,
D3DTRANSFORMSTATE_PROJECTION, (WINED3DMATRIX *)&proj_mat);
D3DTRANSFORMSTATE_PROJECTION, (struct wined3d_matrix *)&proj_mat);
wined3d_device_get_transform(This->active_device->wined3d_device,
WINED3DTS_WORLDMATRIX(0), (WINED3DMATRIX *)&world_mat);
WINED3DTS_WORLDMATRIX(0), (struct wined3d_matrix *)&world_mat);
multiply_matrix(&mat,&view_mat,&world_mat);
multiply_matrix(&mat,&proj_mat,&mat);

View File

@ -1816,7 +1816,7 @@ HRESULT CDECL wined3d_device_get_stream_source_freq(const struct wined3d_device
}
HRESULT CDECL wined3d_device_set_transform(struct wined3d_device *device,
WINED3DTRANSFORMSTATETYPE d3dts, const WINED3DMATRIX *matrix)
WINED3DTRANSFORMSTATETYPE d3dts, const struct wined3d_matrix *matrix)
{
TRACE("device %p, state %s, matrix %p.\n",
device, debug_d3dtstype(d3dts), matrix);
@ -1861,7 +1861,7 @@ HRESULT CDECL wined3d_device_set_transform(struct wined3d_device *device,
}
HRESULT CDECL wined3d_device_get_transform(const struct wined3d_device *device,
WINED3DTRANSFORMSTATETYPE state, WINED3DMATRIX *matrix)
WINED3DTRANSFORMSTATETYPE state, struct wined3d_matrix *matrix)
{
TRACE("device %p, state %s, matrix %p.\n", device, debug_d3dtstype(state), matrix);
@ -1871,10 +1871,10 @@ HRESULT CDECL wined3d_device_get_transform(const struct wined3d_device *device,
}
HRESULT CDECL wined3d_device_multiply_transform(struct wined3d_device *device,
WINED3DTRANSFORMSTATETYPE state, const WINED3DMATRIX *matrix)
WINED3DTRANSFORMSTATETYPE state, const struct wined3d_matrix *matrix)
{
const WINED3DMATRIX *mat = NULL;
WINED3DMATRIX temp;
const struct wined3d_matrix *mat = NULL;
struct wined3d_matrix temp;
TRACE("device %p, state %s, matrix %p.\n", device, debug_d3dtstype(state), matrix);
@ -3199,9 +3199,9 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
char *dest_ptr, *dest_conv = NULL, *dest_conv_addr = NULL;
struct wined3d_matrix mat, proj_mat, view_mat, world_mat;
unsigned int i;
WINED3DVIEWPORT vp;
WINED3DMATRIX mat, proj_mat, view_mat, world_mat;
BOOL doClip;
DWORD numTextures;

View File

@ -2814,8 +2814,10 @@ enum wined3d_format_id pixelformat_for_depth(DWORD depth)
}
}
void multiply_matrix(WINED3DMATRIX *dest, const WINED3DMATRIX *src1, const WINED3DMATRIX *src2) {
WINED3DMATRIX temp;
void multiply_matrix(struct wined3d_matrix *dest, const struct wined3d_matrix *src1,
const struct wined3d_matrix *src2)
{
struct wined3d_matrix temp;
/* Now do the multiplication 'by hand'.
I know that all this could be optimised, but this will be done later :-) */

View File

@ -2274,7 +2274,7 @@ struct wined3d_state
DWORD texture_states[MAX_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
DWORD lowest_disabled_stage;
WINED3DMATRIX transforms[HIGHEST_TRANSFORMSTATE + 1];
struct wined3d_matrix transforms[HIGHEST_TRANSFORMSTATE + 1];
double clip_planes[MAX_CLIPPLANES][4];
WINED3DMATERIAL material;
WINED3DVIEWPORT viewport;
@ -2525,7 +2525,8 @@ BOOL getDepthStencilBits(const struct wined3d_format *format,
BYTE *depthSize, BYTE *stencilSize) DECLSPEC_HIDDEN;
/* Math utils */
void multiply_matrix(WINED3DMATRIX *dest, const WINED3DMATRIX *src1, const WINED3DMATRIX *src2) DECLSPEC_HIDDEN;
void multiply_matrix(struct wined3d_matrix *dest, const struct wined3d_matrix *src1,
const struct wined3d_matrix *src2) DECLSPEC_HIDDEN;
UINT wined3d_log2i(UINT32 x) DECLSPEC_HIDDEN;
unsigned int count_bits(unsigned int mask) DECLSPEC_HIDDEN;

View File

@ -1532,7 +1532,7 @@ struct wined3d_vec3
float z;
};
typedef struct _WINED3DMATRIX
struct wined3d_matrix
{
union
{
@ -1545,7 +1545,7 @@ typedef struct _WINED3DMATRIX
} DUMMYSTRUCTNAME;
float m[4][4];
} DUMMYUNIONNAME;
} WINED3DMATRIX;
};
typedef struct _WINED3DLIGHT
{
@ -2251,7 +2251,7 @@ HRESULT __cdecl wined3d_device_get_texture(const struct wined3d_device *device,
HRESULT __cdecl wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
UINT stage, WINED3DTEXTURESTAGESTATETYPE state, DWORD *value);
HRESULT __cdecl wined3d_device_get_transform(const struct wined3d_device *device,
WINED3DTRANSFORMSTATETYPE state, WINED3DMATRIX *matrix);
WINED3DTRANSFORMSTATETYPE state, struct wined3d_matrix *matrix);
HRESULT __cdecl wined3d_device_get_vertex_declaration(const struct wined3d_device *device,
struct wined3d_vertex_declaration **declaration);
struct wined3d_shader * __cdecl wined3d_device_get_vertex_shader(const struct wined3d_device *device);
@ -2267,7 +2267,7 @@ ULONG __cdecl wined3d_device_incref(struct wined3d_device *device);
HRESULT __cdecl wined3d_device_init_3d(struct wined3d_device *device, WINED3DPRESENT_PARAMETERS *present_parameters);
HRESULT __cdecl wined3d_device_init_gdi(struct wined3d_device *device, WINED3DPRESENT_PARAMETERS *present_parameters);
HRESULT __cdecl wined3d_device_multiply_transform(struct wined3d_device *device,
WINED3DTRANSFORMSTATETYPE state, const WINED3DMATRIX *matrix);
WINED3DTRANSFORMSTATETYPE state, const struct wined3d_matrix *matrix);
HRESULT __cdecl wined3d_device_present(const struct wined3d_device *device, const RECT *src_rect,
const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region);
HRESULT __cdecl wined3d_device_process_vertices(struct wined3d_device *device,
@ -2320,7 +2320,7 @@ HRESULT __cdecl wined3d_device_set_texture(struct wined3d_device *device, UINT s
HRESULT __cdecl wined3d_device_set_texture_stage_state(struct wined3d_device *device,
UINT stage, WINED3DTEXTURESTAGESTATETYPE state, DWORD value);
HRESULT __cdecl wined3d_device_set_transform(struct wined3d_device *device,
WINED3DTRANSFORMSTATETYPE state, const WINED3DMATRIX *matrix);
WINED3DTRANSFORMSTATETYPE state, const struct wined3d_matrix *matrix);
HRESULT __cdecl wined3d_device_set_vertex_declaration(struct wined3d_device *device,
struct wined3d_vertex_declaration *declaration);
HRESULT __cdecl wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader);