Stefan Dösinger : wined3d: Use Map and Unmap for index buffers.

Alexandre Julliard julliard at winehq.org
Wed Apr 8 10:05:32 CDT 2009


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Mon Apr  6 13:29:27 2009 +0200

wined3d: Use Map and Unmap for index buffers.

Just a change in name to prepare for the next patch

---

 dlls/d3d8/indexbuffer.c  |    4 ++--
 dlls/d3d9/indexbuffer.c  |    4 ++--
 dlls/ddraw/device.c      |   12 ++++++------
 dlls/wined3d/buffer.c    |    8 ++++----
 include/wine/wined3d.idl |    4 ++--
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/dlls/d3d8/indexbuffer.c b/dlls/d3d8/indexbuffer.c
index a35eb1c..0443dcf 100644
--- a/dlls/d3d8/indexbuffer.c
+++ b/dlls/d3d8/indexbuffer.c
@@ -161,7 +161,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 ifac
     TRACE("(%p) Relay\n", This);
 
     EnterCriticalSection(&d3d8_cs);
-    hr = IWineD3DIndexBuffer_Lock(This->wineD3DIndexBuffer, OffsetToLock, SizeToLock, ppbData, Flags);
+    hr = IWineD3DIndexBuffer_Map(This->wineD3DIndexBuffer, OffsetToLock, SizeToLock, ppbData, Flags);
     LeaveCriticalSection(&d3d8_cs);
     return hr;
 }
@@ -172,7 +172,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 if
     TRACE("(%p) Relay\n", This);
 
     EnterCriticalSection(&d3d8_cs);
-    hr = IWineD3DIndexBuffer_Unlock(This->wineD3DIndexBuffer);
+    hr = IWineD3DIndexBuffer_Unmap(This->wineD3DIndexBuffer);
     LeaveCriticalSection(&d3d8_cs);
     return hr;
 }
diff --git a/dlls/d3d9/indexbuffer.c b/dlls/d3d9/indexbuffer.c
index 3bb997d..3cf790e 100644
--- a/dlls/d3d9/indexbuffer.c
+++ b/dlls/d3d9/indexbuffer.c
@@ -162,7 +162,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_Lock(LPDIRECT3DINDEXBUFFER9 ifac
     TRACE("(%p) Relay\n", This);
 
     EnterCriticalSection(&d3d9_cs);
-    hr = IWineD3DIndexBuffer_Lock(This->wineD3DIndexBuffer, OffsetToLock, SizeToLock, (BYTE **)ppbData, Flags);
+    hr = IWineD3DIndexBuffer_Map(This->wineD3DIndexBuffer, OffsetToLock, SizeToLock, (BYTE **)ppbData, Flags);
     LeaveCriticalSection(&d3d9_cs);
     return hr;
 }
@@ -173,7 +173,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_Unlock(LPDIRECT3DINDEXBUFFER9 if
     TRACE("(%p) Relay\n", This);
 
     EnterCriticalSection(&d3d9_cs);
-    hr = IWineD3DIndexBuffer_Unlock(This->wineD3DIndexBuffer);
+    hr = IWineD3DIndexBuffer_Unmap(This->wineD3DIndexBuffer);
     LeaveCriticalSection(&d3d9_cs);
     return hr;
 }
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index e8791bd..c8bd88d 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -4271,11 +4271,11 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
      * or a SetData-Method for the index buffer, which
      * overrides the index buffer data with our pointer.
      */
-    hr = IWineD3DIndexBuffer_Lock(This->indexbuffer,
-                                  0 /* OffSetToLock */,
-                                  IndexCount * sizeof(WORD),
-                                  (BYTE **) &LockedIndices,
-                                  0 /* Flags */);
+    hr = IWineD3DIndexBuffer_Map(This->indexbuffer,
+                                 0 /* OffSetToLock */,
+                                 IndexCount * sizeof(WORD),
+                                 (BYTE **) &LockedIndices,
+                                 0 /* Flags */);
     assert(IndexCount < 0x100000);
     if(hr != D3D_OK)
     {
@@ -4284,7 +4284,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
         return hr;
     }
     memcpy(LockedIndices, Indices, IndexCount * sizeof(WORD));
-    hr = IWineD3DIndexBuffer_Unlock(This->indexbuffer);
+    hr = IWineD3DIndexBuffer_Unmap(This->indexbuffer);
     if(hr != D3D_OK)
     {
         ERR("(%p) IWineD3DIndexBuffer::Unlock failed with hr = %08x\n", This, hr);
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 6a66c73..350cb4b 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -1091,7 +1091,7 @@ static WINED3DRESOURCETYPE STDMETHODCALLTYPE IWineD3DIndexBufferImpl_GetType(IWi
 
 /* IWineD3DIndexBuffer methods */
 
-static HRESULT STDMETHODCALLTYPE IWineD3DIndexBufferImpl_Lock(IWineD3DIndexBuffer *iface,
+static HRESULT STDMETHODCALLTYPE IWineD3DIndexBufferImpl_Map(IWineD3DIndexBuffer *iface,
         UINT OffsetToLock, UINT SizeToLock, BYTE **ppbData, DWORD Flags)
 {
     IWineD3DIndexBufferImpl *This = (IWineD3DIndexBufferImpl *)iface;
@@ -1128,7 +1128,7 @@ static HRESULT STDMETHODCALLTYPE IWineD3DIndexBufferImpl_Lock(IWineD3DIndexBuffe
     return WINED3D_OK;
 }
 
-static HRESULT STDMETHODCALLTYPE IWineD3DIndexBufferImpl_Unlock(IWineD3DIndexBuffer *iface)
+static HRESULT STDMETHODCALLTYPE IWineD3DIndexBufferImpl_Unmap(IWineD3DIndexBuffer *iface)
 {
     IWineD3DIndexBufferImpl *This = (IWineD3DIndexBufferImpl *)iface;
     ULONG locks = InterlockedDecrement(&This->lockcount);
@@ -1193,7 +1193,7 @@ const IWineD3DIndexBufferVtbl IWineD3DIndexBuffer_Vtbl =
     IWineD3DIndexBufferImpl_UnLoad,
     IWineD3DIndexBufferImpl_GetType,
     /* IWineD3DIndexBuffer methods */
-    IWineD3DIndexBufferImpl_Lock,
-    IWineD3DIndexBufferImpl_Unlock,
+    IWineD3DIndexBufferImpl_Map,
+    IWineD3DIndexBufferImpl_Unmap,
     IWineD3DIndexBufferImpl_GetDesc,
 };
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 96c5927..4eb3d17 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -2346,13 +2346,13 @@ interface IWineD3DRendertargetView : IWineD3DBase
 ]
 interface IWineD3DIndexBuffer : IWineD3DResource
 {
-    HRESULT Lock(
+    HRESULT Map(
         [in] UINT offset,
         [in] UINT size,
         [out] BYTE **data,
         [in] DWORD flags
     );
-    HRESULT Unlock(
+    HRESULT Unmap(
     );
     HRESULT GetDesc(
         [out] WINED3DBUFFER_DESC *desc




More information about the wine-cvs mailing list