wined3d: Get rid of IWineD3DTexture::Map().

This commit is contained in:
Henri Verbeet 2011-03-13 20:54:28 +01:00 committed by Alexandre Julliard
parent 9176c9e886
commit b77a661515
4 changed files with 21 additions and 34 deletions

View File

@ -300,17 +300,22 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(IDirect3DTexture8 *i
return D3D_OK;
}
static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(IDirect3DTexture8 *iface, UINT Level,
D3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags)
static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(IDirect3DTexture8 *iface, UINT level,
D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
{
IDirect3DTexture8Impl *This = impl_from_IDirect3DTexture8(iface);
IDirect3DTexture8Impl *texture = impl_from_IDirect3DTexture8(iface);
struct wined3d_resource *sub_resource;
HRESULT hr;
TRACE("iface %p, level %u, locked_rect %p, rect %p, flags %#x.\n",
iface, Level, pLockedRect, pRect, Flags);
iface, level, locked_rect, rect, flags);
wined3d_mutex_lock();
hr = IWineD3DTexture_Map(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
hr = D3DERR_INVALIDCALL;
else
hr = IDirect3DSurface8_LockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource),
locked_rect, rect, flags);
wined3d_mutex_unlock();
return hr;

View File

@ -315,15 +315,22 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(IDirect3DTexture9 *i
return D3D_OK;
}
static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) {
IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(IDirect3DTexture9 *iface,
UINT level, D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
{
IDirect3DTexture9Impl *texture = (IDirect3DTexture9Impl *)iface;
struct wined3d_resource *sub_resource;
HRESULT hr;
TRACE("iface %p, level %u, locked_rect %p, rect %p, flags %#x.\n",
iface, Level, pLockedRect, pRect, Flags);
iface, level, locked_rect, rect, flags);
wined3d_mutex_lock();
hr = IWineD3DTexture_Map(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
hr = D3DERR_INVALIDCALL;
else
hr = IDirect3DSurface9_LockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource),
locked_rect, rect, flags);
wined3d_mutex_unlock();
return hr;

View File

@ -361,24 +361,6 @@ static struct wined3d_resource * WINAPI IWineD3DTextureImpl_GetSubResource(IWine
return basetexture_get_sub_resource(texture, sub_resource_idx);
}
static HRESULT WINAPI IWineD3DTextureImpl_Map(IWineD3DTexture *iface,
UINT sub_resource_idx, WINED3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
struct wined3d_resource *sub_resource;
TRACE("iface %p, sub_resource_idx %u, locked_rect %p, rect %s, flags %#x.\n",
iface, sub_resource_idx, locked_rect, wine_dbgstr_rect(rect), flags);
if (!(sub_resource = basetexture_get_sub_resource(texture, sub_resource_idx)))
{
WARN("Failed to get sub-resource.\n");
return WINED3DERR_INVALIDCALL;
}
return IWineD3DSurface_Map((IWineD3DSurface *)surface_from_resource(sub_resource), locked_rect, rect, flags);
}
static HRESULT WINAPI IWineD3DTextureImpl_Unmap(IWineD3DTexture *iface, UINT sub_resource_idx)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@ -439,7 +421,6 @@ static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
IWineD3DTextureImpl_IsCondNP2,
IWineD3DTextureImpl_GetSubResource,
/* IWineD3DTexture */
IWineD3DTextureImpl_Map,
IWineD3DTextureImpl_Unmap,
IWineD3DTextureImpl_AddDirtyRect
};

View File

@ -2370,12 +2370,6 @@ interface IWineD3DBaseTexture : IWineD3DResource
]
interface IWineD3DTexture : IWineD3DBaseTexture
{
HRESULT Map(
[in] UINT sub_resource_idx,
[out] WINED3DLOCKED_RECT *locked_rect,
[in] const RECT *rect,
[in] DWORD flags
);
HRESULT Unmap(
[in] UINT sub_resource_idx
);