From 6ee356fca048dd6d0b5bb61ce178f8e3c76bf611 Mon Sep 17 00:00:00 2001 From: "H. Verbeet" Date: Wed, 6 Jun 2007 18:40:09 +0200 Subject: [PATCH] wined3d: Get rid of the pBaseVertexIndex parameter to IWineD3DDeviceImpl_GetIndices, use GetBaseVertexIndex instead. --- dlls/d3d8/device.c | 7 ++++--- dlls/d3d9/device.c | 9 ++++----- dlls/wined3d/device.c | 7 +++---- include/wine/wined3d_interface.h | 4 ++-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 9b718a44a6c..366694f7c3d 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1460,12 +1460,13 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, I return D3DERR_INVALIDCALL; } - rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData, pBaseVertexIndex); - if (D3D_OK == rc && NULL != retIndexData) { + IWineD3DDevice_GetBaseVertexIndex(This->WineD3DDevice, pBaseVertexIndex); + rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData); + if (SUCCEEDED(rc) && retIndexData) { IWineD3DIndexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData); IWineD3DIndexBuffer_Release(retIndexData); } else { - if(rc != D3D_OK) FIXME("Call to GetIndices failed\n"); + if (FAILED(rc)) FIXME("Call to GetIndices failed\n"); *ppIndexData = NULL; } return rc; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 436b2a1486d..65535db57f4 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -918,7 +918,6 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IWineD3DIndexBuffer *retIndexData = NULL; HRESULT rc = D3D_OK; - UINT tmp; TRACE("(%p) Relay\n", This); @@ -926,12 +925,12 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, return D3DERR_INVALIDCALL; } - rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData, &tmp); - if (rc == D3D_OK && NULL != retIndexData) { + rc = IWineD3DDevice_GetIndices(This->WineD3DDevice, &retIndexData); + if (SUCCEEDED(rc) && retIndexData) { IWineD3DIndexBuffer_GetParent(retIndexData, (IUnknown **)ppIndexData); IWineD3DIndexBuffer_Release(retIndexData); - }else{ - if(rc != D3D_OK) FIXME("Call to GetIndices failed\n"); + } else { + if (FAILED(rc)) FIXME("Call to GetIndices failed\n"); *ppIndexData = NULL; } return rc; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 28116afa899..528f6bd6be5 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2774,7 +2774,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWine return WINED3D_OK; } -static HRESULT WINAPI IWineD3DDeviceImpl_GetIndices(IWineD3DDevice *iface, IWineD3DIndexBuffer** ppIndexData, UINT* pBaseVertexIndex) { +static HRESULT WINAPI IWineD3DDeviceImpl_GetIndices(IWineD3DDevice *iface, IWineD3DIndexBuffer** ppIndexData) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; *ppIndexData = This->stateBlock->pIndexData; @@ -2782,12 +2782,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetIndices(IWineD3DDevice *iface, IWine /* up ref count on ppindexdata */ if (*ppIndexData) { IWineD3DIndexBuffer_AddRef(*ppIndexData); - *pBaseVertexIndex = This->stateBlock->baseVertexIndex; - TRACE("(%p) index data set to %p + %u\n", This, ppIndexData, This->stateBlock->baseVertexIndex); + TRACE("(%p) index data set to %p\n", This, ppIndexData); }else{ TRACE("(%p) No index data set\n", This); } - TRACE("Returning %p %d\n", *ppIndexData, *pBaseVertexIndex); + TRACE("Returning %p\n", *ppIndexData); return WINED3D_OK; } diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 6402829720a..b6dd6cb4c4c 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -404,7 +404,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain, DWORD Flags, CONST WINED3DGAMMARAMP* pRamp) PURE; STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain, WINED3DGAMMARAMP* pRamp) PURE; STDMETHOD(SetIndices)(THIS_ struct IWineD3DIndexBuffer * pIndexData) PURE; - STDMETHOD(GetIndices)(THIS_ struct IWineD3DIndexBuffer ** ppIndexData,UINT * pBaseVertexIndex) PURE; + STDMETHOD(GetIndices)(THIS_ struct IWineD3DIndexBuffer ** ppIndexData) PURE; STDMETHOD(SetBaseVertexIndex)(THIS_ UINT baseIndex); STDMETHOD(GetBaseVertexIndex)(THIS_ UINT *baseIndex); STDMETHOD(SetLight)(THIS_ DWORD Index,CONST WINED3DLIGHT * pLight) PURE; @@ -541,7 +541,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) #define IWineD3DDevice_SetGammaRamp(p,a,b,c) (p)->lpVtbl->SetGammaRamp(p,a,b,c) #define IWineD3DDevice_GetGammaRamp(p,a,b) (p)->lpVtbl->GetGammaRamp(p,a,b) #define IWineD3DDevice_SetIndices(p,a) (p)->lpVtbl->SetIndices(p,a) -#define IWineD3DDevice_GetIndices(p,a,b) (p)->lpVtbl->GetIndices(p,a,b) +#define IWineD3DDevice_GetIndices(p,a) (p)->lpVtbl->GetIndices(p,a) #define IWineD3DDevice_SetBaseVertexIndex(p, a) (p)->lpVtbl->SetBaseVertexIndex(p, a) #define IWineD3DDevice_GetBaseVertexIndex(p,a) (p)->lpVtbl->GetBaseVertexIndex(p,a) #define IWineD3DDevice_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b)