d3d8: Use wined3d_texture_get_sub_resource_parent() in d3d8_texture_cube_GetCubeMapSurface().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
039c1536f8
commit
301050b8db
|
@ -631,7 +631,6 @@ static HRESULT WINAPI d3d8_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture8
|
||||||
D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface8 **surface)
|
D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface8 **surface)
|
||||||
{
|
{
|
||||||
struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface);
|
struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface);
|
||||||
struct wined3d_resource *sub_resource;
|
|
||||||
struct d3d8_surface *surface_impl;
|
struct d3d8_surface *surface_impl;
|
||||||
UINT sub_resource_idx;
|
UINT sub_resource_idx;
|
||||||
DWORD level_count;
|
DWORD level_count;
|
||||||
|
@ -647,13 +646,12 @@ static HRESULT WINAPI d3d8_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture8
|
||||||
}
|
}
|
||||||
|
|
||||||
sub_resource_idx = level_count * face + level;
|
sub_resource_idx = level_count * face + level;
|
||||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, sub_resource_idx)))
|
||||||
{
|
{
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
return D3DERR_INVALIDCALL;
|
return D3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
surface_impl = wined3d_resource_get_parent(sub_resource);
|
|
||||||
*surface = &surface_impl->IDirect3DSurface8_iface;
|
*surface = &surface_impl->IDirect3DSurface8_iface;
|
||||||
IDirect3DSurface8_AddRef(*surface);
|
IDirect3DSurface8_AddRef(*surface);
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
Loading…
Reference in New Issue