H. Verbeet : wined3d: Get rid of the pBaseVertexIndex parameter to IWineD3DDeviceImpl_GetIndices , use GetBaseVertexIndex instead.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jun 7 07:20:18 CDT 2007


Module: wine
Branch: master
Commit: 6ee356fca048dd6d0b5bb61ce178f8e3c76bf611
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6ee356fca048dd6d0b5bb61ce178f8e3c76bf611

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Wed Jun  6 18:40:09 2007 +0200

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 9b718a4..366694f 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 436b2a1..65535db 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 28116af..528f6bd 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 6402829..b6dd6cb 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)




More information about the wine-cvs mailing list