From adb1e10979d49cc27bf411e353a24a9ba64d93eb Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 10 Mar 2011 19:07:10 +0100 Subject: [PATCH] wined3d: Get rid of wined3d_buffer_get_desc(). --- dlls/d3d8/buffer.c | 8 ++++++-- dlls/d3d9/buffer.c | 8 ++++++-- dlls/ddraw/device.c | 4 +++- dlls/ddraw/vertexbuffer.c | 8 ++++++-- dlls/wined3d/buffer.c | 7 ------- dlls/wined3d/wined3d.spec | 1 - include/wine/wined3d.idl | 1 - 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c index b0d15898f04..8ebb8710583 100644 --- a/dlls/d3d8/buffer.c +++ b/dlls/d3d8/buffer.c @@ -210,11 +210,13 @@ static HRESULT WINAPI d3d8_vertexbuffer_GetDesc(IDirect3DVertexBuffer8 *iface, D { IDirect3DVertexBuffer8Impl *buffer = (IDirect3DVertexBuffer8Impl *)iface; struct wined3d_resource_desc wined3d_desc; + struct wined3d_resource *wined3d_resource; TRACE("iface %p, desc %p.\n", iface, desc); wined3d_mutex_lock(); - wined3d_buffer_get_desc(buffer->wineD3DVertexBuffer, &wined3d_desc); + wined3d_resource = wined3d_buffer_get_resource(buffer->wineD3DVertexBuffer); + wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); wined3d_mutex_unlock(); desc->Type = D3DRTYPE_VERTEXBUFFER; @@ -472,11 +474,13 @@ static HRESULT WINAPI d3d8_indexbuffer_GetDesc(IDirect3DIndexBuffer8 *iface, D3D { IDirect3DIndexBuffer8Impl *buffer = (IDirect3DIndexBuffer8Impl *)iface; struct wined3d_resource_desc wined3d_desc; + struct wined3d_resource *wined3d_resource; TRACE("iface %p, desc %p.\n", iface, desc); wined3d_mutex_lock(); - wined3d_buffer_get_desc(buffer->wineD3DIndexBuffer, &wined3d_desc); + wined3d_resource = wined3d_buffer_get_resource(buffer->wineD3DIndexBuffer); + wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); wined3d_mutex_unlock(); desc->Format = d3dformat_from_wined3dformat(buffer->format); diff --git a/dlls/d3d9/buffer.c b/dlls/d3d9/buffer.c index a3bf3db943b..827a1919ac1 100644 --- a/dlls/d3d9/buffer.c +++ b/dlls/d3d9/buffer.c @@ -212,11 +212,13 @@ static HRESULT WINAPI d3d9_vertexbuffer_GetDesc(IDirect3DVertexBuffer9 *iface, D { IDirect3DVertexBuffer9Impl *buffer = (IDirect3DVertexBuffer9Impl *)iface; struct wined3d_resource_desc wined3d_desc; + struct wined3d_resource *wined3d_resource; TRACE("iface %p, desc %p.\n", iface, desc); wined3d_mutex_lock(); - wined3d_buffer_get_desc(buffer->wineD3DVertexBuffer, &wined3d_desc); + wined3d_resource = wined3d_buffer_get_resource(buffer->wineD3DVertexBuffer); + wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); wined3d_mutex_unlock(); desc->Format = D3DFMT_VERTEXDATA; @@ -474,11 +476,13 @@ static HRESULT WINAPI d3d9_indexbuffer_GetDesc(IDirect3DIndexBuffer9 *iface, D3D { IDirect3DIndexBuffer9Impl *buffer = (IDirect3DIndexBuffer9Impl *)iface; struct wined3d_resource_desc wined3d_desc; + struct wined3d_resource *wined3d_resource; TRACE("iface %p, desc %p.\n", iface, desc); wined3d_mutex_lock(); - wined3d_buffer_get_desc(buffer->wineD3DIndexBuffer, &wined3d_desc); + wined3d_resource = wined3d_buffer_get_resource(buffer->wineD3DIndexBuffer); + wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); wined3d_mutex_unlock(); desc->Format = d3dformat_from_wined3dformat(buffer->format); diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 710c8f3e5b2..7d58e01dece 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -4147,6 +4147,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, IDirect3DDeviceImpl *This = (IDirect3DDeviceImpl *)iface; IDirect3DVertexBufferImpl *vb = (IDirect3DVertexBufferImpl *)D3DVertexBuf; DWORD stride = get_flexible_vertex_size(vb->fvf); + struct wined3d_resource *wined3d_resource; struct wined3d_resource_desc desc; WORD *LockedIndices; HRESULT hr; @@ -4174,7 +4175,8 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, /* check that the buffer is large enough to hold the indices, * reallocate if necessary. */ - wined3d_buffer_get_desc(This->indexbuffer, &desc); + wined3d_resource = wined3d_buffer_get_resource(This->indexbuffer); + wined3d_resource_get_desc(wined3d_resource, &desc); if (desc.size < IndexCount * sizeof(WORD)) { UINT size = max(desc.size * 2, IndexCount * sizeof(WORD)); diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index 8874ac8a980..dae15662d72 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -209,6 +209,7 @@ IDirect3DVertexBufferImpl_Lock(IDirect3DVertexBuffer7 *iface, { IDirect3DVertexBufferImpl *This = (IDirect3DVertexBufferImpl *)iface; struct wined3d_resource_desc wined3d_desc; + struct wined3d_resource *wined3d_resource; HRESULT hr; DWORD wined3d_flags = 0; @@ -226,7 +227,8 @@ IDirect3DVertexBufferImpl_Lock(IDirect3DVertexBuffer7 *iface, if(Size) { /* Get the size, for returning it, and for locking */ - wined3d_buffer_get_desc(This->wineD3DVertexBuffer, &wined3d_desc); + wined3d_resource = wined3d_buffer_get_resource(This->wineD3DVertexBuffer); + wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); *Size = wined3d_desc.size; } @@ -401,13 +403,15 @@ IDirect3DVertexBufferImpl_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface, { IDirect3DVertexBufferImpl *This = (IDirect3DVertexBufferImpl *)iface; struct wined3d_resource_desc wined3d_desc; + struct wined3d_resource *wined3d_resource; TRACE("iface %p, desc %p.\n", iface, Desc); if(!Desc) return DDERR_INVALIDPARAMS; EnterCriticalSection(&ddraw_cs); - wined3d_buffer_get_desc(This->wineD3DVertexBuffer, &wined3d_desc); + wined3d_resource = wined3d_buffer_get_resource(This->wineD3DVertexBuffer); + wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); LeaveCriticalSection(&ddraw_cs); /* Now fill the Desc structure */ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 8d65ffb3215..9e4ae2aae5a 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1395,13 +1395,6 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) } } -void CDECL wined3d_buffer_get_desc(const struct wined3d_buffer *buffer, struct wined3d_resource_desc *desc) -{ - TRACE("buffer %p, desc %p.\n", buffer, desc); - - wined3d_resource_get_desc(&buffer->resource, desc); -} - static const struct wined3d_resource_ops buffer_resource_ops = { buffer_unload, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index aa971695bc8..558fd827e63 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -21,7 +21,6 @@ @ cdecl wined3d_buffer_decref(ptr) @ cdecl wined3d_buffer_free_private_data(ptr ptr) -@ cdecl wined3d_buffer_get_desc(ptr ptr) @ cdecl wined3d_buffer_get_parent(ptr) @ cdecl wined3d_buffer_get_priority(ptr) @ cdecl wined3d_buffer_get_private_data(ptr ptr ptr ptr) diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index bc556f55845..21f703955cf 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -3162,7 +3162,6 @@ HRESULT __cdecl wined3d_register_software_device(struct wined3d *wined3d, void * ULONG __cdecl wined3d_buffer_decref(struct wined3d_buffer *buffer); HRESULT __cdecl wined3d_buffer_free_private_data(struct wined3d_buffer *buffer, REFGUID guid); -void __cdecl wined3d_buffer_get_desc(const struct wined3d_buffer *buffer, struct wined3d_resource_desc *desc); void * __cdecl wined3d_buffer_get_parent(const struct wined3d_buffer *buffer); DWORD __cdecl wined3d_buffer_get_priority(const struct wined3d_buffer *buffer); HRESULT __cdecl wined3d_buffer_get_private_data(const struct wined3d_buffer *buffer,