wined3d: Get rid of IWineD3DTexture::Unmap().
This commit is contained in:
parent
b77a661515
commit
13b05b9dbe
|
@ -321,15 +321,19 @@ static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(IDirect3DTexture8 *iface, U
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(IDirect3DTexture8 *iface, UINT Level)
|
static HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(IDirect3DTexture8 *iface, UINT level)
|
||||||
{
|
{
|
||||||
IDirect3DTexture8Impl *This = impl_from_IDirect3DTexture8(iface);
|
IDirect3DTexture8Impl *texture = impl_from_IDirect3DTexture8(iface);
|
||||||
|
struct wined3d_resource *sub_resource;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("iface %p, level %u.\n", iface, Level);
|
TRACE("iface %p, level %u.\n", iface, level);
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = IWineD3DTexture_Unmap(This->wineD3DTexture, Level);
|
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
|
||||||
|
hr = D3DERR_INVALIDCALL;
|
||||||
|
else
|
||||||
|
hr = IDirect3DSurface8_UnlockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource));
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
|
@ -336,14 +336,19 @@ static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(IDirect3DTexture9 *iface,
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(LPDIRECT3DTEXTURE9 iface, UINT Level) {
|
static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(IDirect3DTexture9 *iface, UINT level)
|
||||||
IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
{
|
||||||
|
IDirect3DTexture9Impl *texture = (IDirect3DTexture9Impl *)iface;
|
||||||
|
struct wined3d_resource *sub_resource;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("iface %p, level %u.\n", iface, Level);
|
TRACE("iface %p, level %u.\n", iface, level);
|
||||||
|
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
hr = IWineD3DTexture_Unmap(This->wineD3DTexture, Level);
|
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
|
||||||
|
hr = D3DERR_INVALIDCALL;
|
||||||
|
else
|
||||||
|
hr = IDirect3DSurface9_UnlockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource));
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
|
@ -361,22 +361,6 @@ static struct wined3d_resource * WINAPI IWineD3DTextureImpl_GetSubResource(IWine
|
||||||
return basetexture_get_sub_resource(texture, sub_resource_idx);
|
return basetexture_get_sub_resource(texture, sub_resource_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI IWineD3DTextureImpl_Unmap(IWineD3DTexture *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 IWineD3DSurface_Unmap((IWineD3DSurface *)surface_from_resource(sub_resource));
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRect(IWineD3DTexture *iface, const RECT *dirty_rect)
|
static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRect(IWineD3DTexture *iface, const RECT *dirty_rect)
|
||||||
{
|
{
|
||||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||||
|
@ -421,7 +405,6 @@ static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
|
||||||
IWineD3DTextureImpl_IsCondNP2,
|
IWineD3DTextureImpl_IsCondNP2,
|
||||||
IWineD3DTextureImpl_GetSubResource,
|
IWineD3DTextureImpl_GetSubResource,
|
||||||
/* IWineD3DTexture */
|
/* IWineD3DTexture */
|
||||||
IWineD3DTextureImpl_Unmap,
|
|
||||||
IWineD3DTextureImpl_AddDirtyRect
|
IWineD3DTextureImpl_AddDirtyRect
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2370,9 +2370,6 @@ interface IWineD3DBaseTexture : IWineD3DResource
|
||||||
]
|
]
|
||||||
interface IWineD3DTexture : IWineD3DBaseTexture
|
interface IWineD3DTexture : IWineD3DBaseTexture
|
||||||
{
|
{
|
||||||
HRESULT Unmap(
|
|
||||||
[in] UINT sub_resource_idx
|
|
||||||
);
|
|
||||||
HRESULT AddDirtyRect(
|
HRESULT AddDirtyRect(
|
||||||
[in] const RECT *dirty_rect
|
[in] const RECT *dirty_rect
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue