mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
wined3d: Pass an IWineD3DBaseTextureImpl pointer to basetexture_unload().
This commit is contained in:
parent
7bc7caf423
commit
47fcc00cce
5 changed files with 16 additions and 18 deletions
|
@ -76,7 +76,7 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UIN
|
|||
|
||||
void basetexture_cleanup(IWineD3DBaseTexture *iface)
|
||||
{
|
||||
basetexture_unload(iface);
|
||||
basetexture_unload((IWineD3DBaseTextureImpl *)iface);
|
||||
HeapFree(GetProcessHeap(), 0, ((IWineD3DBaseTextureImpl *)iface)->baseTexture.sub_resources);
|
||||
resource_cleanup((IWineD3DResource *)iface);
|
||||
}
|
||||
|
@ -103,30 +103,28 @@ static void gltexture_delete(struct gl_texture *tex)
|
|||
tex->name = 0;
|
||||
}
|
||||
|
||||
void basetexture_unload(IWineD3DBaseTexture *iface)
|
||||
void basetexture_unload(IWineD3DBaseTextureImpl *texture)
|
||||
{
|
||||
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
|
||||
IWineD3DDeviceImpl *device = This->resource.device;
|
||||
IWineD3DDeviceImpl *device = texture->resource.device;
|
||||
struct wined3d_context *context = NULL;
|
||||
|
||||
if (This->baseTexture.texture_rgb.name || This->baseTexture.texture_srgb.name)
|
||||
if (texture->baseTexture.texture_rgb.name || texture->baseTexture.texture_srgb.name)
|
||||
{
|
||||
context = context_acquire(device, NULL);
|
||||
}
|
||||
|
||||
if(This->baseTexture.texture_rgb.name) {
|
||||
gltexture_delete(&This->baseTexture.texture_rgb);
|
||||
}
|
||||
if(This->baseTexture.texture_srgb.name) {
|
||||
gltexture_delete(&This->baseTexture.texture_srgb);
|
||||
}
|
||||
if (texture->baseTexture.texture_rgb.name)
|
||||
gltexture_delete(&texture->baseTexture.texture_rgb);
|
||||
|
||||
if (texture->baseTexture.texture_srgb.name)
|
||||
gltexture_delete(&texture->baseTexture.texture_srgb);
|
||||
|
||||
if (context) context_release(context);
|
||||
|
||||
This->baseTexture.texture_rgb.dirty = TRUE;
|
||||
This->baseTexture.texture_srgb.dirty = TRUE;
|
||||
texture->baseTexture.texture_rgb.dirty = TRUE;
|
||||
texture->baseTexture.texture_srgb.dirty = TRUE;
|
||||
|
||||
resource_unload((IWineD3DResourceImpl *)This);
|
||||
resource_unload((IWineD3DResourceImpl *)texture);
|
||||
}
|
||||
|
||||
DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew)
|
||||
|
|
|
@ -229,7 +229,7 @@ static void WINAPI IWineD3DCubeTextureImpl_UnLoad(IWineD3DCubeTexture *iface)
|
|||
surface_set_texture_name(surface, 0, FALSE);
|
||||
}
|
||||
|
||||
basetexture_unload((IWineD3DBaseTexture *)iface);
|
||||
basetexture_unload((IWineD3DBaseTextureImpl *)This);
|
||||
}
|
||||
|
||||
static WINED3DRESOURCETYPE WINAPI IWineD3DCubeTextureImpl_GetType(IWineD3DCubeTexture *iface) {
|
||||
|
|
|
@ -220,7 +220,7 @@ static void WINAPI IWineD3DTextureImpl_UnLoad(IWineD3DTexture *iface) {
|
|||
surface_set_texture_name(surface, 0, TRUE); /* delete srgb name */
|
||||
}
|
||||
|
||||
basetexture_unload((IWineD3DBaseTexture *)iface);
|
||||
basetexture_unload((IWineD3DBaseTextureImpl *)This);
|
||||
}
|
||||
|
||||
static WINED3DRESOURCETYPE WINAPI IWineD3DTextureImpl_GetType(IWineD3DTexture *iface) {
|
||||
|
|
|
@ -184,7 +184,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_UnLoad(IWineD3DVolumeTexture *iface
|
|||
IWineD3DVolume_UnLoad((IWineD3DVolume *)This->baseTexture.sub_resources[i]);
|
||||
}
|
||||
|
||||
basetexture_unload((IWineD3DBaseTexture *)iface);
|
||||
basetexture_unload((IWineD3DBaseTextureImpl *)This);
|
||||
}
|
||||
|
||||
static WINED3DRESOURCETYPE WINAPI IWineD3DVolumeTextureImpl_GetType(IWineD3DVolumeTexture *iface) {
|
||||
|
|
|
@ -1928,7 +1928,7 @@ HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface,
|
|||
WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN;
|
||||
BOOL basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPEC_HIDDEN;
|
||||
DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD new_lod) DECLSPEC_HIDDEN;
|
||||
void basetexture_unload(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN;
|
||||
void basetexture_unload(IWineD3DBaseTextureImpl *texture) DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* IWineD3DTexture implementation structure (extends IWineD3DBaseTextureImpl)
|
||||
|
|
Loading…
Reference in a new issue