Commit 78577127 authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the BaseVertexIndex parameter to…

wined3d: Get rid of the BaseVertexIndex parameter to IWineD3DDeviceImpl_SetIndices, use SetBaseVertexIndex instead.
parent 45b531fc
......@@ -1444,9 +1444,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEV
static HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8* pIndexData, UINT baseVertexIndex) {
IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface;
TRACE("(%p) Relay\n", This);
IWineD3DDevice_SetBaseVertexIndex(This->WineD3DDevice, baseVertexIndex);
return IWineD3DDevice_SetIndices(This->WineD3DDevice,
NULL == pIndexData ? NULL : ((IDirect3DIndexBuffer8Impl *)pIndexData)->wineD3DIndexBuffer,
baseVertexIndex);
pIndexData ? ((IDirect3DIndexBuffer8Impl *)pIndexData)->wineD3DIndexBuffer : NULL);
}
static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex) {
......
......@@ -910,9 +910,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetStreamSourceFreq(LPDIRECT3DDEVIC
static HRESULT WINAPI IDirect3DDevice9Impl_SetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9* pIndexData) {
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
TRACE("(%p) Relay\n", This);
return IWineD3DDevice_SetIndices(This->WineD3DDevice,
pIndexData==NULL ? NULL:((IDirect3DIndexBuffer9Impl *)pIndexData)->wineD3DIndexBuffer,
0);
return IWineD3DDevice_SetIndices(This->WineD3DDevice,
pIndexData ? ((IDirect3DIndexBuffer9Impl *)pIndexData)->wineD3DIndexBuffer : NULL);
}
static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9 iface, IDirect3DIndexBuffer9 **ppIndexData) {
......
......@@ -288,9 +288,7 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
EnterCriticalSection(&ddraw_cs);
/* Free the index buffer. */
IWineD3DDevice_SetIndices(This->wineD3DDevice,
NULL,
0);
IWineD3DDevice_SetIndices(This->wineD3DDevice, NULL);
IWineD3DIndexBuffer_GetParent(This->indexbuffer,
(IUnknown **) &IndexBufferParent);
IParent_Release(IndexBufferParent); /* Once for the getParent */
......@@ -3896,9 +3894,8 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
}
/* Set the index stream */
hr = IWineD3DDevice_SetIndices(This->wineD3DDevice,
This->indexbuffer,
StartVertex);
IWineD3DDevice_SetBaseVertexIndex(This->wineD3DDevice, StartVertex);
hr = IWineD3DDevice_SetIndices(This->wineD3DDevice, This->indexbuffer);
/* Set the vertex stream source */
hr = IWineD3DDevice_SetStreamSource(This->wineD3DDevice,
......
......@@ -311,7 +311,7 @@ IDirectDrawSurfaceImpl_Release(IDirectDrawSurface7 *iface)
TRACE("(%p) Destroying the render target, uninitializing D3D\n", This);
/* Unset any index buffer, just to be sure */
IWineD3DDevice_SetIndices(ddraw->wineD3DDevice, NULL, 0);
IWineD3DDevice_SetIndices(ddraw->wineD3DDevice, NULL);
IWineD3DDevice_SetDepthStencilSurface(ddraw->wineD3DDevice, NULL);
if(IWineD3DDevice_Uninit3D(ddraw->wineD3DDevice, D3D7CB_DestroyDepthStencilSurface, D3D7CB_DestroySwapChain) != D3D_OK)
......
......@@ -2751,19 +2751,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetMaterial(IWineD3DDevice *iface, WINE
/*****
* Get / Set Indices
*****/
static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWineD3DIndexBuffer* pIndexData,
UINT BaseVertexIndex) {
static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWineD3DIndexBuffer* pIndexData) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DIndexBuffer *oldIdxs;
UINT oldBaseIndex = This->updateStateBlock->baseVertexIndex;
TRACE("(%p) : Setting to %p, base %d\n", This, pIndexData, BaseVertexIndex);
TRACE("(%p) : Setting to %p\n", This, pIndexData);
oldIdxs = This->updateStateBlock->pIndexData;
This->updateStateBlock->changed.indices = TRUE;
This->updateStateBlock->set.indices = TRUE;
This->updateStateBlock->pIndexData = pIndexData;
This->updateStateBlock->baseVertexIndex = BaseVertexIndex;
/* Handle recording of state blocks */
if (This->isRecordingState) {
......@@ -2771,12 +2768,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWine
return WINED3D_OK;
}
/* The base vertex index affects the stream sources, while
* The index buffer is a seperate index buffer state
*/
if(BaseVertexIndex != oldBaseIndex) {
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC);
}
if(oldIdxs != pIndexData) {
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER);
}
......@@ -2817,6 +2808,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetBaseVertexIndex(IWineD3DDevice *ifac
TRACE("Recording... not performing anything\n");
return WINED3D_OK;
}
/* The base vertex index affects the stream sources */
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_STREAMSRC);
return WINED3D_OK;
}
......
......@@ -711,8 +711,10 @@ should really perform a delta so that only the changes get updated*/
IWineD3DDevice_SetTransform(pDevice, i, &This->transforms[i]);
}
if (This->set.indices && This->changed.indices)
IWineD3DDevice_SetIndices(pDevice, This->pIndexData, This->baseVertexIndex);
if (This->set.indices && This->changed.indices) {
IWineD3DDevice_SetIndices(pDevice, This->pIndexData);
IWineD3DDevice_SetBaseVertexIndex(pDevice, This->baseVertexIndex);
}
if (This->set.material && This->changed.material )
IWineD3DDevice_SetMaterial(pDevice, &This->material);
......
......@@ -403,7 +403,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
STDMETHOD(GetFVF)(THIS_ DWORD * pfvf) PURE;
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,UINT BaseVertexIndex) PURE;
STDMETHOD(SetIndices)(THIS_ struct IWineD3DIndexBuffer * pIndexData) PURE;
STDMETHOD(GetIndices)(THIS_ struct IWineD3DIndexBuffer ** ppIndexData,UINT * pBaseVertexIndex) PURE;
STDMETHOD(SetBaseVertexIndex)(THIS_ UINT baseIndex);
STDMETHOD(SetLight)(THIS_ DWORD Index,CONST WINED3DLIGHT * pLight) PURE;
......@@ -539,7 +539,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase)
#define IWineD3DDevice_GetDepthStencilSurface(p,a) (p)->lpVtbl->GetDepthStencilSurface(p,a)
#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,b) (p)->lpVtbl->SetIndices(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_SetBaseVertexIndex(p, a) (p)->lpVtbl->SetBaseVertexIndex(p, a)
#define IWineD3DDevice_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b)
......
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