forked from Mirrors/wine-wine
wined3d: Remove COM from the texture implementation.
parent
87087f379f
commit
fd8e18bd2b
|
@ -100,7 +100,7 @@ struct d3d10_texture3d
|
|||
const struct ID3D10Texture3DVtbl *vtbl;
|
||||
LONG refcount;
|
||||
|
||||
IWineD3DBaseTexture *wined3d_texture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
D3D10_TEXTURE3D_DESC desc;
|
||||
};
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ static ULONG STDMETHODCALLTYPE d3d10_texture3d_AddRef(ID3D10Texture3D *iface)
|
|||
TRACE("%p increasing refcount to %u.\n", texture, refcount);
|
||||
|
||||
if (refcount == 1)
|
||||
IWineD3DBaseTexture_AddRef(texture->wined3d_texture);
|
||||
wined3d_texture_incref(texture->wined3d_texture);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ static ULONG STDMETHODCALLTYPE d3d10_texture3d_Release(ID3D10Texture3D *iface)
|
|||
TRACE("%p decreasing refcount to %u.\n", texture, refcount);
|
||||
|
||||
if (!refcount)
|
||||
IWineD3DBaseTexture_Release(texture->wined3d_texture);
|
||||
wined3d_texture_decref(texture->wined3d_texture);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
|
|||
if (map_flags)
|
||||
FIXME("Ignoring map_flags %#x.\n", map_flags);
|
||||
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
||||
hr = E_INVALIDARG;
|
||||
else if (SUCCEEDED(hr = IWineD3DVolume_Map(wined3d_volume_from_resource(sub_resource),
|
||||
&wined3d_map_desc, NULL, 0)))
|
||||
|
@ -381,7 +381,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT
|
|||
|
||||
TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
|
||||
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
||||
return;
|
||||
|
||||
IWineD3DVolume_Unmap(wined3d_volume_from_resource(sub_resource));
|
||||
|
|
|
@ -60,7 +60,7 @@ static ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(IDirect3DCubeTexture8 *ifac
|
|||
{
|
||||
IUnknown_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_AddRef(This->wined3d_texture);
|
||||
wined3d_texture_incref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ static ULONG WINAPI IDirect3DCubeTexture8Impl_Release(IDirect3DCubeTexture8 *ifa
|
|||
TRACE("Releasing child %p.\n", This->wined3d_texture);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_Release(This->wined3d_texture);
|
||||
wined3d_texture_decref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -115,7 +115,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_SetPrivateData(IDirect3DCubeText
|
|||
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetPrivateData(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
hr = wined3d_texture_set_private_data(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -131,7 +131,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetPrivateData(IDirect3DCubeText
|
|||
iface, debugstr_guid(refguid), pData, pSizeOfData);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_GetPrivateData(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
hr = wined3d_texture_get_private_data(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -146,7 +146,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_FreePrivateData(IDirect3DCubeTex
|
|||
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_FreePrivateData(This->wined3d_texture, refguid);
|
||||
hr = wined3d_texture_free_private_data(This->wined3d_texture, refguid);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -161,7 +161,7 @@ static DWORD WINAPI IDirect3DCubeTexture8Impl_SetPriority(IDirect3DCubeTexture8
|
|||
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetPriority(This->wined3d_texture, PriorityNew);
|
||||
ret = wined3d_texture_set_priority(This->wined3d_texture, PriorityNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -175,7 +175,7 @@ static DWORD WINAPI IDirect3DCubeTexture8Impl_GetPriority(IDirect3DCubeTexture8
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetPriority(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_priority(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -188,7 +188,7 @@ static void WINAPI IDirect3DCubeTexture8Impl_PreLoad(IDirect3DCubeTexture8 *ifac
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_PreLoad(This->wined3d_texture);
|
||||
wined3d_texture_preload(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DCubeTexture8Impl_GetType(IDirect3DCubeTex
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
type = IWineD3DBaseTexture_GetType(This->wined3d_texture);
|
||||
type = wined3d_texture_get_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return type;
|
||||
|
@ -215,7 +215,7 @@ static DWORD WINAPI IDirect3DCubeTexture8Impl_SetLOD(IDirect3DCubeTexture8 *ifac
|
|||
TRACE("iface %p, lod %u.\n", iface, LODNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
lod = IWineD3DBaseTexture_SetLOD(This->wined3d_texture, LODNew);
|
||||
lod = wined3d_texture_set_lod(This->wined3d_texture, LODNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return lod;
|
||||
|
@ -229,7 +229,7 @@ static DWORD WINAPI IDirect3DCubeTexture8Impl_GetLOD(IDirect3DCubeTexture8 *ifac
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
lod = IWineD3DBaseTexture_GetLOD(This->wined3d_texture);
|
||||
lod = wined3d_texture_get_lod(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return lod;
|
||||
|
@ -243,7 +243,7 @@ static DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(IDirect3DCubeTexture
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
cnt = IWineD3DBaseTexture_GetLevelCount(This->wined3d_texture);
|
||||
cnt = wined3d_texture_get_level_count(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return cnt;
|
||||
|
@ -260,7 +260,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(IDirect3DCubeTextur
|
|||
TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
{
|
||||
|
@ -291,8 +291,8 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(IDirect3DCubeT
|
|||
TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, face, level, surface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
sub_resource_idx = IWineD3DBaseTexture_GetLevelCount(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
|
||||
sub_resource_idx = wined3d_texture_get_level_count(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
@ -318,8 +318,8 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(IDirect3DCubeTexture8 *
|
|||
iface, face, level, locked_rect, rect, flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
sub_resource_idx = IWineD3DBaseTexture_GetLevelCount(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
|
||||
sub_resource_idx = wined3d_texture_get_level_count(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface8_LockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource),
|
||||
|
@ -340,8 +340,8 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(IDirect3DCubeTexture8
|
|||
TRACE("iface %p, face %#x, level %u.\n", iface, face, level);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
sub_resource_idx = IWineD3DBaseTexture_GetLevelCount(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
|
||||
sub_resource_idx = wined3d_texture_get_level_count(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface8_UnlockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource));
|
||||
|
@ -361,7 +361,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(IDirect3DCubeTextur
|
|||
|
||||
wined3d_mutex_lock();
|
||||
if (!dirty_rect)
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, face, NULL);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, NULL);
|
||||
else
|
||||
{
|
||||
WINED3DBOX dirty_region;
|
||||
|
@ -372,7 +372,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(IDirect3DCubeTextur
|
|||
dirty_region.Bottom = dirty_rect->bottom;
|
||||
dirty_region.Front = 0;
|
||||
dirty_region.Back = 1;
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, face, &dirty_region);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, &dirty_region);
|
||||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
|
|
@ -324,9 +324,7 @@ struct IDirect3DBaseTexture8Impl
|
|||
/* IUnknown fields */
|
||||
const IDirect3DBaseTexture8Vtbl *lpVtbl;
|
||||
LONG ref;
|
||||
|
||||
/* IDirect3DResource8 fields */
|
||||
IWineD3DBaseTexture *wineD3DBaseTexture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
};
|
||||
|
||||
/* --------------------- */
|
||||
|
@ -340,7 +338,7 @@ struct IDirect3DCubeTexture8Impl
|
|||
{
|
||||
IDirect3DCubeTexture8 IDirect3DCubeTexture8_iface;
|
||||
LONG ref;
|
||||
IWineD3DBaseTexture *wined3d_texture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
IDirect3DDevice8 *parentDevice;
|
||||
};
|
||||
|
||||
|
@ -358,7 +356,7 @@ struct IDirect3DTexture8Impl
|
|||
{
|
||||
IDirect3DTexture8 IDirect3DTexture8_iface;
|
||||
LONG ref;
|
||||
IWineD3DBaseTexture *wined3d_texture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
IDirect3DDevice8 *parentDevice;
|
||||
};
|
||||
|
||||
|
@ -376,7 +374,7 @@ struct IDirect3DVolumeTexture8Impl
|
|||
{
|
||||
IDirect3DVolumeTexture8 IDirect3DVolumeTexture8_iface;
|
||||
LONG ref;
|
||||
IWineD3DBaseTexture *wined3d_texture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
IDirect3DDevice8 *parentDevice;
|
||||
};
|
||||
|
||||
|
|
|
@ -984,15 +984,17 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(IDirect3DDevice8 *iface,
|
|||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice8Impl_UpdateTexture(IDirect3DDevice8 *iface,
|
||||
IDirect3DBaseTexture8 *pSourceTexture, IDirect3DBaseTexture8 *pDestinationTexture)
|
||||
IDirect3DBaseTexture8 *src_texture, IDirect3DBaseTexture8 *dst_texture)
|
||||
{
|
||||
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, src_texture %p, dst_texture %p.\n", iface, pSourceTexture, pDestinationTexture);
|
||||
TRACE("iface %p, src_texture %p, dst_texture %p.\n", iface, src_texture, dst_texture);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_UpdateTexture(This->WineD3DDevice, ((IDirect3DBaseTexture8Impl *)pSourceTexture)->wineD3DBaseTexture, ((IDirect3DBaseTexture8Impl *)pDestinationTexture)->wineD3DBaseTexture);
|
||||
hr = IWineD3DDevice_UpdateTexture(This->WineD3DDevice,
|
||||
((IDirect3DBaseTexture8Impl *)src_texture)->wined3d_texture,
|
||||
((IDirect3DBaseTexture8Impl *)dst_texture)->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -1608,7 +1610,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(IDirect3DDevice8 *iface,
|
|||
DWORD Stage, IDirect3DBaseTexture8 **ppTexture)
|
||||
{
|
||||
IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface);
|
||||
IWineD3DBaseTexture *retTexture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, ppTexture);
|
||||
|
@ -1618,7 +1620,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(IDirect3DDevice8 *iface,
|
|||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &retTexture);
|
||||
hr = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &wined3d_texture);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to get texture for stage %u, hr %#x.\n", Stage, hr);
|
||||
|
@ -1627,11 +1629,11 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(IDirect3DDevice8 *iface,
|
|||
return hr;
|
||||
}
|
||||
|
||||
if (retTexture)
|
||||
if (wined3d_texture)
|
||||
{
|
||||
*ppTexture = IWineD3DBaseTexture_GetParent(retTexture);
|
||||
*ppTexture = wined3d_texture_get_parent(wined3d_texture);
|
||||
IDirect3DBaseTexture8_AddRef(*ppTexture);
|
||||
IWineD3DBaseTexture_Release(retTexture);
|
||||
wined3d_texture_decref(wined3d_texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1652,7 +1654,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(IDirect3DDevice8 *iface, D
|
|||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_SetTexture(This->WineD3DDevice, Stage,
|
||||
pTexture==NULL ? NULL : ((IDirect3DBaseTexture8Impl *)pTexture)->wineD3DBaseTexture);
|
||||
pTexture ? ((IDirect3DBaseTexture8Impl *)pTexture)->wined3d_texture : NULL);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -61,7 +61,7 @@ static ULONG WINAPI IDirect3DTexture8Impl_AddRef(IDirect3DTexture8 *iface)
|
|||
{
|
||||
IDirect3DDevice8_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_AddRef(This->wined3d_texture);
|
||||
wined3d_texture_incref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ static ULONG WINAPI IDirect3DTexture8Impl_Release(IDirect3DTexture8 *iface)
|
|||
IDirect3DDevice8 *parentDevice = This->parentDevice;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_Release(This->wined3d_texture);
|
||||
wined3d_texture_decref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -114,7 +114,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(IDirect3DTexture8 *if
|
|||
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetPrivateData(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
hr = wined3d_texture_set_private_data(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -130,7 +130,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(IDirect3DTexture8 *if
|
|||
iface, debugstr_guid(refguid), pData, pSizeOfData);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_GetPrivateData(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
hr = wined3d_texture_get_private_data(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -145,7 +145,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(IDirect3DTexture8 *i
|
|||
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_FreePrivateData(This->wined3d_texture, refguid);
|
||||
hr = wined3d_texture_free_private_data(This->wined3d_texture, refguid);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -159,7 +159,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_SetPriority(IDirect3DTexture8 *iface,
|
|||
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetPriority(This->wined3d_texture, PriorityNew);
|
||||
ret = wined3d_texture_set_priority(This->wined3d_texture, PriorityNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -173,7 +173,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetPriority(IDirect3DTexture8 *iface)
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetPriority(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_priority(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -186,7 +186,7 @@ static void WINAPI IDirect3DTexture8Impl_PreLoad(IDirect3DTexture8 *iface)
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_PreLoad(This->wined3d_texture);
|
||||
wined3d_texture_preload(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(IDirect3DTexture8 *i
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
type = IWineD3DBaseTexture_GetType(This->wined3d_texture);
|
||||
type = wined3d_texture_get_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return type;
|
||||
|
@ -213,7 +213,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_SetLOD(IDirect3DTexture8 *iface, DWORD
|
|||
TRACE("iface %p, lod %u.\n", iface, LODNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetLOD(This->wined3d_texture, LODNew);
|
||||
ret = wined3d_texture_set_lod(This->wined3d_texture, LODNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -227,7 +227,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetLOD(IDirect3DTexture8 *iface)
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetLOD(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_lod(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -241,7 +241,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(IDirect3DTexture8 *iface
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetLevelCount(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_level_count(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -257,7 +257,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(IDirect3DTexture8 *ifac
|
|||
TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(IDirect3DTexture8 *i
|
|||
TRACE("iface %p, level %u, surface %p.\n", iface, level, surface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
@ -311,7 +311,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(IDirect3DTexture8 *iface, U
|
|||
iface, level, locked_rect, rect, flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface8_LockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource),
|
||||
|
@ -330,7 +330,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(IDirect3DTexture8 *iface,
|
|||
TRACE("iface %p, level %u.\n", iface, level);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface8_UnlockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource));
|
||||
|
@ -349,7 +349,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(IDirect3DTexture8 *ifac
|
|||
|
||||
wined3d_mutex_lock();
|
||||
if (!dirty_rect)
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, NULL);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, NULL);
|
||||
else
|
||||
{
|
||||
WINED3DBOX dirty_region;
|
||||
|
@ -360,7 +360,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(IDirect3DTexture8 *ifac
|
|||
dirty_region.Bottom = dirty_rect->bottom;
|
||||
dirty_region.Front = 0;
|
||||
dirty_region.Back = 1;
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, &dirty_region);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, &dirty_region);
|
||||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ static ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(IDirect3DVolumeTexture8 *
|
|||
{
|
||||
IDirect3DDevice8_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_AddRef(This->wined3d_texture);
|
||||
wined3d_texture_incref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ static ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(IDirect3DVolumeTexture8
|
|||
IDirect3DDevice8 *parentDevice = This->parentDevice;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_Release(This->wined3d_texture);
|
||||
wined3d_texture_decref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -113,7 +113,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(IDirect3DVolume
|
|||
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetPrivateData(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
hr = wined3d_texture_set_private_data(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -129,7 +129,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(IDirect3DVolume
|
|||
iface, debugstr_guid(refguid), pData, pSizeOfData);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_GetPrivateData(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
hr = wined3d_texture_get_private_data(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -144,7 +144,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(IDirect3DVolum
|
|||
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_FreePrivateData(This->wined3d_texture, refguid);
|
||||
hr = wined3d_texture_free_private_data(This->wined3d_texture, refguid);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -159,7 +159,7 @@ static DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(IDirect3DVolumeTextu
|
|||
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetPriority(This->wined3d_texture, PriorityNew);
|
||||
ret = wined3d_texture_set_priority(This->wined3d_texture, PriorityNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -173,7 +173,7 @@ static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(IDirect3DVolumeTextu
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetPriority(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_priority(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -186,7 +186,7 @@ static void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(IDirect3DVolumeTexture8 *
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_PreLoad(This->wined3d_texture);
|
||||
wined3d_texture_preload(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(IDirect3DVolum
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
type = IWineD3DBaseTexture_GetType(This->wined3d_texture);
|
||||
type = wined3d_texture_get_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return type;
|
||||
|
@ -213,7 +213,7 @@ static DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(IDirect3DVolumeTexture8 *
|
|||
TRACE("iface %p, lod %u.\n", iface, LODNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetLOD(This->wined3d_texture, LODNew);
|
||||
ret = wined3d_texture_set_lod(This->wined3d_texture, LODNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -227,7 +227,7 @@ static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(IDirect3DVolumeTexture8 *
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetLOD(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_lod(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -241,7 +241,7 @@ static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(IDirect3DVolumeTex
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetLevelCount(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_level_count(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -250,14 +250,14 @@ static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(IDirect3DVolumeTex
|
|||
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(IDirect3DVolumeTexture8 *iface,
|
||||
UINT level, D3DVOLUME_DESC *desc)
|
||||
{
|
||||
IDirect3DVolumeTexture8Impl *This = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
IDirect3DVolumeTexture8Impl *texture = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
struct wined3d_resource *sub_resource;
|
||||
HRESULT hr = D3D_OK;
|
||||
|
||||
TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(This->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
{
|
||||
|
@ -281,13 +281,13 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(IDirect3DVolumeTe
|
|||
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(IDirect3DVolumeTexture8 *iface,
|
||||
UINT level, IDirect3DVolume8 **volume)
|
||||
{
|
||||
IDirect3DVolumeTexture8Impl *This = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
IDirect3DVolumeTexture8Impl *texture = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
struct wined3d_resource *sub_resource;
|
||||
|
||||
TRACE("iface %p, level %u, volume %p.\n", iface, level, volume);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(This->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
@ -303,7 +303,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(IDirect3DVolume
|
|||
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(IDirect3DVolumeTexture8 *iface,
|
||||
UINT level, D3DLOCKED_BOX *locked_box, const D3DBOX *box, DWORD flags)
|
||||
{
|
||||
IDirect3DVolumeTexture8Impl *This = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
IDirect3DVolumeTexture8Impl *texture = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
struct wined3d_resource *sub_resource;
|
||||
HRESULT hr;
|
||||
|
||||
|
@ -311,7 +311,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(IDirect3DVolumeTexture
|
|||
iface, level, locked_box, box, flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(This->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DVolume8_LockBox((IDirect3DVolume8 *)wined3d_resource_get_parent(sub_resource),
|
||||
|
@ -324,14 +324,14 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(IDirect3DVolumeTexture
|
|||
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(IDirect3DVolumeTexture8 *iface,
|
||||
UINT level)
|
||||
{
|
||||
IDirect3DVolumeTexture8Impl *This = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
IDirect3DVolumeTexture8Impl *texture = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
struct wined3d_resource *sub_resource;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, level %u.\n", iface, level);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(This->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DVolume8_UnlockBox((IDirect3DVolume8 *)wined3d_resource_get_parent(sub_resource));
|
||||
|
@ -343,13 +343,13 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(IDirect3DVolumeTextu
|
|||
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(IDirect3DVolumeTexture8 *iface,
|
||||
const D3DBOX *dirty_box)
|
||||
{
|
||||
IDirect3DVolumeTexture8Impl *This = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
IDirect3DVolumeTexture8Impl *texture = impl_from_IDirect3DVolumeTexture8(iface);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, dirty_box %p.\n", iface, dirty_box);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(This->wined3d_texture, 0, (const WINED3DBOX *)dirty_box);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const WINED3DBOX *)dirty_box);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -56,7 +56,7 @@ static ULONG WINAPI IDirect3DCubeTexture9Impl_AddRef(LPDIRECT3DCUBETEXTURE9 ifac
|
|||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_AddRef(This->wined3d_texture);
|
||||
wined3d_texture_incref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ static ULONG WINAPI IDirect3DCubeTexture9Impl_Release(LPDIRECT3DCUBETEXTURE9 ifa
|
|||
TRACE("Releasing child %p.\n", This->wined3d_texture);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_Release(This->wined3d_texture);
|
||||
wined3d_texture_decref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -107,7 +107,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_SetPrivateData(LPDIRECT3DCUBETEX
|
|||
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetPrivateData(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
hr = wined3d_texture_set_private_data(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -121,7 +121,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetPrivateData(LPDIRECT3DCUBETEX
|
|||
iface, debugstr_guid(refguid), pData, pSizeOfData);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_GetPrivateData(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
hr = wined3d_texture_get_private_data(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -134,7 +134,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_FreePrivateData(LPDIRECT3DCUBETE
|
|||
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_FreePrivateData(This->wined3d_texture, refguid);
|
||||
hr = wined3d_texture_free_private_data(This->wined3d_texture, refguid);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -147,7 +147,7 @@ static DWORD WINAPI IDirect3DCubeTexture9Impl_SetPriority(LPDIRECT3DCUBETEXTURE9
|
|||
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetPriority(This->wined3d_texture, PriorityNew);
|
||||
ret = wined3d_texture_set_priority(This->wined3d_texture, PriorityNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -160,7 +160,7 @@ static DWORD WINAPI IDirect3DCubeTexture9Impl_GetPriority(LPDIRECT3DCUBETEXTURE9
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetPriority(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_priority(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -172,7 +172,7 @@ static void WINAPI IDirect3DCubeTexture9Impl_PreLoad(LPDIRECT3DCUBETEXTURE9 ifac
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_PreLoad(This->wined3d_texture);
|
||||
wined3d_texture_preload(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DCubeTexture9Impl_GetType(LPDIRECT3DCUBETE
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetType(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -197,7 +197,7 @@ static DWORD WINAPI IDirect3DCubeTexture9Impl_SetLOD(LPDIRECT3DCUBETEXTURE9 ifac
|
|||
TRACE("iface %p, lod %u.\n", iface, LODNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetLOD(This->wined3d_texture, LODNew);
|
||||
ret = wined3d_texture_set_lod(This->wined3d_texture, LODNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -210,7 +210,7 @@ static DWORD WINAPI IDirect3DCubeTexture9Impl_GetLOD(LPDIRECT3DCUBETEXTURE9 ifac
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetLOD(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_lod(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -223,7 +223,7 @@ static DWORD WINAPI IDirect3DCubeTexture9Impl_GetLevelCount(LPDIRECT3DCUBETEXTUR
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetLevelCount(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_level_count(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -236,7 +236,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_SetAutoGenFilterType(LPDIRECT3DC
|
|||
TRACE("iface %p, filter_type %#x.\n", iface, FilterType);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetAutoGenFilterType(This->wined3d_texture, (WINED3DTEXTUREFILTERTYPE)FilterType);
|
||||
hr = wined3d_texture_set_autogen_filter_type(This->wined3d_texture, (WINED3DTEXTUREFILTERTYPE)FilterType);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -249,7 +249,7 @@ static D3DTEXTUREFILTERTYPE WINAPI IDirect3DCubeTexture9Impl_GetAutoGenFilterTyp
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = (D3DTEXTUREFILTERTYPE)IWineD3DBaseTexture_GetAutoGenFilterType(This->wined3d_texture);
|
||||
ret = (D3DTEXTUREFILTERTYPE)wined3d_texture_get_autogen_filter_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -261,7 +261,7 @@ static void WINAPI IDirect3DCubeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DCUBE
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_GenerateMipSubLevels(This->wined3d_texture);
|
||||
wined3d_texture_generate_mipmaps(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetLevelDesc(IDirect3DCubeTextur
|
|||
TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
{
|
||||
|
@ -307,8 +307,8 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetCubeMapSurface(IDirect3DCubeT
|
|||
TRACE("iface %p, face %#x, level %u, surface %p.\n", iface, face, level, surface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
sub_resource_idx = IWineD3DBaseTexture_GetLevelCount(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
|
||||
sub_resource_idx = wined3d_texture_get_level_count(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
@ -333,8 +333,8 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_LockRect(IDirect3DCubeTexture9 *
|
|||
iface, face, level, locked_rect, rect, flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
sub_resource_idx = IWineD3DBaseTexture_GetLevelCount(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
|
||||
sub_resource_idx = wined3d_texture_get_level_count(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface9_LockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource),
|
||||
|
@ -355,8 +355,8 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_UnlockRect(IDirect3DCubeTexture9
|
|||
TRACE("iface %p, face %#x, level %u.\n", iface, face, level);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
sub_resource_idx = IWineD3DBaseTexture_GetLevelCount(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, sub_resource_idx)))
|
||||
sub_resource_idx = wined3d_texture_get_level_count(texture->wined3d_texture) * face + level;
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface9_UnlockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource));
|
||||
|
@ -376,7 +376,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_AddDirtyRect(IDirect3DCubeTextu
|
|||
|
||||
wined3d_mutex_lock();
|
||||
if (!dirty_rect)
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, face, NULL);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, NULL);
|
||||
else
|
||||
{
|
||||
WINED3DBOX dirty_region;
|
||||
|
@ -387,7 +387,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_AddDirtyRect(IDirect3DCubeTextu
|
|||
dirty_region.Bottom = dirty_rect->bottom;
|
||||
dirty_region.Front = 0;
|
||||
dirty_region.Back = 1;
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, face, &dirty_region);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, face, &dirty_region);
|
||||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
|
|
@ -313,12 +313,9 @@ HRESULT indexbuffer_init(IDirect3DIndexBuffer9Impl *buffer, IDirect3DDevice9Impl
|
|||
*/
|
||||
typedef struct IDirect3DBaseTexture9Impl
|
||||
{
|
||||
/* IUnknown fields */
|
||||
const IDirect3DBaseTexture9Vtbl *lpVtbl;
|
||||
LONG ref;
|
||||
|
||||
/* IDirect3DResource9 fields */
|
||||
IWineD3DBaseTexture *wineD3DBaseTexture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
} IDirect3DBaseTexture9Impl;
|
||||
|
||||
/* --------------------- */
|
||||
|
@ -332,7 +329,7 @@ typedef struct IDirect3DCubeTexture9Impl
|
|||
{
|
||||
const IDirect3DCubeTexture9Vtbl *lpVtbl;
|
||||
LONG ref;
|
||||
IWineD3DBaseTexture *wined3d_texture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
IDirect3DDevice9Ex *parentDevice;
|
||||
} IDirect3DCubeTexture9Impl;
|
||||
|
||||
|
@ -350,7 +347,7 @@ typedef struct IDirect3DTexture9Impl
|
|||
{
|
||||
const IDirect3DTexture9Vtbl *lpVtbl;
|
||||
LONG ref;
|
||||
IWineD3DBaseTexture *wined3d_texture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
IDirect3DDevice9Ex *parentDevice;
|
||||
} IDirect3DTexture9Impl;
|
||||
|
||||
|
@ -368,7 +365,7 @@ typedef struct IDirect3DVolumeTexture9Impl
|
|||
{
|
||||
const IDirect3DVolumeTexture9Vtbl *lpVtbl;
|
||||
LONG ref;
|
||||
IWineD3DBaseTexture *wined3d_texture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
IDirect3DDevice9Ex *parentDevice;
|
||||
} IDirect3DVolumeTexture9Impl;
|
||||
|
||||
|
|
|
@ -998,14 +998,18 @@ static HRESULT WINAPI IDirect3DDevice9Impl_UpdateSurface(LPDIRECT3DDEVICE9EX i
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_UpdateTexture(LPDIRECT3DDEVICE9EX iface, IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) {
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_UpdateTexture(IDirect3DDevice9Ex *iface,
|
||||
IDirect3DBaseTexture9 *src_texture, IDirect3DBaseTexture9 *dst_texture)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, src_texture %p, dst_texture %p.\n", iface, pSourceTexture, pDestinationTexture);
|
||||
TRACE("iface %p, src_texture %p, dst_texture %p.\n", iface, src_texture, dst_texture);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_UpdateTexture(This->WineD3DDevice, ((IDirect3DBaseTexture9Impl *)pSourceTexture)->wineD3DBaseTexture, ((IDirect3DBaseTexture9Impl *)pDestinationTexture)->wineD3DBaseTexture);
|
||||
hr = IWineD3DDevice_UpdateTexture(This->WineD3DDevice,
|
||||
((IDirect3DBaseTexture9Impl *)src_texture)->wined3d_texture,
|
||||
((IDirect3DBaseTexture9Impl *)dst_texture)->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -1604,7 +1608,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(IDirect3DDevice9Ex *iface,
|
|||
DWORD Stage, IDirect3DBaseTexture9 **ppTexture)
|
||||
{
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
IWineD3DBaseTexture *retTexture = NULL;
|
||||
struct wined3d_texture *wined3d_texture = NULL;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, ppTexture);
|
||||
|
@ -1614,18 +1618,18 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(IDirect3DDevice9Ex *iface,
|
|||
}
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &retTexture);
|
||||
if (SUCCEEDED(hr) && retTexture)
|
||||
hr = IWineD3DDevice_GetTexture(This->WineD3DDevice, Stage, &wined3d_texture);
|
||||
if (SUCCEEDED(hr) && wined3d_texture)
|
||||
{
|
||||
*ppTexture = IWineD3DBaseTexture_GetParent(retTexture);
|
||||
IWineD3DBaseTexture_AddRef(*ppTexture);
|
||||
IWineD3DBaseTexture_Release(retTexture);
|
||||
*ppTexture = wined3d_texture_get_parent(wined3d_texture);
|
||||
IDirect3DBaseTexture9_AddRef(*ppTexture);
|
||||
wined3d_texture_decref(wined3d_texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Call to get texture (%d) failed (%p)\n", Stage, retTexture);
|
||||
WARN("Call to get texture (%u) failed (%p).\n", Stage, wined3d_texture);
|
||||
}
|
||||
*ppTexture = NULL;
|
||||
}
|
||||
|
@ -1634,15 +1638,17 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetTexture(IDirect3DDevice9Ex *iface,
|
|||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(LPDIRECT3DDEVICE9EX iface, DWORD Stage, IDirect3DBaseTexture9* pTexture) {
|
||||
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
||||
static HRESULT WINAPI IDirect3DDevice9Impl_SetTexture(IDirect3DDevice9Ex *iface,
|
||||
DWORD stage, IDirect3DBaseTexture9 *texture)
|
||||
{
|
||||
IDirect3DDevice9Impl *device = (IDirect3DDevice9Impl *)iface;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, pTexture);
|
||||
TRACE("iface %p, stage %u, texture %p.\n", iface, stage, texture);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DDevice_SetTexture(This->WineD3DDevice, Stage,
|
||||
pTexture==NULL ? NULL:((IDirect3DBaseTexture9Impl *)pTexture)->wineD3DBaseTexture);
|
||||
hr = IWineD3DDevice_SetTexture(device->WineD3DDevice, stage,
|
||||
texture ? ((IDirect3DBaseTexture9Impl *)texture)->wined3d_texture : NULL);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -55,7 +55,7 @@ static ULONG WINAPI IDirect3DTexture9Impl_AddRef(LPDIRECT3DTEXTURE9 iface) {
|
|||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_AddRef(This->wined3d_texture);
|
||||
wined3d_texture_incref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ static ULONG WINAPI IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface) {
|
|||
IDirect3DDevice9Ex *parentDevice = This->parentDevice;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_Release(This->wined3d_texture);
|
||||
wined3d_texture_decref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -104,7 +104,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_SetPrivateData(LPDIRECT3DTEXTURE9 if
|
|||
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetPrivateData(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
hr = wined3d_texture_set_private_data(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -118,7 +118,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetPrivateData(LPDIRECT3DTEXTURE9 if
|
|||
iface, debugstr_guid(refguid), pData, pSizeOfData);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_GetPrivateData(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
hr = wined3d_texture_get_private_data(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -131,7 +131,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_FreePrivateData(LPDIRECT3DTEXTURE9 i
|
|||
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_FreePrivateData(This->wined3d_texture, refguid);
|
||||
hr = wined3d_texture_free_private_data(This->wined3d_texture, refguid);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -144,7 +144,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_SetPriority(LPDIRECT3DTEXTURE9 iface,
|
|||
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetPriority(This->wined3d_texture, PriorityNew);
|
||||
ret = wined3d_texture_set_priority(This->wined3d_texture, PriorityNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -157,7 +157,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetPriority(LPDIRECT3DTEXTURE9 iface)
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetPriority(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_priority(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -169,7 +169,7 @@ static void WINAPI IDirect3DTexture9Impl_PreLoad(LPDIRECT3DTEXTURE9 iface) {
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_PreLoad(This->wined3d_texture);
|
||||
wined3d_texture_preload(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DTexture9Impl_GetType(LPDIRECT3DTEXTURE9 i
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetType(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -194,7 +194,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_SetLOD(LPDIRECT3DTEXTURE9 iface, DWORD
|
|||
TRACE("iface %p, lod %u.\n", iface, LODNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_SetLOD(This->wined3d_texture, LODNew);
|
||||
ret = wined3d_texture_set_lod(This->wined3d_texture, LODNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -207,7 +207,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetLOD(LPDIRECT3DTEXTURE9 iface) {
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetLOD(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_lod(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -220,7 +220,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetLevelCount(LPDIRECT3DTEXTURE9 iface
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = IWineD3DBaseTexture_GetLevelCount(This->wined3d_texture);
|
||||
ret = wined3d_texture_get_level_count(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -233,7 +233,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_SetAutoGenFilterType(LPDIRECT3DTEXTU
|
|||
TRACE("iface %p, filter_type %#x.\n", iface, FilterType);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetAutoGenFilterType(This->wined3d_texture, (WINED3DTEXTUREFILTERTYPE)FilterType);
|
||||
hr = wined3d_texture_set_autogen_filter_type(This->wined3d_texture, (WINED3DTEXTUREFILTERTYPE)FilterType);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -246,7 +246,7 @@ static D3DTEXTUREFILTERTYPE WINAPI IDirect3DTexture9Impl_GetAutoGenFilterType(LP
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
ret = (D3DTEXTUREFILTERTYPE)IWineD3DBaseTexture_GetAutoGenFilterType(This->wined3d_texture);
|
||||
ret = (D3DTEXTUREFILTERTYPE)wined3d_texture_get_autogen_filter_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return ret;
|
||||
|
@ -258,7 +258,7 @@ static void WINAPI IDirect3DTexture9Impl_GenerateMipSubLevels(LPDIRECT3DTEXTURE9
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_GenerateMipSubLevels(This->wined3d_texture);
|
||||
wined3d_texture_generate_mipmaps(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetLevelDesc(IDirect3DTexture9 *ifac
|
|||
TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
{
|
||||
|
@ -302,7 +302,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(IDirect3DTexture9 *i
|
|||
TRACE("iface %p, level %u, surface %p.\n", iface, level, surface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
@ -326,7 +326,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(IDirect3DTexture9 *iface,
|
|||
iface, level, locked_rect, rect, flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface9_LockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource),
|
||||
|
@ -345,7 +345,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(IDirect3DTexture9 *iface,
|
|||
TRACE("iface %p, level %u.\n", iface, level);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DSurface9_UnlockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource));
|
||||
|
@ -364,7 +364,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(IDirect3DTexture9 *ifac
|
|||
|
||||
wined3d_mutex_lock();
|
||||
if (!dirty_rect)
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, NULL);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, NULL);
|
||||
else
|
||||
{
|
||||
WINED3DBOX dirty_region;
|
||||
|
@ -375,7 +375,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(IDirect3DTexture9 *ifac
|
|||
dirty_region.Bottom = dirty_rect->bottom;
|
||||
dirty_region.Front = 0;
|
||||
dirty_region.Back = 1;
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, &dirty_region);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, &dirty_region);
|
||||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ static ULONG WINAPI IDirect3DVolumeTexture9Impl_AddRef(LPDIRECT3DVOLUMETEXTURE9
|
|||
{
|
||||
IDirect3DDevice9Ex_AddRef(This->parentDevice);
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_AddRef(This->wined3d_texture);
|
||||
wined3d_texture_incref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ static ULONG WINAPI IDirect3DVolumeTexture9Impl_Release(LPDIRECT3DVOLUMETEXTURE9
|
|||
IDirect3DDevice9Ex *parentDevice = This->parentDevice;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_Release(This->wined3d_texture);
|
||||
wined3d_texture_decref(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
/* Release the device last, as it may cause the device to be destroyed. */
|
||||
|
@ -103,7 +103,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_SetPrivateData(LPDIRECT3DVOLUM
|
|||
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetPrivateData(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
hr = wined3d_texture_set_private_data(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -117,7 +117,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetPrivateData(LPDIRECT3DVOLUM
|
|||
iface, debugstr_guid(refguid), pData, pSizeOfData);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_GetPrivateData(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
hr = wined3d_texture_get_private_data(This->wined3d_texture, refguid, pData, pSizeOfData);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -130,7 +130,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_FreePrivateData(LPDIRECT3DVOLU
|
|||
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_FreePrivateData(This->wined3d_texture, refguid);
|
||||
hr = wined3d_texture_free_private_data(This->wined3d_texture, refguid);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -143,7 +143,7 @@ static DWORD WINAPI IDirect3DVolumeTexture9Impl_SetPriority(LPDIRECT3DVOLUMETEXT
|
|||
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
priority = IWineD3DBaseTexture_SetPriority(This->wined3d_texture, PriorityNew);
|
||||
priority = wined3d_texture_set_priority(This->wined3d_texture, PriorityNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return priority;
|
||||
|
@ -156,7 +156,7 @@ static DWORD WINAPI IDirect3DVolumeTexture9Impl_GetPriority(LPDIRECT3DVOLUMETEXT
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
priority = IWineD3DBaseTexture_GetPriority(This->wined3d_texture);
|
||||
priority = wined3d_texture_get_priority(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return priority;
|
||||
|
@ -168,7 +168,7 @@ static void WINAPI IDirect3DVolumeTexture9Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE9
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_PreLoad(This->wined3d_texture);
|
||||
wined3d_texture_preload(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture9Impl_GetType(LPDIRECT3DVOLU
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
type = IWineD3DBaseTexture_GetType(This->wined3d_texture);
|
||||
type = wined3d_texture_get_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return type;
|
||||
|
@ -193,7 +193,7 @@ static DWORD WINAPI IDirect3DVolumeTexture9Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE9
|
|||
TRACE("iface %p, lod %u.\n", iface, LODNew);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
lod = IWineD3DBaseTexture_SetLOD(This->wined3d_texture, LODNew);
|
||||
lod = wined3d_texture_set_lod(This->wined3d_texture, LODNew);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return lod;
|
||||
|
@ -206,7 +206,7 @@ static DWORD WINAPI IDirect3DVolumeTexture9Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE9
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
lod = IWineD3DBaseTexture_GetLOD(This->wined3d_texture);
|
||||
lod = wined3d_texture_get_lod(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return lod;
|
||||
|
@ -219,7 +219,7 @@ static DWORD WINAPI IDirect3DVolumeTexture9Impl_GetLevelCount(LPDIRECT3DVOLUMETE
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
level_count = IWineD3DBaseTexture_GetLevelCount(This->wined3d_texture);
|
||||
level_count = wined3d_texture_get_level_count(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return level_count;
|
||||
|
@ -232,7 +232,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_SetAutoGenFilterType(LPDIRECT3
|
|||
TRACE("iface %p, filter_type %#x.\n", iface, FilterType);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_SetAutoGenFilterType(This->wined3d_texture, (WINED3DTEXTUREFILTERTYPE) FilterType);
|
||||
hr = wined3d_texture_set_autogen_filter_type(This->wined3d_texture, (WINED3DTEXTUREFILTERTYPE)FilterType);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
@ -245,7 +245,7 @@ static D3DTEXTUREFILTERTYPE WINAPI IDirect3DVolumeTexture9Impl_GetAutoGenFilterT
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
filter_type = (D3DTEXTUREFILTERTYPE)IWineD3DBaseTexture_GetAutoGenFilterType(This->wined3d_texture);
|
||||
filter_type = (D3DTEXTUREFILTERTYPE)wined3d_texture_get_autogen_filter_type(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return filter_type;
|
||||
|
@ -257,7 +257,7 @@ static void WINAPI IDirect3DVolumeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DVO
|
|||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
IWineD3DBaseTexture_GenerateMipSubLevels(This->wined3d_texture);
|
||||
wined3d_texture_generate_mipmaps(This->wined3d_texture);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetLevelDesc(IDirect3DVolumeTe
|
|||
TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
{
|
||||
|
@ -300,7 +300,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetVolumeLevel(IDirect3DVolume
|
|||
TRACE("iface %p, level %u, volume %p.\n", iface, level, volume);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
{
|
||||
wined3d_mutex_unlock();
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
@ -324,7 +324,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_LockBox(IDirect3DVolumeTexture
|
|||
iface, level, locked_box, box, flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DVolume9_LockBox((IDirect3DVolume9 *)wined3d_resource_get_parent(sub_resource),
|
||||
|
@ -343,7 +343,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_UnlockBox(IDirect3DVolumeTextu
|
|||
TRACE("iface %p, level %u.\n", iface, level);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, level)))
|
||||
hr = D3DERR_INVALIDCALL;
|
||||
else
|
||||
hr = IDirect3DVolume9_UnlockBox((IDirect3DVolume9 *)wined3d_resource_get_parent(sub_resource));
|
||||
|
@ -361,7 +361,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_AddDirtyBox(IDirect3DVolumeTex
|
|||
TRACE("iface %p, dirty_box %p.\n", iface, dirty_box);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, (const WINED3DBOX *)dirty_box);
|
||||
hr = wined3d_texture_add_dirty_region(texture->wined3d_texture, 0, (const WINED3DBOX *)dirty_box);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
|
|
|
@ -3438,12 +3438,12 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
|
|||
if(desc2.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP)
|
||||
{
|
||||
hr = IWineD3DDevice_CreateCubeTexture(ddraw->wineD3DDevice, DDSD->dwWidth, levels, 0,
|
||||
Format, Pool, object, &ddraw_null_wined3d_parent_ops, &object->wineD3DTexture);
|
||||
Format, Pool, object, &ddraw_null_wined3d_parent_ops, &object->wined3d_texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = IWineD3DDevice_CreateTexture(ddraw->wineD3DDevice, DDSD->dwWidth, DDSD->dwHeight,
|
||||
levels, 0, Format, Pool, object, &ddraw_null_wined3d_parent_ops, &object->wineD3DTexture);
|
||||
levels, 0, Format, Pool, object, &ddraw_null_wined3d_parent_ops, &object->wined3d_texture);
|
||||
}
|
||||
ddraw->tex_root = NULL;
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ struct IDirectDrawSurfaceImpl
|
|||
/* Connections to other Objects */
|
||||
IDirectDrawImpl *ddraw;
|
||||
IWineD3DSurface *WineD3DSurface;
|
||||
IWineD3DBaseTexture *wineD3DTexture;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
IWineD3DSwapChain *wineD3DSwapChain;
|
||||
|
||||
/* This implementation handles attaching surfaces to other surfaces */
|
||||
|
|
|
@ -2437,9 +2437,8 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
|
|||
case D3DRENDERSTATE_TEXTUREHANDLE:
|
||||
{
|
||||
/* This state is wrapped to SetTexture in SetRenderState, so
|
||||
* it has to be wrapped to GetTexture here
|
||||
*/
|
||||
IWineD3DBaseTexture *tex = NULL;
|
||||
* it has to be wrapped to GetTexture here. */
|
||||
struct wined3d_texture *tex = NULL;
|
||||
*lpdwRenderState = 0;
|
||||
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
|
@ -2449,9 +2448,9 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
|
|||
{
|
||||
/* The parent of the texture is the IDirectDrawSurface7
|
||||
* interface of the ddraw surface. */
|
||||
IDirectDrawSurfaceImpl *parent = IWineD3DBaseTexture_GetParent(tex);
|
||||
IDirectDrawSurfaceImpl *parent = wined3d_texture_get_parent(tex);
|
||||
if (parent) *lpdwRenderState = parent->Handle;
|
||||
IWineD3DBaseTexture_Release(tex);
|
||||
wined3d_texture_decref(tex);
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
|
@ -2494,9 +2493,9 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
|
|||
}
|
||||
else
|
||||
{
|
||||
struct wined3d_texture *tex = NULL;
|
||||
HRESULT hr;
|
||||
BOOL tex_alpha = FALSE;
|
||||
IWineD3DBaseTexture *tex = NULL;
|
||||
DDPIXELFORMAT ddfmt;
|
||||
|
||||
hr = IWineD3DDevice_GetTexture(This->wineD3DDevice, 0, &tex);
|
||||
|
@ -2505,7 +2504,7 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
|
|||
{
|
||||
struct wined3d_resource *sub_resource;
|
||||
|
||||
if ((sub_resource = IWineD3DBaseTexture_GetSubResource(tex, 0)))
|
||||
if ((sub_resource = wined3d_texture_get_sub_resource(tex, 0)))
|
||||
{
|
||||
struct wined3d_resource_desc desc;
|
||||
|
||||
|
@ -2515,7 +2514,7 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
|
|||
if (ddfmt.u5.dwRGBAlphaBitMask) tex_alpha = TRUE;
|
||||
}
|
||||
|
||||
IWineD3DBaseTexture_Release(tex);
|
||||
wined3d_texture_decref(tex);
|
||||
}
|
||||
|
||||
if (!(colorop == WINED3DTOP_MODULATE && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT &&
|
||||
|
@ -2804,8 +2803,8 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
|
|||
{
|
||||
case D3DTBLEND_MODULATE:
|
||||
{
|
||||
struct wined3d_texture *tex = NULL;
|
||||
BOOL tex_alpha = FALSE;
|
||||
IWineD3DBaseTexture *tex = NULL;
|
||||
DDPIXELFORMAT ddfmt;
|
||||
|
||||
hr = IWineD3DDevice_GetTexture(This->wineD3DDevice, 0, &tex);
|
||||
|
@ -2814,7 +2813,7 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
|
|||
{
|
||||
struct wined3d_resource *sub_resource;
|
||||
|
||||
if ((sub_resource = IWineD3DBaseTexture_GetSubResource(tex, 0)))
|
||||
if ((sub_resource = wined3d_texture_get_sub_resource(tex, 0)))
|
||||
{
|
||||
struct wined3d_resource_desc desc;
|
||||
|
||||
|
@ -2824,7 +2823,7 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
|
|||
if (ddfmt.u5.dwRGBAlphaBitMask) tex_alpha = TRUE;
|
||||
}
|
||||
|
||||
IWineD3DBaseTexture_Release(tex);
|
||||
wined3d_texture_decref(tex);
|
||||
}
|
||||
|
||||
if (tex_alpha)
|
||||
|
@ -4430,7 +4429,7 @@ IDirect3DDeviceImpl_7_GetTexture(IDirect3DDevice7 *iface,
|
|||
IDirectDrawSurface7 **Texture)
|
||||
{
|
||||
IDirect3DDeviceImpl *This = (IDirect3DDeviceImpl *)iface;
|
||||
IWineD3DBaseTexture *Surf;
|
||||
struct wined3d_texture *wined3d_texture;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, stage %u, texture %p.\n", iface, Stage, Texture);
|
||||
|
@ -4442,15 +4441,15 @@ IDirect3DDeviceImpl_7_GetTexture(IDirect3DDevice7 *iface,
|
|||
}
|
||||
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
hr = IWineD3DDevice_GetTexture(This->wineD3DDevice, Stage, &Surf);
|
||||
if( (hr != D3D_OK) || (!Surf) )
|
||||
hr = IWineD3DDevice_GetTexture(This->wineD3DDevice, Stage, &wined3d_texture);
|
||||
if (FAILED(hr) || !wined3d_texture)
|
||||
{
|
||||
*Texture = NULL;
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
}
|
||||
|
||||
*Texture = IWineD3DBaseTexture_GetParent(Surf);
|
||||
*Texture = wined3d_texture_get_parent(wined3d_texture);
|
||||
IDirectDrawSurface7_AddRef(*Texture);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
|
@ -4526,8 +4525,7 @@ IDirect3DDeviceImpl_7_SetTexture(IDirect3DDevice7 *iface,
|
|||
/* Texture may be NULL here */
|
||||
EnterCriticalSection(&ddraw_cs);
|
||||
hr = IWineD3DDevice_SetTexture(This->wineD3DDevice,
|
||||
Stage,
|
||||
surf ? surf->wineD3DTexture : NULL);
|
||||
Stage, surf ? surf->wined3d_texture : NULL);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
}
|
||||
|
@ -4578,8 +4576,8 @@ IDirect3DDeviceImpl_3_SetTexture(IDirect3DDevice3 *iface,
|
|||
{
|
||||
/* This fixup is required by the way D3DTBLEND_MODULATE maps to texture stage states.
|
||||
See IDirect3DDeviceImpl_3_SetRenderState for details. */
|
||||
struct wined3d_texture *tex = NULL;
|
||||
BOOL tex_alpha = FALSE;
|
||||
IWineD3DBaseTexture *tex = NULL;
|
||||
DDPIXELFORMAT ddfmt;
|
||||
HRESULT result;
|
||||
|
||||
|
@ -4589,7 +4587,7 @@ IDirect3DDeviceImpl_3_SetTexture(IDirect3DDevice3 *iface,
|
|||
{
|
||||
struct wined3d_resource *sub_resource;
|
||||
|
||||
if ((sub_resource = IWineD3DBaseTexture_GetSubResource(tex, 0)))
|
||||
if ((sub_resource = wined3d_texture_get_sub_resource(tex, 0)))
|
||||
{
|
||||
struct wined3d_resource_desc desc;
|
||||
|
||||
|
@ -4599,7 +4597,7 @@ IDirect3DDeviceImpl_3_SetTexture(IDirect3DDevice3 *iface,
|
|||
if (ddfmt.u5.dwRGBAlphaBitMask) tex_alpha = TRUE;
|
||||
}
|
||||
|
||||
IWineD3DBaseTexture_Release(tex);
|
||||
wined3d_texture_decref(tex);
|
||||
}
|
||||
|
||||
/* Arg 1/2 are already set to WINED3DTA_TEXTURE/WINED3DTA_CURRENT in case of D3DTBLEND_MODULATE */
|
||||
|
|
|
@ -352,10 +352,9 @@ static ULONG WINAPI ddraw_surface7_Release(IDirectDrawSurface7 *iface)
|
|||
* of the sublevels, which destroys the WineD3DSurfaces.
|
||||
* Set the surfaces to NULL to avoid destroying them again later
|
||||
*/
|
||||
if(This->wineD3DTexture)
|
||||
{
|
||||
IWineD3DBaseTexture_Release(This->wineD3DTexture);
|
||||
}
|
||||
if (This->wined3d_texture)
|
||||
wined3d_texture_decref(This->wined3d_texture);
|
||||
|
||||
/* If it's the RenderTarget, destroy the d3ddevice */
|
||||
else if(This->wineD3DSwapChain)
|
||||
{
|
||||
|
@ -2352,15 +2351,14 @@ static HRESULT WINAPI ddraw_surface7_SetLOD(IDirectDrawSurface7 *iface, DWORD Ma
|
|||
return DDERR_INVALIDOBJECT;
|
||||
}
|
||||
|
||||
if(!This->wineD3DTexture)
|
||||
if (!This->wined3d_texture)
|
||||
{
|
||||
ERR("(%p) The DirectDraw texture has no WineD3DTexture!\n", This);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return DDERR_INVALIDOBJECT;
|
||||
}
|
||||
|
||||
hr = IWineD3DBaseTexture_SetLOD(This->wineD3DTexture,
|
||||
MaxLOD);
|
||||
hr = wined3d_texture_set_lod(This->wined3d_texture, MaxLOD);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return hr;
|
||||
}
|
||||
|
@ -2395,7 +2393,7 @@ static HRESULT WINAPI ddraw_surface7_GetLOD(IDirectDrawSurface7 *iface, DWORD *M
|
|||
return DDERR_INVALIDOBJECT;
|
||||
}
|
||||
|
||||
*MaxLOD = IWineD3DBaseTexture_GetLOD(This->wineD3DTexture);
|
||||
*MaxLOD = wined3d_texture_get_lod(This->wined3d_texture);
|
||||
LeaveCriticalSection(&ddraw_cs);
|
||||
return DD_OK;
|
||||
}
|
||||
|
|
|
@ -128,13 +128,12 @@ static void context_apply_attachment_filter_states(const struct wined3d_context
|
|||
{
|
||||
case SFLAG_INTEXTURE:
|
||||
case SFLAG_INSRGBTEX:
|
||||
gl_tex = basetexture_get_gl_texture(texture,
|
||||
gl_tex = wined3d_texture_get_gl_texture(texture,
|
||||
context->gl_info, location == SFLAG_INSRGBTEX);
|
||||
break;
|
||||
|
||||
default:
|
||||
ERR("Unsupported location %s (%#x).\n", debug_surflocation(location), location);
|
||||
IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)texture);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -4496,8 +4496,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
|
|||
{
|
||||
TRACE("Recording... not performing anything\n");
|
||||
|
||||
if (texture) IWineD3DBaseTexture_AddRef(texture);
|
||||
if (prev) IWineD3DBaseTexture_Release(prev);
|
||||
if (texture) wined3d_texture_incref(texture);
|
||||
if (prev) wined3d_texture_decref(prev);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
@ -4508,7 +4508,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
|
|||
LONG bind_count = InterlockedIncrement(&t->baseTexture.bindCount);
|
||||
GLenum dimensions = t->baseTexture.target;
|
||||
|
||||
IWineD3DBaseTexture_AddRef(texture);
|
||||
wined3d_texture_incref(texture);
|
||||
|
||||
if (!prev || dimensions != ((IWineD3DBaseTextureImpl *)prev)->baseTexture.target)
|
||||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_PIXELSHADER);
|
||||
|
@ -4530,7 +4530,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface,
|
|||
IWineD3DBaseTextureImpl *t = (IWineD3DBaseTextureImpl *)prev;
|
||||
LONG bind_count = InterlockedDecrement(&t->baseTexture.bindCount);
|
||||
|
||||
IWineD3DBaseTexture_Release(prev);
|
||||
wined3d_texture_decref(prev);
|
||||
|
||||
if (!texture && stage < gl_info->limits.texture_stages)
|
||||
{
|
||||
|
@ -4579,7 +4579,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface, DWORD
|
|||
|
||||
*ppTexture = (IWineD3DBaseTexture *)This->stateBlock->state.textures[Stage];
|
||||
if (*ppTexture)
|
||||
IWineD3DBaseTexture_AddRef(*ppTexture);
|
||||
wined3d_texture_incref(*ppTexture);
|
||||
|
||||
TRACE("(%p) : Returning %p\n", This, *ppTexture);
|
||||
|
||||
|
@ -5108,16 +5108,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
|
|||
}
|
||||
|
||||
/* Verify that the source and destination textures are the same type. */
|
||||
type = IWineD3DBaseTexture_GetType(src_texture);
|
||||
if (IWineD3DBaseTexture_GetType(dst_texture) != type)
|
||||
type = wined3d_texture_get_type(src_texture);
|
||||
if (wined3d_texture_get_type(dst_texture) != type)
|
||||
{
|
||||
WARN("Source and destination have different types, returning WINED3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
/* Check that both textures have the identical numbers of levels. */
|
||||
level_count = IWineD3DBaseTexture_GetLevelCount(src_texture);
|
||||
if (IWineD3DBaseTexture_GetLevelCount(dst_texture) != level_count)
|
||||
level_count = wined3d_texture_get_level_count(src_texture);
|
||||
if (wined3d_texture_get_level_count(dst_texture) != level_count)
|
||||
{
|
||||
WARN("Source and destination have different level counts, returning WINED3DERR_INVALIDCALL.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
|
@ -5137,10 +5137,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
|
|||
|
||||
for (i = 0; i < level_count; ++i)
|
||||
{
|
||||
src_surface = (IWineD3DSurface *)surface_from_resource(basetexture_get_sub_resource(
|
||||
(IWineD3DBaseTextureImpl *)src_texture, i));
|
||||
dst_surface = (IWineD3DSurface *)surface_from_resource(basetexture_get_sub_resource(
|
||||
(IWineD3DBaseTextureImpl *)dst_texture, i));
|
||||
src_surface = (IWineD3DSurface *)surface_from_resource(wined3d_texture_get_sub_resource(
|
||||
src_texture, i));
|
||||
dst_surface = (IWineD3DSurface *)surface_from_resource(wined3d_texture_get_sub_resource(
|
||||
dst_texture, i));
|
||||
hr = IWineD3DDevice_UpdateSurface(iface, src_surface, NULL, dst_surface, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
@ -5158,10 +5158,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
|
|||
|
||||
for (i = 0; i < level_count * 6; ++i)
|
||||
{
|
||||
src_surface = (IWineD3DSurface *)surface_from_resource(basetexture_get_sub_resource(
|
||||
(IWineD3DBaseTextureImpl *)src_texture, i));
|
||||
dst_surface = (IWineD3DSurface *)surface_from_resource(basetexture_get_sub_resource(
|
||||
(IWineD3DBaseTextureImpl *)dst_texture, i));
|
||||
src_surface = (IWineD3DSurface *)surface_from_resource(wined3d_texture_get_sub_resource(
|
||||
src_texture, i));
|
||||
dst_surface = (IWineD3DSurface *)surface_from_resource(wined3d_texture_get_sub_resource(
|
||||
dst_texture, i));
|
||||
hr = IWineD3DDevice_UpdateSurface(iface, src_surface, NULL, dst_surface, NULL);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
@ -5179,10 +5179,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture(IWineD3DDevice *iface,
|
|||
|
||||
for (i = 0; i < level_count; ++i)
|
||||
{
|
||||
src_volume = (IWineD3DVolume *)volume_from_resource(basetexture_get_sub_resource(
|
||||
(IWineD3DBaseTextureImpl *)src_texture, i));
|
||||
dst_volume = (IWineD3DVolume *)volume_from_resource(basetexture_get_sub_resource(
|
||||
(IWineD3DBaseTextureImpl *)dst_texture, i));
|
||||
src_volume = (IWineD3DVolume *)volume_from_resource(wined3d_texture_get_sub_resource(src_texture, i));
|
||||
dst_volume = (IWineD3DVolume *)volume_from_resource(wined3d_texture_get_sub_resource(dst_texture, i));
|
||||
hr = IWineD3DDeviceImpl_UpdateVolume(iface, src_volume, dst_volume);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
@ -6708,7 +6706,7 @@ void device_resource_released(struct IWineD3DDeviceImpl *device, struct wined3d_
|
|||
case WINED3DRTYPE_VOLUMETEXTURE:
|
||||
for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = basetexture_from_resource(resource);
|
||||
struct wined3d_texture *texture = wined3d_texture_from_resource(resource);
|
||||
|
||||
if (device->stateBlock && device->stateBlock->state.textures[i] == texture)
|
||||
{
|
||||
|
|
|
@ -3592,7 +3592,7 @@ static void sampler_texmatrix(DWORD state, struct wined3d_stateblock *stateblock
|
|||
|
||||
if(!texture) return;
|
||||
/* The fixed function np2 texture emulation uses the texture matrix to fix up the coordinates
|
||||
* basetexture_apply_state_changes() multiplies the set matrix with a fixup matrix. Before the
|
||||
* wined3d_texture_apply_state_changes() multiplies the set matrix with a fixup matrix. Before the
|
||||
* scaling is reapplied or removed, the texture matrix has to be reapplied
|
||||
*
|
||||
* The mapped stage is already active because the sampler() function below, which is part of the
|
||||
|
@ -3647,8 +3647,7 @@ static void sampler(DWORD state_id, struct wined3d_stateblock *stateblock, struc
|
|||
BOOL srgb = state->sampler_states[sampler][WINED3DSAMP_SRGBTEXTURE];
|
||||
|
||||
texture->baseTexture.texture_ops->texture_bind(texture, gl_info, srgb);
|
||||
basetexture_apply_state_changes(texture,
|
||||
state->sampler_states[sampler], gl_info);
|
||||
wined3d_texture_apply_state_changes(texture, state->sampler_states[sampler], gl_info);
|
||||
|
||||
if (gl_info->supported[EXT_TEXTURE_LOD_BIAS])
|
||||
{
|
||||
|
|
|
@ -482,7 +482,7 @@ ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
|
|||
for (counter = 0; counter < MAX_COMBINED_SAMPLERS; counter++)
|
||||
{
|
||||
if (stateblock->state.textures[counter])
|
||||
IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)stateblock->state.textures[counter]);
|
||||
wined3d_texture_decref(stateblock->state.textures[counter]);
|
||||
}
|
||||
|
||||
for (counter = 0; counter < MAX_STREAMS; ++counter)
|
||||
|
@ -840,9 +840,9 @@ HRESULT CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock)
|
|||
i, src_state->textures[i], stateblock->state.textures[i]);
|
||||
|
||||
if (src_state->textures[i])
|
||||
IWineD3DBaseTexture_AddRef((IWineD3DBaseTexture *)src_state->textures[i]);
|
||||
wined3d_texture_incref(src_state->textures[i]);
|
||||
if (stateblock->state.textures[i])
|
||||
IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)stateblock->state.textures[i]);
|
||||
wined3d_texture_decref(stateblock->state.textures[i]);
|
||||
stateblock->state.textures[i] = src_state->textures[i];
|
||||
}
|
||||
|
||||
|
|
|
@ -1212,11 +1212,11 @@ void surface_add_dirty_rect(IWineD3DSurfaceImpl *surface, const WINED3DBOX *dirt
|
|||
surface->dirtyRect.bottom = surface->resource.height;
|
||||
}
|
||||
|
||||
/* if the container is a basetexture then mark it dirty. */
|
||||
/* if the container is a texture then mark it dirty. */
|
||||
if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
|
||||
{
|
||||
TRACE("Passing to container.\n");
|
||||
basetexture_set_dirty(surface->container.u.texture, TRUE);
|
||||
wined3d_texture_set_dirty(surface->container.u.texture, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4340,7 +4340,7 @@ void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL pers
|
|||
if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
|
||||
{
|
||||
TRACE("Passing to container.\n");
|
||||
basetexture_set_dirty(surface->container.u.texture, TRUE);
|
||||
wined3d_texture_set_dirty(surface->container.u.texture, TRUE);
|
||||
}
|
||||
}
|
||||
surface->flags &= ~SFLAG_LOCATIONS;
|
||||
|
@ -4362,7 +4362,7 @@ void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL pers
|
|||
if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
|
||||
{
|
||||
TRACE("Passing to container\n");
|
||||
basetexture_set_dirty(surface->container.u.texture, TRUE);
|
||||
wined3d_texture_set_dirty(surface->container.u.texture, TRUE);
|
||||
}
|
||||
}
|
||||
surface->flags &= ~flag;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
|
||||
|
||||
static HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, const struct wined3d_texture_ops *texture_ops,
|
||||
static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_texture_ops *texture_ops,
|
||||
UINT layer_count, UINT level_count, WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device,
|
||||
DWORD usage, const struct wined3d_format *format, WINED3DPOOL pool, void *parent,
|
||||
const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops)
|
||||
|
@ -83,7 +83,7 @@ static void gltexture_delete(struct gl_texture *tex)
|
|||
tex->name = 0;
|
||||
}
|
||||
|
||||
static void basetexture_unload(IWineD3DBaseTextureImpl *texture)
|
||||
static void wined3d_texture_unload(struct wined3d_texture *texture)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = texture->resource.device;
|
||||
struct wined3d_context *context = NULL;
|
||||
|
@ -101,12 +101,12 @@ static void basetexture_unload(IWineD3DBaseTextureImpl *texture)
|
|||
|
||||
if (context) context_release(context);
|
||||
|
||||
basetexture_set_dirty(texture, TRUE);
|
||||
wined3d_texture_set_dirty(texture, TRUE);
|
||||
|
||||
resource_unload(&texture->resource);
|
||||
}
|
||||
|
||||
static void basetexture_cleanup(IWineD3DBaseTextureImpl *texture)
|
||||
static void wined3d_texture_cleanup(struct wined3d_texture *texture)
|
||||
{
|
||||
UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
|
||||
UINT i;
|
||||
|
@ -121,32 +121,19 @@ static void basetexture_cleanup(IWineD3DBaseTextureImpl *texture)
|
|||
texture->baseTexture.texture_ops->texture_sub_resource_cleanup(sub_resource);
|
||||
}
|
||||
|
||||
basetexture_unload(texture);
|
||||
wined3d_texture_unload(texture);
|
||||
HeapFree(GetProcessHeap(), 0, texture->baseTexture.sub_resources);
|
||||
resource_cleanup(&texture->resource);
|
||||
}
|
||||
|
||||
struct wined3d_resource *basetexture_get_sub_resource(IWineD3DBaseTextureImpl *texture, UINT sub_resource_idx)
|
||||
{
|
||||
UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
|
||||
|
||||
if (sub_resource_idx >= sub_count)
|
||||
{
|
||||
WARN("sub_resource_idx %u >= sub_count %u.\n", sub_resource_idx, sub_count);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return texture->baseTexture.sub_resources[sub_resource_idx];
|
||||
}
|
||||
|
||||
void basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty)
|
||||
void wined3d_texture_set_dirty(struct wined3d_texture *texture, BOOL dirty)
|
||||
{
|
||||
texture->baseTexture.texture_rgb.dirty = dirty;
|
||||
texture->baseTexture.texture_srgb.dirty = dirty;
|
||||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
static HRESULT basetexture_bind(IWineD3DBaseTextureImpl *texture,
|
||||
static HRESULT wined3d_texture_bind(struct wined3d_texture *texture,
|
||||
const struct wined3d_gl_info *gl_info, BOOL srgb, BOOL *set_surface_desc)
|
||||
{
|
||||
struct gl_texture *gl_tex;
|
||||
|
@ -157,7 +144,7 @@ static HRESULT basetexture_bind(IWineD3DBaseTextureImpl *texture,
|
|||
TRACE("texture %p, srgb %#x, set_surface_desc %p.\n", texture, srgb, set_surface_desc);
|
||||
|
||||
texture->baseTexture.is_srgb = srgb; /* sRGB mode cache for preload() calls outside drawprim. */
|
||||
gl_tex = basetexture_get_gl_texture(texture, gl_info, srgb);
|
||||
gl_tex = wined3d_texture_get_gl_texture(texture, gl_info, srgb);
|
||||
target = texture->baseTexture.target;
|
||||
|
||||
ENTER_GL();
|
||||
|
@ -190,7 +177,7 @@ static HRESULT basetexture_bind(IWineD3DBaseTextureImpl *texture,
|
|||
else
|
||||
gl_tex->states[WINED3DTEXSTA_SRGBTEXTURE] = srgb;
|
||||
gl_tex->states[WINED3DTEXSTA_SHADOW] = FALSE;
|
||||
basetexture_set_dirty(texture, TRUE);
|
||||
wined3d_texture_set_dirty(texture, TRUE);
|
||||
new_texture = TRUE;
|
||||
|
||||
if (texture->resource.usage & WINED3DUSAGE_AUTOGENMIPMAP)
|
||||
|
@ -271,7 +258,7 @@ static void apply_wrap(const struct wined3d_gl_info *gl_info, GLenum target,
|
|||
}
|
||||
|
||||
/* GL locking is done by the caller (state handler) */
|
||||
void basetexture_apply_state_changes(IWineD3DBaseTextureImpl *texture,
|
||||
void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
|
||||
const DWORD sampler_states[WINED3D_HIGHEST_SAMPLER_STATE + 1],
|
||||
const struct wined3d_gl_info *gl_info)
|
||||
{
|
||||
|
@ -283,7 +270,7 @@ void basetexture_apply_state_changes(IWineD3DBaseTextureImpl *texture,
|
|||
|
||||
TRACE("texture %p, sampler_states %p.\n", texture, sampler_states);
|
||||
|
||||
gl_tex = basetexture_get_gl_texture(texture, gl_info, texture->baseTexture.is_srgb);
|
||||
gl_tex = wined3d_texture_get_gl_texture(texture, gl_info, texture->baseTexture.is_srgb);
|
||||
|
||||
/* This function relies on the correct texture being bound and loaded. */
|
||||
|
||||
|
@ -432,29 +419,8 @@ void basetexture_apply_state_changes(IWineD3DBaseTextureImpl *texture,
|
|||
}
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DTextureImpl_QueryInterface(IWineD3DBaseTexture *iface, REFIID riid, void **object)
|
||||
ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
|
||||
{
|
||||
TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
|
||||
|
||||
if (IsEqualGUID(riid, &IID_IWineD3DBaseTexture)
|
||||
|| IsEqualGUID(riid, &IID_IWineD3DResource)
|
||||
|| IsEqualGUID(riid, &IID_IWineD3DBase)
|
||||
|| IsEqualGUID(riid, &IID_IUnknown))
|
||||
{
|
||||
IUnknown_AddRef(iface);
|
||||
*object = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
|
||||
|
||||
*object = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IWineD3DTextureImpl_AddRef(IWineD3DBaseTexture *iface)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
ULONG refcount = InterlockedIncrement(&texture->resource.ref);
|
||||
|
||||
TRACE("%p increasing refcount to %u.\n", texture, refcount);
|
||||
|
@ -463,16 +429,15 @@ static ULONG WINAPI IWineD3DTextureImpl_AddRef(IWineD3DBaseTexture *iface)
|
|||
}
|
||||
|
||||
/* Do not call while under the GL lock. */
|
||||
static ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DBaseTexture *iface)
|
||||
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
ULONG refcount = InterlockedDecrement(&texture->resource.ref);
|
||||
|
||||
TRACE("%p decreasing refcount to %u.\n", texture, refcount);
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
basetexture_cleanup(texture);
|
||||
wined3d_texture_cleanup(texture);
|
||||
texture->resource.parent_ops->wined3d_object_destroyed(texture->resource.parent);
|
||||
HeapFree(GetProcessHeap(), 0, texture);
|
||||
}
|
||||
|
@ -480,59 +445,58 @@ static ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DBaseTexture *iface)
|
|||
return refcount;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DTextureImpl_SetPrivateData(IWineD3DBaseTexture *iface,
|
||||
REFGUID riid, const void *data, DWORD data_size, DWORD flags)
|
||||
HRESULT CDECL wined3d_texture_set_private_data(struct wined3d_texture *texture,
|
||||
REFGUID guid, const void *data, DWORD data_size, DWORD flags)
|
||||
{
|
||||
return resource_set_private_data(&((IWineD3DBaseTextureImpl *)iface)->resource, riid, data, data_size, flags);
|
||||
return resource_set_private_data(&texture->resource, guid, data, data_size, flags);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DTextureImpl_GetPrivateData(IWineD3DBaseTexture *iface,
|
||||
HRESULT CDECL wined3d_texture_get_private_data(const struct wined3d_texture *texture,
|
||||
REFGUID guid, void *data, DWORD *data_size)
|
||||
{
|
||||
return resource_get_private_data(&((IWineD3DBaseTextureImpl *)iface)->resource, guid, data, data_size);
|
||||
return resource_get_private_data(&texture->resource, guid, data, data_size);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DTextureImpl_FreePrivateData(IWineD3DBaseTexture *iface, REFGUID refguid)
|
||||
HRESULT CDECL wined3d_texture_free_private_data(struct wined3d_texture *texture, REFGUID guid)
|
||||
{
|
||||
return resource_free_private_data(&((IWineD3DBaseTextureImpl *)iface)->resource, refguid);
|
||||
return resource_free_private_data(&texture->resource, guid);
|
||||
}
|
||||
|
||||
static DWORD WINAPI IWineD3DTextureImpl_SetPriority(IWineD3DBaseTexture *iface, DWORD priority)
|
||||
DWORD CDECL wined3d_texture_set_priority(struct wined3d_texture *texture, DWORD priority)
|
||||
{
|
||||
return resource_set_priority(&((IWineD3DBaseTextureImpl *)iface)->resource, priority);
|
||||
return resource_set_priority(&texture->resource, priority);
|
||||
}
|
||||
|
||||
static DWORD WINAPI IWineD3DTextureImpl_GetPriority(IWineD3DBaseTexture *iface)
|
||||
DWORD CDECL wined3d_texture_get_priority(const struct wined3d_texture *texture)
|
||||
{
|
||||
return resource_get_priority(&((IWineD3DBaseTextureImpl *)iface)->resource);
|
||||
return resource_get_priority(&texture->resource);
|
||||
}
|
||||
|
||||
/* Do not call while under the GL lock. */
|
||||
static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DBaseTexture *iface)
|
||||
void CDECL wined3d_texture_preload(struct wined3d_texture *texture)
|
||||
{
|
||||
struct IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
|
||||
texture->baseTexture.texture_ops->texture_preload(texture, SRGB_ANY);
|
||||
}
|
||||
|
||||
static WINED3DRESOURCETYPE WINAPI IWineD3DTextureImpl_GetType(IWineD3DBaseTexture *iface)
|
||||
WINED3DRESOURCETYPE CDECL wined3d_texture_get_type(const struct wined3d_texture *texture)
|
||||
{
|
||||
return resource_get_type(&((IWineD3DBaseTextureImpl *)iface)->resource);
|
||||
TRACE("texture %p.\n", texture);
|
||||
|
||||
return texture->resource.resourceType;
|
||||
}
|
||||
|
||||
static void * WINAPI IWineD3DTextureImpl_GetParent(IWineD3DBaseTexture *iface)
|
||||
void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
|
||||
{
|
||||
TRACE("iface %p.\n", iface);
|
||||
TRACE("texture %p.\n", texture);
|
||||
|
||||
return ((IWineD3DBaseTextureImpl *)iface)->resource.parent;
|
||||
return texture->resource.parent;
|
||||
}
|
||||
|
||||
static DWORD WINAPI IWineD3DTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD lod)
|
||||
DWORD CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
DWORD old = texture->baseTexture.LOD;
|
||||
|
||||
TRACE("iface %p, lod %u.\n", iface, lod);
|
||||
TRACE("texture %p, lod %u.\n", texture, lod);
|
||||
|
||||
/* The d3d9:texture test shows that SetLOD is ignored on non-managed
|
||||
* textures. The call always returns 0, and GetLOD always returns 0. */
|
||||
|
@ -558,30 +522,24 @@ static DWORD WINAPI IWineD3DTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD
|
|||
return old;
|
||||
}
|
||||
|
||||
static DWORD WINAPI IWineD3DTextureImpl_GetLOD(IWineD3DBaseTexture *iface)
|
||||
DWORD CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
|
||||
TRACE("iface %p, returning %u.\n", iface, texture->baseTexture.LOD);
|
||||
TRACE("texture %p, returning %u.\n", texture, texture->baseTexture.LOD);
|
||||
|
||||
return texture->baseTexture.LOD;
|
||||
}
|
||||
|
||||
static DWORD WINAPI IWineD3DTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface)
|
||||
DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
|
||||
TRACE("iface %p, returning %u.\n", iface, texture->baseTexture.level_count);
|
||||
TRACE("texture %p, returning %u.\n", texture, texture->baseTexture.level_count);
|
||||
|
||||
return texture->baseTexture.level_count;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface,
|
||||
HRESULT CDECL wined3d_texture_set_autogen_filter_type(struct wined3d_texture *texture,
|
||||
WINED3DTEXTUREFILTERTYPE filter_type)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
|
||||
TRACE("iface %p, filter_type %s.\n", iface, debug_d3dtexturefiltertype(filter_type));
|
||||
TRACE("texture %p, filter_type %s.\n", texture, debug_d3dtexturefiltertype(filter_type));
|
||||
|
||||
if (!(texture->resource.usage & WINED3DUSAGE_AUTOGENMIPMAP))
|
||||
{
|
||||
|
@ -627,74 +585,56 @@ static HRESULT WINAPI IWineD3DTextureImpl_SetAutoGenFilterType(IWineD3DBaseTextu
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface)
|
||||
WINED3DTEXTUREFILTERTYPE CDECL wined3d_texture_get_autogen_filter_type(const struct wined3d_texture *texture)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
|
||||
TRACE("iface %p.\n", iface);
|
||||
TRACE("texture %p.\n", texture);
|
||||
|
||||
return texture->baseTexture.filterType;
|
||||
}
|
||||
|
||||
static void WINAPI IWineD3DTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface)
|
||||
void CDECL wined3d_texture_generate_mipmaps(struct wined3d_texture *texture)
|
||||
{
|
||||
/* TODO: Implement filters using GL_SGI_generate_mipmaps. */
|
||||
FIXME("iface %p stub!\n", iface);
|
||||
FIXME("texture %p stub!\n", texture);
|
||||
}
|
||||
|
||||
static struct wined3d_resource * WINAPI IWineD3DTextureImpl_GetSubResource(IWineD3DBaseTexture *iface,
|
||||
struct wined3d_resource * CDECL wined3d_texture_get_sub_resource(struct wined3d_texture *texture,
|
||||
UINT sub_resource_idx)
|
||||
{
|
||||
TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
|
||||
UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
|
||||
|
||||
return basetexture_get_sub_resource((IWineD3DBaseTextureImpl *)iface, sub_resource_idx);
|
||||
TRACE("texture %p, sub_resource_idx %u.\n", texture, sub_resource_idx);
|
||||
|
||||
if (sub_resource_idx >= sub_count)
|
||||
{
|
||||
WARN("sub_resource_idx %u >= sub_count %u.\n", sub_resource_idx, sub_count);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return texture->baseTexture.sub_resources[sub_resource_idx];
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRegion(IWineD3DBaseTexture *iface,
|
||||
HRESULT CDECL wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
UINT layer, const WINED3DBOX *dirty_region)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
|
||||
struct wined3d_resource *sub_resource;
|
||||
|
||||
TRACE("texture %p, layer %u, dirty_region %p.\n", texture, layer, dirty_region);
|
||||
|
||||
if (!(sub_resource = basetexture_get_sub_resource(texture, layer * texture->baseTexture.level_count)))
|
||||
if (!(sub_resource = wined3d_texture_get_sub_resource(texture, layer * texture->baseTexture.level_count)))
|
||||
{
|
||||
WARN("Failed to get sub-resource.\n");
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
basetexture_set_dirty(texture, TRUE);
|
||||
wined3d_texture_set_dirty(texture, TRUE);
|
||||
texture->baseTexture.texture_ops->texture_sub_resource_add_dirty_region(sub_resource, dirty_region);
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static const struct IWineD3DBaseTextureVtbl wined3d_texture_vtbl =
|
||||
{
|
||||
IWineD3DTextureImpl_QueryInterface,
|
||||
IWineD3DTextureImpl_AddRef,
|
||||
IWineD3DTextureImpl_Release,
|
||||
IWineD3DTextureImpl_GetParent,
|
||||
IWineD3DTextureImpl_SetPrivateData,
|
||||
IWineD3DTextureImpl_GetPrivateData,
|
||||
IWineD3DTextureImpl_FreePrivateData,
|
||||
IWineD3DTextureImpl_SetPriority,
|
||||
IWineD3DTextureImpl_GetPriority,
|
||||
IWineD3DTextureImpl_PreLoad,
|
||||
IWineD3DTextureImpl_GetType,
|
||||
IWineD3DTextureImpl_SetLOD,
|
||||
IWineD3DTextureImpl_GetLOD,
|
||||
IWineD3DTextureImpl_GetLevelCount,
|
||||
IWineD3DTextureImpl_SetAutoGenFilterType,
|
||||
IWineD3DTextureImpl_GetAutoGenFilterType,
|
||||
IWineD3DTextureImpl_GenerateMipSubLevels,
|
||||
IWineD3DTextureImpl_GetSubResource,
|
||||
IWineD3DTextureImpl_AddDirtyRegion,
|
||||
};
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
static HRESULT texture2d_bind(IWineD3DBaseTextureImpl *texture,
|
||||
static HRESULT texture2d_bind(struct wined3d_texture *texture,
|
||||
const struct wined3d_gl_info *gl_info, BOOL srgb)
|
||||
{
|
||||
BOOL set_gl_texture_desc;
|
||||
|
@ -702,7 +642,7 @@ static HRESULT texture2d_bind(IWineD3DBaseTextureImpl *texture,
|
|||
|
||||
TRACE("texture %p, gl_info %p, srgb %#x.\n", texture, gl_info, srgb);
|
||||
|
||||
hr = basetexture_bind(texture, gl_info, srgb, &set_gl_texture_desc);
|
||||
hr = wined3d_texture_bind(texture, gl_info, srgb, &set_gl_texture_desc);
|
||||
if (set_gl_texture_desc && SUCCEEDED(hr))
|
||||
{
|
||||
UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
|
||||
|
@ -710,7 +650,7 @@ static HRESULT texture2d_bind(IWineD3DBaseTextureImpl *texture,
|
|||
struct gl_texture *gl_tex;
|
||||
UINT i;
|
||||
|
||||
gl_tex = basetexture_get_gl_texture(texture, gl_info, srgb_tex);
|
||||
gl_tex = wined3d_texture_get_gl_texture(texture, gl_info, srgb_tex);
|
||||
|
||||
for (i = 0; i < sub_count; ++i)
|
||||
{
|
||||
|
@ -752,7 +692,7 @@ static HRESULT texture2d_bind(IWineD3DBaseTextureImpl *texture,
|
|||
}
|
||||
|
||||
/* Do not call while under the GL lock. */
|
||||
static void texture2d_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB srgb)
|
||||
static void texture2d_preload(struct wined3d_texture *texture, enum WINED3DSRGB srgb)
|
||||
{
|
||||
UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
|
||||
IWineD3DDeviceImpl *device = texture->resource.device;
|
||||
|
@ -782,7 +722,7 @@ static void texture2d_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB
|
|||
break;
|
||||
}
|
||||
|
||||
gl_tex = basetexture_get_gl_texture(texture, gl_info, srgb_mode);
|
||||
gl_tex = wined3d_texture_get_gl_texture(texture, gl_info, srgb_mode);
|
||||
|
||||
if (!device->isInDraw)
|
||||
{
|
||||
|
@ -851,7 +791,7 @@ static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource
|
|||
/* Do not call while under the GL lock. */
|
||||
static void texture2d_unload(struct wined3d_resource *resource)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = basetexture_from_resource(resource);
|
||||
struct wined3d_texture *texture = wined3d_texture_from_resource(resource);
|
||||
UINT sub_count = texture->baseTexture.level_count * texture->baseTexture.layer_count;
|
||||
UINT i;
|
||||
|
||||
|
@ -867,7 +807,7 @@ static void texture2d_unload(struct wined3d_resource *resource)
|
|||
surface_set_texture_name(surface, 0, TRUE); /* Delete sRGB name */
|
||||
}
|
||||
|
||||
basetexture_unload(texture);
|
||||
wined3d_texture_unload(texture);
|
||||
}
|
||||
|
||||
static const struct wined3d_texture_ops texture2d_ops =
|
||||
|
@ -883,7 +823,7 @@ static const struct wined3d_resource_ops texture2d_resource_ops =
|
|||
texture2d_unload,
|
||||
};
|
||||
|
||||
HRESULT cubetexture_init(IWineD3DBaseTextureImpl *texture, UINT edge_length, UINT levels,
|
||||
HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -931,14 +871,12 @@ HRESULT cubetexture_init(IWineD3DBaseTextureImpl *texture, UINT edge_length, UIN
|
|||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
texture->lpVtbl = &wined3d_texture_vtbl;
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, &texture2d_ops,
|
||||
6, levels, WINED3DRTYPE_CUBETEXTURE, device, usage, format, pool,
|
||||
hr = wined3d_texture_init(texture, &texture2d_ops, 6, levels,
|
||||
WINED3DRTYPE_CUBETEXTURE, device, usage, format, pool,
|
||||
parent, parent_ops, &texture2d_resource_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x\n", hr);
|
||||
WARN("Failed to initialize texture, returning %#x\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -989,7 +927,7 @@ HRESULT cubetexture_init(IWineD3DBaseTextureImpl *texture, UINT edge_length, UIN
|
|||
if (FAILED(hr))
|
||||
{
|
||||
FIXME("(%p) Failed to create surface, hr %#x.\n", texture, hr);
|
||||
basetexture_cleanup(texture);
|
||||
wined3d_texture_cleanup(texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -1004,7 +942,7 @@ HRESULT cubetexture_init(IWineD3DBaseTextureImpl *texture, UINT edge_length, UIN
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT texture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height, UINT levels,
|
||||
HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -1070,14 +1008,12 @@ HRESULT texture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height,
|
|||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
texture->lpVtbl = &wined3d_texture_vtbl;
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, &texture2d_ops,
|
||||
1, levels, WINED3DRTYPE_TEXTURE, device, usage, format, pool,
|
||||
hr = wined3d_texture_init(texture, &texture2d_ops, 1, levels,
|
||||
WINED3DRTYPE_TEXTURE, device, usage, format, pool,
|
||||
parent, parent_ops, &texture2d_resource_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x.\n", hr);
|
||||
WARN("Failed to initialize texture, returning %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -1151,7 +1087,7 @@ HRESULT texture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height,
|
|||
if (FAILED(hr))
|
||||
{
|
||||
FIXME("Failed to create surface %p, hr %#x\n", texture, hr);
|
||||
basetexture_cleanup(texture);
|
||||
wined3d_texture_cleanup(texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -1168,18 +1104,18 @@ HRESULT texture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height,
|
|||
}
|
||||
|
||||
/* Context activation is done by the caller. */
|
||||
static HRESULT texture3d_bind(IWineD3DBaseTextureImpl *texture,
|
||||
static HRESULT texture3d_bind(struct wined3d_texture *texture,
|
||||
const struct wined3d_gl_info *gl_info, BOOL srgb)
|
||||
{
|
||||
BOOL dummy;
|
||||
|
||||
TRACE("texture %p, gl_info %p, srgb %#x.\n", texture, gl_info, srgb);
|
||||
|
||||
return basetexture_bind(texture, gl_info, srgb, &dummy);
|
||||
return wined3d_texture_bind(texture, gl_info, srgb, &dummy);
|
||||
}
|
||||
|
||||
/* Do not call while under the GL lock. */
|
||||
static void texture3d_preload(IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB srgb)
|
||||
static void texture3d_preload(struct wined3d_texture *texture, enum WINED3DSRGB srgb)
|
||||
{
|
||||
IWineD3DDeviceImpl *device = texture->resource.device;
|
||||
struct wined3d_context *context = NULL;
|
||||
|
@ -1246,7 +1182,7 @@ static void texture3d_sub_resource_cleanup(struct wined3d_resource *sub_resource
|
|||
/* Do not call while under the GL lock. */
|
||||
static void texture3d_unload(struct wined3d_resource *resource)
|
||||
{
|
||||
IWineD3DBaseTextureImpl *texture = basetexture_from_resource(resource);
|
||||
struct wined3d_texture *texture = wined3d_texture_from_resource(resource);
|
||||
UINT i;
|
||||
|
||||
TRACE("texture %p.\n", texture);
|
||||
|
@ -1257,7 +1193,7 @@ static void texture3d_unload(struct wined3d_resource *resource)
|
|||
sub_resource->resource_ops->resource_unload(sub_resource);
|
||||
}
|
||||
|
||||
basetexture_unload(texture);
|
||||
wined3d_texture_unload(texture);
|
||||
}
|
||||
|
||||
static const struct wined3d_texture_ops texture3d_ops =
|
||||
|
@ -1273,7 +1209,7 @@ static const struct wined3d_resource_ops texture3d_resource_ops =
|
|||
texture3d_unload,
|
||||
};
|
||||
|
||||
HRESULT volumetexture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height,
|
||||
HRESULT volumetexture_init(struct wined3d_texture *texture, UINT width, UINT height,
|
||||
UINT depth, UINT levels, IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id,
|
||||
WINED3DPOOL pool, void *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
|
@ -1320,14 +1256,12 @@ HRESULT volumetexture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT he
|
|||
TRACE("Calculated levels = %u.\n", levels);
|
||||
}
|
||||
|
||||
texture->lpVtbl = &wined3d_texture_vtbl;
|
||||
|
||||
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, &texture3d_ops,
|
||||
1, levels, WINED3DRTYPE_VOLUMETEXTURE, device, usage, format, pool,
|
||||
hr = wined3d_texture_init(texture, &texture3d_ops, 1, levels,
|
||||
WINED3DRTYPE_VOLUMETEXTURE, device, usage, format, pool,
|
||||
parent, parent_ops, &texture3d_resource_ops);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN("Failed to initialize basetexture, returning %#x.\n", hr);
|
||||
WARN("Failed to initialize texture, returning %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -1353,7 +1287,7 @@ HRESULT volumetexture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT he
|
|||
if (FAILED(hr))
|
||||
{
|
||||
ERR("Creating a volume for the volume texture failed, hr %#x.\n", hr);
|
||||
basetexture_cleanup(texture);
|
||||
wined3d_texture_cleanup(texture);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ void volume_add_dirty_box(struct IWineD3DVolumeImpl *volume, const WINED3DBOX *d
|
|||
}
|
||||
}
|
||||
|
||||
void volume_set_container(IWineD3DVolumeImpl *volume, struct IWineD3DBaseTextureImpl *container)
|
||||
void volume_set_container(IWineD3DVolumeImpl *volume, struct wined3d_texture *container)
|
||||
{
|
||||
TRACE("volume %p, container %p.\n", volume, container);
|
||||
|
||||
|
@ -269,7 +269,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_Map(IWineD3DVolume *iface,
|
|||
if (!(flags & (WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY)))
|
||||
{
|
||||
volume_add_dirty_box(This, &This->lockedBox);
|
||||
basetexture_set_dirty((IWineD3DBaseTextureImpl *)This->container, TRUE);
|
||||
wined3d_texture_set_dirty(This->container, TRUE);
|
||||
}
|
||||
|
||||
This->locked = TRUE;
|
||||
|
|
|
@ -66,6 +66,25 @@
|
|||
@ cdecl wined3d_stateblock_decref(ptr)
|
||||
@ cdecl wined3d_stateblock_incref(ptr)
|
||||
|
||||
@ cdecl wined3d_texture_add_dirty_region(ptr long ptr)
|
||||
@ cdecl wined3d_texture_decref(ptr)
|
||||
@ cdecl wined3d_texture_free_private_data(ptr ptr)
|
||||
@ cdecl wined3d_texture_generate_mipmaps(ptr)
|
||||
@ cdecl wined3d_texture_get_autogen_filter_type(ptr)
|
||||
@ cdecl wined3d_texture_get_level_count(ptr)
|
||||
@ cdecl wined3d_texture_get_lod(ptr)
|
||||
@ cdecl wined3d_texture_get_parent(ptr)
|
||||
@ cdecl wined3d_texture_get_priority(ptr)
|
||||
@ cdecl wined3d_texture_get_private_data(ptr ptr ptr ptr)
|
||||
@ cdecl wined3d_texture_get_sub_resource(ptr long)
|
||||
@ cdecl wined3d_texture_get_type(ptr)
|
||||
@ cdecl wined3d_texture_incref(ptr)
|
||||
@ cdecl wined3d_texture_preload(ptr)
|
||||
@ cdecl wined3d_texture_set_autogen_filter_type(ptr long)
|
||||
@ cdecl wined3d_texture_set_lod(ptr long)
|
||||
@ cdecl wined3d_texture_set_priority(ptr long)
|
||||
@ cdecl wined3d_texture_set_private_data(ptr ptr ptr long long)
|
||||
|
||||
@ cdecl wined3d_vertex_declaration_decref(ptr)
|
||||
@ cdecl wined3d_vertex_declaration_get_parent(ptr)
|
||||
@ cdecl wined3d_vertex_declaration_incref(ptr)
|
||||
|
|
|
@ -55,8 +55,9 @@
|
|||
typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl;
|
||||
typedef struct IWineD3DDeviceImpl IWineD3DDeviceImpl;
|
||||
typedef struct IWineD3DSwapChainImpl IWineD3DSwapChainImpl;
|
||||
typedef struct wined3d_texture IWineD3DBaseTextureImpl;
|
||||
typedef struct wined3d_texture IWineD3DBaseTexture;
|
||||
struct IWineD3DBaseShaderImpl;
|
||||
struct IWineD3DBaseTextureImpl;
|
||||
|
||||
/* Texture format fixups */
|
||||
|
||||
|
@ -1885,9 +1886,9 @@ struct gl_texture
|
|||
|
||||
struct wined3d_texture_ops
|
||||
{
|
||||
HRESULT (*texture_bind)(struct IWineD3DBaseTextureImpl *texture,
|
||||
HRESULT (*texture_bind)(struct wined3d_texture *texture,
|
||||
const struct wined3d_gl_info *gl_info, BOOL srgb);
|
||||
void (*texture_preload)(struct IWineD3DBaseTextureImpl *texture, enum WINED3DSRGB srgb);
|
||||
void (*texture_preload)(struct wined3d_texture *texture, enum WINED3DSRGB srgb);
|
||||
void (*texture_sub_resource_add_dirty_region)(struct wined3d_resource *sub_resource,
|
||||
const WINED3DBOX *dirty_region);
|
||||
void (*texture_sub_resource_cleanup)(struct wined3d_resource *sub_resource);
|
||||
|
@ -1913,21 +1914,18 @@ typedef struct IWineD3DBaseTextureClass
|
|||
GLenum target;
|
||||
} IWineD3DBaseTextureClass;
|
||||
|
||||
typedef struct IWineD3DBaseTextureImpl
|
||||
struct wined3d_texture
|
||||
{
|
||||
/* IUnknown & WineD3DResource Information */
|
||||
const IWineD3DBaseTextureVtbl *lpVtbl;
|
||||
struct wined3d_resource resource;
|
||||
IWineD3DBaseTextureClass baseTexture;
|
||||
};
|
||||
|
||||
} IWineD3DBaseTextureImpl;
|
||||
|
||||
static inline IWineD3DBaseTextureImpl *basetexture_from_resource(struct wined3d_resource *resource)
|
||||
static inline struct wined3d_texture *wined3d_texture_from_resource(struct wined3d_resource *resource)
|
||||
{
|
||||
return CONTAINING_RECORD(resource, IWineD3DBaseTextureImpl, resource);
|
||||
}
|
||||
|
||||
static inline struct gl_texture *basetexture_get_gl_texture(IWineD3DBaseTextureImpl *texture,
|
||||
static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_texture *texture,
|
||||
const struct wined3d_gl_info *gl_info, BOOL srgb)
|
||||
{
|
||||
return srgb && !gl_info->supported[EXT_TEXTURE_SRGB_DECODE]
|
||||
|
@ -1935,12 +1933,10 @@ static inline struct gl_texture *basetexture_get_gl_texture(IWineD3DBaseTextureI
|
|||
: &texture->baseTexture.texture_rgb;
|
||||
}
|
||||
|
||||
void basetexture_apply_state_changes(IWineD3DBaseTextureImpl *texture,
|
||||
void wined3d_texture_apply_state_changes(IWineD3DBaseTextureImpl *texture,
|
||||
const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1],
|
||||
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
|
||||
struct wined3d_resource *basetexture_get_sub_resource(IWineD3DBaseTextureImpl *texture,
|
||||
UINT sub_resource_idx) DECLSPEC_HIDDEN;
|
||||
void basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPEC_HIDDEN;
|
||||
void wined3d_texture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT cubetexture_init(IWineD3DBaseTextureImpl *texture, UINT edge_length, UINT levels,
|
||||
IWineD3DDeviceImpl *device, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
|
@ -1959,8 +1955,7 @@ typedef struct IWineD3DVolumeImpl
|
|||
/* IUnknown & WineD3DResource fields */
|
||||
const IWineD3DVolumeVtbl *lpVtbl;
|
||||
struct wined3d_resource resource;
|
||||
|
||||
struct IWineD3DBaseTextureImpl *container;
|
||||
struct wined3d_texture *container;
|
||||
BOOL lockable;
|
||||
BOOL locked;
|
||||
WINED3DBOX lockedBox;
|
||||
|
@ -1978,7 +1973,7 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT
|
|||
UINT height, UINT depth, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool,
|
||||
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
|
||||
void volume_load(IWineD3DVolumeImpl *volume, UINT level, BOOL srgb_mode) DECLSPEC_HIDDEN;
|
||||
void volume_set_container(IWineD3DVolumeImpl *volume, struct IWineD3DBaseTextureImpl *container) DECLSPEC_HIDDEN;
|
||||
void volume_set_container(IWineD3DVolumeImpl *volume, struct wined3d_texture *container) DECLSPEC_HIDDEN;
|
||||
|
||||
/*****************************************************************************
|
||||
* Structure for DIB Surfaces (GetDC and GDI surfaces)
|
||||
|
@ -2028,7 +2023,7 @@ struct wined3d_subresource_container
|
|||
union
|
||||
{
|
||||
struct IWineD3DSwapChainImpl *swapchain;
|
||||
struct IWineD3DBaseTextureImpl *texture;
|
||||
struct wined3d_texture *texture;
|
||||
void *base;
|
||||
} u;
|
||||
};
|
||||
|
|
|
@ -2097,6 +2097,7 @@ struct wined3d_palette;
|
|||
struct wined3d_query;
|
||||
struct wined3d_resource;
|
||||
struct wined3d_stateblock;
|
||||
struct wined3d_texture;
|
||||
struct wined3d_vertex_declaration;
|
||||
|
||||
[
|
||||
|
@ -2335,36 +2336,6 @@ interface IWineD3DVolume : IWineD3DResource
|
|||
);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(3c2aebf6-6f30-11d9-c687-00046142c14f)
|
||||
]
|
||||
interface IWineD3DBaseTexture : IWineD3DResource
|
||||
{
|
||||
DWORD SetLOD(
|
||||
[in] DWORD new_lod
|
||||
);
|
||||
DWORD GetLOD(
|
||||
);
|
||||
DWORD GetLevelCount(
|
||||
);
|
||||
HRESULT SetAutoGenFilterType(
|
||||
WINED3DTEXTUREFILTERTYPE filter_type
|
||||
);
|
||||
WINED3DTEXTUREFILTERTYPE GetAutoGenFilterType(
|
||||
);
|
||||
void GenerateMipSubLevels(
|
||||
);
|
||||
struct wined3d_resource *GetSubResource(
|
||||
[in] UINT sub_resource_idx
|
||||
);
|
||||
HRESULT AddDirtyRegion(
|
||||
[in] UINT layer,
|
||||
[in] const WINED3DBOX *dirty_region
|
||||
);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
|
@ -2522,7 +2493,7 @@ interface IWineD3DDevice : IUnknown
|
|||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] IWineD3DBaseTexture **texture
|
||||
[out] struct wined3d_texture **texture
|
||||
);
|
||||
HRESULT CreateVolumeTexture(
|
||||
[in] UINT width,
|
||||
|
@ -2534,7 +2505,7 @@ interface IWineD3DDevice : IUnknown
|
|||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] IWineD3DBaseTexture **texture
|
||||
[out] struct wined3d_texture **texture
|
||||
);
|
||||
HRESULT CreateVolume(
|
||||
[in] UINT width,
|
||||
|
@ -2555,7 +2526,7 @@ interface IWineD3DDevice : IUnknown
|
|||
[in] WINED3DPOOL pool,
|
||||
[in] void *parent,
|
||||
[in] const struct wined3d_parent_ops *parent_ops,
|
||||
[out] IWineD3DBaseTexture **texture
|
||||
[out] struct wined3d_texture **texture
|
||||
);
|
||||
HRESULT CreateQuery(
|
||||
[in] WINED3DQUERYTYPE type,
|
||||
|
@ -2855,11 +2826,11 @@ interface IWineD3DDevice : IUnknown
|
|||
);
|
||||
HRESULT SetTexture(
|
||||
[in] DWORD stage,
|
||||
[in] IWineD3DBaseTexture *texture
|
||||
[in] struct wined3d_texture *texture
|
||||
);
|
||||
HRESULT GetTexture(
|
||||
[in] DWORD stage,
|
||||
[out] IWineD3DBaseTexture **texture
|
||||
[out] struct wined3d_texture **texture
|
||||
);
|
||||
HRESULT SetTextureStageState(
|
||||
[in] DWORD stage,
|
||||
|
@ -3025,8 +2996,8 @@ interface IWineD3DDevice : IUnknown
|
|||
[in] const WINED3DCOLORVALUE *color
|
||||
);
|
||||
HRESULT UpdateTexture(
|
||||
[in] IWineD3DBaseTexture *src_texture,
|
||||
[in] IWineD3DBaseTexture *dst_texture
|
||||
[in] struct wined3d_texture *src_texture,
|
||||
[in] struct wined3d_texture *dst_texture
|
||||
);
|
||||
HRESULT UpdateSurface(
|
||||
[in] IWineD3DSurface *src_surface,
|
||||
|
@ -3153,6 +3124,30 @@ HRESULT __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock
|
|||
ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
|
||||
ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
|
||||
|
||||
HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
|
||||
UINT layer, const WINED3DBOX *dirty_region);
|
||||
ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture);
|
||||
HRESULT __cdecl wined3d_texture_free_private_data(struct wined3d_texture *texture, REFGUID guid);
|
||||
void __cdecl wined3d_texture_generate_mipmaps(struct wined3d_texture *texture);
|
||||
WINED3DTEXTUREFILTERTYPE __cdecl wined3d_texture_get_autogen_filter_type(const struct wined3d_texture *texture);
|
||||
DWORD __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture);
|
||||
DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture);
|
||||
void * __cdecl wined3d_texture_get_parent(const struct wined3d_texture *texture);
|
||||
DWORD __cdecl wined3d_texture_get_priority(const struct wined3d_texture *texture);
|
||||
HRESULT __cdecl wined3d_texture_get_private_data(const struct wined3d_texture *texture,
|
||||
REFGUID guid, void *data, DWORD *data_size);
|
||||
struct wined3d_resource * __cdecl wined3d_texture_get_sub_resource(struct wined3d_texture *texture,
|
||||
UINT sub_resource_idx);
|
||||
WINED3DRESOURCETYPE __cdecl wined3d_texture_get_type(const struct wined3d_texture *texture);
|
||||
ULONG __cdecl wined3d_texture_incref(struct wined3d_texture *texture);
|
||||
void __cdecl wined3d_texture_preload(struct wined3d_texture *texture);
|
||||
HRESULT __cdecl wined3d_texture_set_autogen_filter_type(struct wined3d_texture *texture,
|
||||
WINED3DTEXTUREFILTERTYPE filter_type);
|
||||
DWORD __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod);
|
||||
DWORD __cdecl wined3d_texture_set_priority(struct wined3d_texture *texture, DWORD priority);
|
||||
HRESULT __cdecl wined3d_texture_set_private_data(struct wined3d_texture *texture,
|
||||
REFGUID guid, const void *data, DWORD data_size, DWORD flags);
|
||||
|
||||
ULONG __cdecl wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration);
|
||||
void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration);
|
||||
ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration);
|
||||
|
|
Loading…
Reference in New Issue