From 37a0f7ad65c38a21bdacd2a909bee12add345a67 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 17 Nov 2011 20:11:41 +0100 Subject: [PATCH] wined3d: Get rid of the WINED3DMATRIX typedef. --- dlls/d3d8/device.c | 12 ++++++------ dlls/d3d9/device.c | 12 ++++++------ dlls/ddraw/device.c | 21 ++++++++++++--------- dlls/ddraw/executebuffer.c | 8 ++++---- dlls/ddraw/viewport.c | 6 +++--- dlls/wined3d/device.c | 12 ++++++------ dlls/wined3d/utils.c | 6 ++++-- dlls/wined3d/wined3d_private.h | 5 +++-- include/wine/wined3d.h | 10 +++++----- 9 files changed, 49 insertions(+), 43 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index d9d476dcd93..a4b1d282229 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -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; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index bfa6d471a22..96c98bab754 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -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; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index a8c5c837ec7..994a142e19f 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -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; diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index 98096ceb5ef..097046d5888 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -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; diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c index ab5283c3e1c..b5d2a0c1168 100644 --- a/dlls/ddraw/viewport.c +++ b/dlls/ddraw/viewport.c @@ -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); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b10b13d9cbf..e1a87b80cc7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -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; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index f2f80203471..eacdf2f677a 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -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 :-) */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 1da22401c6c..cac3668b29e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -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; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 5e0423b7751..b988fee954b 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -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);