Commit 5f2987ae authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: Merge VIEWPORT types into one type in WINED3D namespace.

parent 90f5be2b
...@@ -697,6 +697,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface, ...@@ -697,6 +697,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface,
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
TRACE("(%p) Relay\n" , This); TRACE("(%p) Relay\n" , This);
/* Note: D3DVIEWPORT8 is compatible with WINED3DVIEWPORT */
return IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport); return IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport);
} }
...@@ -704,6 +705,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface, ...@@ -704,6 +705,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface,
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
TRACE("(%p) Relay\n" , This); TRACE("(%p) Relay\n" , This);
/* Note: D3DVIEWPORT8 is compatible with WINED3DVIEWPORT */
return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport); return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport);
} }
......
...@@ -480,12 +480,16 @@ static HRESULT WINAPI IDirect3DDevice9Impl_MultiplyTransform(LPDIRECT3DDEVICE9 ...@@ -480,12 +480,16 @@ static HRESULT WINAPI IDirect3DDevice9Impl_MultiplyTransform(LPDIRECT3DDEVICE9
static HRESULT WINAPI IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) { static HRESULT WINAPI IDirect3DDevice9Impl_SetViewport(LPDIRECT3DDEVICE9 iface, CONST D3DVIEWPORT9* pViewport) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n" , This); TRACE("(%p) Relay\n" , This);
/* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */
return IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport); return IWineD3DDevice_SetViewport(This->WineD3DDevice, (const WINED3DVIEWPORT *)pViewport);
} }
static HRESULT WINAPI IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport) { static HRESULT WINAPI IDirect3DDevice9Impl_GetViewport(LPDIRECT3DDEVICE9 iface, D3DVIEWPORT9* pViewport) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n" , This); TRACE("(%p) Relay\n" , This);
/* Note: D3DVIEWPORT9 is compatible with WINED3DVIEWPORT */
return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport); return IWineD3DDevice_GetViewport(This->WineD3DDevice, (WINED3DVIEWPORT *)pViewport);
} }
......
...@@ -4035,8 +4035,9 @@ IDirect3DDeviceImpl_7_SetViewport(IDirect3DDevice7 *iface, ...@@ -4035,8 +4035,9 @@ IDirect3DDeviceImpl_7_SetViewport(IDirect3DDevice7 *iface,
if(!Data) if(!Data)
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
/* Note: D3DVIEWPORT7 is compatible with WINED3DVIEWPORT */
return IWineD3DDevice_SetViewport(This->wineD3DDevice, return IWineD3DDevice_SetViewport(This->wineD3DDevice,
Data); (WINED3DVIEWPORT*) Data);
} }
/***************************************************************************** /*****************************************************************************
...@@ -4066,8 +4067,10 @@ IDirect3DDeviceImpl_7_GetViewport(IDirect3DDevice7 *iface, ...@@ -4066,8 +4067,10 @@ IDirect3DDeviceImpl_7_GetViewport(IDirect3DDevice7 *iface,
if(!Data) if(!Data)
return DDERR_INVALIDPARAMS; return DDERR_INVALIDPARAMS;
/* Note: D3DVIEWPORT7 is compatible with WINED3DVIEWPORT */
hr = IWineD3DDevice_GetViewport(This->wineD3DDevice, hr = IWineD3DDevice_GetViewport(This->wineD3DDevice,
Data); (WINED3DVIEWPORT*) Data);
return hr_ddraw_from_wined3d(hr); return hr_ddraw_from_wined3d(hr);
} }
......
...@@ -2114,7 +2114,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR ...@@ -2114,7 +2114,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
list_init(&This->glsl_shader_progs); list_init(&This->glsl_shader_progs);
{ /* Set a default viewport */ { /* Set a default viewport */
D3DVIEWPORT9 vp; WINED3DVIEWPORT vp;
vp.X = 0; vp.X = 0;
vp.Y = 0; vp.Y = 0;
vp.Width = *(pPresentationParameters->BackBufferWidth); vp.Width = *(pPresentationParameters->BackBufferWidth);
...@@ -5083,7 +5083,7 @@ process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCo ...@@ -5083,7 +5083,7 @@ process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCo
char *dest_ptr, *dest_conv = NULL; char *dest_ptr, *dest_conv = NULL;
unsigned int i; unsigned int i;
DWORD DestFVF = dest->fvf; DWORD DestFVF = dest->fvf;
D3DVIEWPORT9 vp; WINED3DVIEWPORT vp;
D3DMATRIX mat, proj_mat, view_mat, world_mat; D3DMATRIX mat, proj_mat, view_mat, world_mat;
BOOL doClip; BOOL doClip;
int numTextures; int numTextures;
......
...@@ -527,9 +527,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface) ...@@ -527,9 +527,9 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
if (This->set.viewport && memcmp(&targetStateBlock->viewport, if (This->set.viewport && memcmp(&targetStateBlock->viewport,
&This->viewport, &This->viewport,
sizeof(D3DVIEWPORT9)) != 0) { sizeof(WINED3DVIEWPORT)) != 0) {
TRACE("Updating viewport\n"); 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++) { for (i = 0; i < MAX_STREAMS; i++) {
......
...@@ -191,17 +191,14 @@ DEFINE_GUID(IID_IWineD3DQuery, ...@@ -191,17 +191,14 @@ DEFINE_GUID(IID_IWineD3DQuery,
/* TODO: remove the d3d8/d3d9 dependencies by making a all inclusive WINED3D version */ /* TODO: remove the d3d8/d3d9 dependencies by making a all inclusive WINED3D version */
#if defined( __WINE_D3D9_H ) #if defined( __WINE_D3D9_H )
/* Identical: */ /* Identical: */
# define WINED3DVIEWPORT D3DVIEWPORT9
# define WINED3DGAMMARAMP D3DGAMMARAMP # define WINED3DGAMMARAMP D3DGAMMARAMP
#elif defined( __WINE_D3D8_H ) #elif defined( __WINE_D3D8_H )
/* Identical: */ /* Identical: */
# define WINED3DVIEWPORT D3DVIEWPORT8
# define WINED3DGAMMARAMP D3DGAMMARAMP # define WINED3DGAMMARAMP D3DGAMMARAMP
#else /* defined (__WINE_D3D_H ) */ #else /* defined (__WINE_D3D_H ) */
/* Identical: */ /* Identical: */
# define WINED3DVIEWPORT D3DVIEWPORT7
# define WINED3DGAMMARAMP DDGAMMARAMP # define WINED3DGAMMARAMP DDGAMMARAMP
#endif #endif
......
...@@ -76,6 +76,15 @@ typedef struct _WINED3DMATERIAL { ...@@ -76,6 +76,15 @@ typedef struct _WINED3DMATERIAL {
float Power; float Power;
} WINED3DMATERIAL; } 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_VSHADER_MAX_CONSTANTS 96
#define WINED3D_PSHADER_MAX_CONSTANTS 32 #define WINED3D_PSHADER_MAX_CONSTANTS 32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment