From 5f2987ae3233ea441b210aee365e0d1d4360ba4f Mon Sep 17 00:00:00 2001 From: Ivan Gyurdiev Date: Tue, 10 Oct 2006 21:57:25 -0400 Subject: [PATCH] wined3d: Merge VIEWPORT types into one type in WINED3D namespace. --- dlls/d3d8/device.c | 2 ++ dlls/d3d9/device.c | 4 ++++ dlls/ddraw/device.c | 7 +++++-- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/stateblock.c | 4 ++-- include/wine/wined3d_interface.h | 3 --- include/wine/wined3d_types.h | 9 +++++++++ 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 2a7d730067f..92e32b316c0 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -697,6 +697,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface, IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; TRACE("(%p) Relay\n" , This); + /* Note: D3DVIEWPORT8 is compatible with WINED3DVIEWPORT */ return IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport); } @@ -704,6 +705,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface, IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; TRACE("(%p) Relay\n" , This); + /* Note: D3DVIEWPORT8 is compatible with WINED3DVIEWPORT */ return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport); } diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 815ea6df0bf..2e6c3c3f7aa 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -480,12 +480,16 @@ static HRESULT WINAPI IDirect3DDevice9Impl_MultiplyTransform(LPDIRECT3DDEVICE9 static HRESULT WINAPI IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; TRACE("(%p) Relay\n" , This); + + /* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */ return IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport); } static HRESULT WINAPI IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; TRACE("(%p) Relay\n" , This); + + /* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */ return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport); } diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 42e469781d1..26c6897fb31 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -4035,8 +4035,9 @@ IDirect3DDeviceImpl_7_SetViewport(IDirect3DDevice7 *iface, if(!Data) return DDERR_INVALIDPARAMS; + /* Note: D3DVIEWPORT7 is compatible with WINED3DVIEWPORT */ return IWineD3DDevice_SetViewport(This->wineD3DDevice, - Data); + (WINED3DVIEWPORT*) Data); } /***************************************************************************** @@ -4066,8 +4067,10 @@ IDirect3DDeviceImpl_7_GetViewport(IDirect3DDevice7 *iface, if(!Data) return DDERR_INVALIDPARAMS; + /* Note: D3DVIEWPORT7 is compatible with WINED3DVIEWPORT */ hr = IWineD3DDevice_GetViewport(This->wineD3DDevice, - Data); + (WINED3DVIEWPORT*) Data); + return hr_ddraw_from_wined3d(hr); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f0da0cc6e21..44a55d83d92 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2114,7 +2114,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR list_init(&This->glsl_shader_progs); { /* Set a default viewport */ - D3DVIEWPORT9 vp; + WINED3DVIEWPORT vp; vp.X = 0; vp.Y = 0; vp.Width = *(pPresentationParameters->BackBufferWidth); @@ -5083,7 +5083,7 @@ process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCo char *dest_ptr, *dest_conv = NULL; unsigned int i; DWORD DestFVF = dest->fvf; - D3DVIEWPORT9 vp; + WINED3DVIEWPORT vp; D3DMATRIX mat, proj_mat, view_mat, world_mat; BOOL doClip; int numTextures; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 841f03c4f21..cd6c58b242b 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -527,9 +527,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) if (This->set.viewport && memcmp(&targetStateBlock->viewport, &This->viewport, - sizeof(D3DVIEWPORT9)) != 0) { + sizeof(WINED3DVIEWPORT)) != 0) { TRACE("Updating viewport\n"); - memcpy(&This->viewport, &targetStateBlock->viewport, sizeof(D3DVIEWPORT9)); + memcpy(&This->viewport, &targetStateBlock->viewport, sizeof(WINED3DVIEWPORT)); } for (i = 0; i < MAX_STREAMS; i++) { diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 7bd64c77da0..4c3c9a83af3 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -191,17 +191,14 @@ DEFINE_GUID(IID_IWineD3DQuery, /* TODO: remove the d3d8/d3d9 dependencies by making a all inclusive WINED3D version */ #if defined( __WINE_D3D9_H ) /* Identical: */ -# define WINED3DVIEWPORT D3DVIEWPORT9 # define WINED3DGAMMARAMP D3DGAMMARAMP #elif defined( __WINE_D3D8_H ) /* Identical: */ -# define WINED3DVIEWPORT D3DVIEWPORT8 # define WINED3DGAMMARAMP D3DGAMMARAMP #else /* defined (__WINE_D3D_H ) */ /* Identical: */ -# define WINED3DVIEWPORT D3DVIEWPORT7 # define WINED3DGAMMARAMP DDGAMMARAMP #endif diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index b1c3ae1e75d..9bc269852e3 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -76,6 +76,15 @@ typedef struct _WINED3DMATERIAL { float Power; } WINED3DMATERIAL; +typedef struct _WINED3DVIEWPORT { + DWORD X; + DWORD Y; + DWORD Width; + DWORD Height; + float MinZ; + float MaxZ; +} WINED3DVIEWPORT; + #define WINED3D_VSHADER_MAX_CONSTANTS 96 #define WINED3D_PSHADER_MAX_CONSTANTS 32 -- 2.11.4.GIT