wined3d: Get rid of IWineD3DCubeTexture::Unmap().
This commit is contained in:
parent
3ac924a2da
commit
3494106d77
|
@ -330,17 +330,21 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(IDirect3DCubeTexture8 *
|
|||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(IDirect3DCubeTexture8 *iface,
|
||||
D3DCUBEMAP_FACES FaceType, UINT Level)
|
||||
D3DCUBEMAP_FACES face, UINT level)
|
||||
{
|
||||
IDirect3DCubeTexture8Impl *This = impl_from_IDirect3DCubeTexture8(iface);
|
||||
IDirect3DCubeTexture8Impl *texture = impl_from_IDirect3DCubeTexture8(iface);
|
||||
struct wined3d_resource *sub_resource;
|
||||
UINT sub_resource_idx;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, face %#x, level %u.\n", iface, FaceType, Level);
|
||||
TRACE("iface %p, face %#x, level %u.\n", iface, face, level);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
sub_resource_idx = IWineD3DCubeTexture_GetLevelCount(This->wineD3DCubeTexture) * FaceType + Level;
|
||||
hr = IWineD3DCubeTexture_Unmap(This->wineD3DCubeTexture, sub_resource_idx);
|
||||
sub_resource_idx = IWineD3DCubeTexture_GetLevelCount(texture->wineD3DCubeTexture) * face + level;
|
||||
if (!(sub_resource = IWineD3DCubeTexture_GetSubResource(texture->wineD3DCubeTexture, sub_resource_idx)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface8_UnlockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource));
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -345,17 +345,21 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_LockRect(IDirect3DCubeTexture9 *
|
|||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DCubeTexture9Impl_UnlockRect(IDirect3DCubeTexture9 *iface,
|
||||
D3DCUBEMAP_FACES FaceType, UINT Level)
|
||||
D3DCUBEMAP_FACES face, UINT level)
|
||||
{
|
||||
IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl *)iface;
|
||||
IDirect3DCubeTexture9Impl *texture = (IDirect3DCubeTexture9Impl *)iface;
|
||||
struct wined3d_resource *sub_resource;
|
||||
UINT sub_resource_idx;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, face %#x, level %u.\n", iface, FaceType, Level);
|
||||
TRACE("iface %p, face %#x, level %u.\n", iface, face, level);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
sub_resource_idx = IWineD3DCubeTexture_GetLevelCount(This->wineD3DCubeTexture) * FaceType + Level;
|
||||
hr = IWineD3DCubeTexture_Unmap(This->wineD3DCubeTexture, sub_resource_idx);
|
||||
sub_resource_idx = IWineD3DCubeTexture_GetLevelCount(texture->wineD3DCubeTexture) * face + level;
|
||||
if (!(sub_resource = IWineD3DCubeTexture_GetSubResource(texture->wineD3DCubeTexture, sub_resource_idx)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface9_UnlockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource));
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -336,24 +336,6 @@ static struct wined3d_resource * WINAPI IWineD3DCubeTextureImpl_GetSubResource(I
|
|||
return basetexture_get_sub_resource(texture, sub_resource_idx);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DCubeTextureImpl_Unmap(IWineD3DCubeTexture *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 IWineD3DCubeTextureImpl_AddDirtyRect(IWineD3DCubeTexture *iface,
|
||||
WINED3DCUBEMAP_FACES face, const RECT *dirty_rect)
|
||||
{
|
||||
|
@ -401,7 +383,6 @@ static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
|
|||
IWineD3DCubeTextureImpl_IsCondNP2,
|
||||
IWineD3DCubeTextureImpl_GetSubResource,
|
||||
/* IWineD3DCubeTexture */
|
||||
IWineD3DCubeTextureImpl_Unmap,
|
||||
IWineD3DCubeTextureImpl_AddDirtyRect
|
||||
};
|
||||
|
||||
|
|
|
@ -2382,9 +2382,6 @@ interface IWineD3DTexture : IWineD3DBaseTexture
|
|||
]
|
||||
interface IWineD3DCubeTexture : IWineD3DBaseTexture
|
||||
{
|
||||
HRESULT Unmap(
|
||||
[in] UINT sub_resource_idx
|
||||
);
|
||||
HRESULT AddDirtyRect(
|
||||
[in] WINED3DCUBEMAP_FACES face,
|
||||
[in] const RECT *dirty_rect
|
||||
|
|
Loading…
Reference in New Issue