wined3d: Get rid of IWineD3DVolumeTexture::Unmap().

This commit is contained in:
Henri Verbeet 2011-03-14 21:02:58 +01:00 committed by Alexandre Julliard
parent 4c3d55f10e
commit e409b83bcb
5 changed files with 27 additions and 33 deletions

View File

@ -375,11 +375,17 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
return hr;
}
static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT sub_resource)
static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT sub_resource_idx)
{
TRACE("iface %p, sub_resource %u.\n", iface, sub_resource);
struct d3d10_texture3d *texture = (struct d3d10_texture3d *)iface;
struct wined3d_resource *sub_resource;
IWineD3DVolumeTexture_Unmap(((struct d3d10_texture3d *)iface)->wined3d_texture, sub_resource);
TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
if (!(sub_resource = IWineD3DVolumeTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
return;
IWineD3DVolume_Unmap(wined3d_volume_from_resource(sub_resource));
}
static void STDMETHODCALLTYPE d3d10_texture3d_GetDesc(ID3D10Texture3D *iface, D3D10_TEXTURE3D_DESC *desc)

View File

@ -298,14 +298,19 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(IDirect3DVolumeTexture
return hr;
}
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level) {
IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(IDirect3DVolumeTexture8 *iface, UINT level)
{
IDirect3DVolumeTexture8Impl *texture = (IDirect3DVolumeTexture8Impl *)iface;
struct wined3d_resource *sub_resource;
HRESULT hr;
TRACE("iface %p, level %u.\n", iface, Level);
TRACE("iface %p, level %u.\n", iface, level);
wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_Unmap(This->wineD3DVolumeTexture, Level);
if (!(sub_resource = IWineD3DVolumeTexture_GetSubResource(texture->wineD3DVolumeTexture, level)))
hr = D3DERR_INVALIDCALL;
else
hr = IDirect3DVolume8_UnlockBox((IDirect3DVolume8 *)wined3d_resource_get_parent(sub_resource));
wined3d_mutex_unlock();
return hr;

View File

@ -360,16 +360,19 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_LockBox(IDirect3DVolumeTexture
return hr;
}
static HRESULT WINAPI IDirect3DVolumeTexture9Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level) {
IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface;
static HRESULT WINAPI IDirect3DVolumeTexture9Impl_UnlockBox(IDirect3DVolumeTexture9 *iface, UINT level)
{
IDirect3DVolumeTexture9Impl *texture = (IDirect3DVolumeTexture9Impl *)iface;
struct wined3d_resource *sub_resource;
HRESULT hr;
TRACE("iface %p, level %u.\n", iface, Level);
TRACE("iface %p, level %u.\n", iface, level);
wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_Unmap(This->wineD3DVolumeTexture, Level);
if (!(sub_resource = IWineD3DVolumeTexture_GetSubResource(texture->wineD3DVolumeTexture, level)))
hr = D3DERR_INVALIDCALL;
else
hr = IDirect3DVolume9_UnlockBox((IDirect3DVolume9 *)wined3d_resource_get_parent(sub_resource));
wined3d_mutex_unlock();
return hr;

View File

@ -273,22 +273,6 @@ static struct wined3d_resource * WINAPI IWineD3DVolumeTextureImpl_GetSubResource
return basetexture_get_sub_resource(texture, sub_resource_idx);
}
static HRESULT WINAPI IWineD3DVolumeTextureImpl_Unmap(IWineD3DVolumeTexture *iface, UINT sub_resource_idx)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
struct wined3d_resource *sub_resource;
TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
if (!(sub_resource = basetexture_get_sub_resource(texture, sub_resource_idx)))
{
WARN("Failed to get sub-resource.\n");
return WINED3DERR_INVALIDCALL;
}
return IWineD3DVolume_Unmap((IWineD3DVolume *)volume_from_resource(sub_resource));
}
static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTexture *iface, const WINED3DBOX *dirty_box)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@ -333,7 +317,6 @@ static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
IWineD3DVolumeTextureImpl_IsCondNP2,
IWineD3DVolumeTextureImpl_GetSubResource,
/* volume texture */
IWineD3DVolumeTextureImpl_Unmap,
IWineD3DVolumeTextureImpl_AddDirtyBox
};

View File

@ -2395,9 +2395,6 @@ interface IWineD3DCubeTexture : IWineD3DBaseTexture
]
interface IWineD3DVolumeTexture : IWineD3DBaseTexture
{
HRESULT Unmap(
[in] UINT sub_resource_idx
);
HRESULT AddDirtyBox(
[in] const WINED3DBOX *dirty_box
);