wined3d: Pass an IWineD3DBaseTextureImpl pointer to basetexture_set_lod().

This commit is contained in:
Henri Verbeet 2011-01-02 12:26:35 +01:00 committed by Alexandre Julliard
parent fa973b812d
commit 482a5fd030
5 changed files with 21 additions and 22 deletions

View File

@ -127,33 +127,32 @@ void basetexture_unload(IWineD3DBaseTextureImpl *texture)
resource_unload((IWineD3DResourceImpl *)texture); resource_unload((IWineD3DResourceImpl *)texture);
} }
DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew) DWORD basetexture_set_lod(IWineD3DBaseTextureImpl *texture, DWORD lod)
{ {
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; DWORD old = texture->baseTexture.LOD;
DWORD old = This->baseTexture.LOD;
TRACE("texture %p, lod %u.\n", texture, lod);
/* The d3d9:texture test shows that SetLOD is ignored on non-managed /* The d3d9:texture test shows that SetLOD is ignored on non-managed
* textures. The call always returns 0, and GetLOD always returns 0 * textures. The call always returns 0, and GetLOD always returns 0. */
*/ if (texture->resource.pool != WINED3DPOOL_MANAGED)
if (This->resource.pool != WINED3DPOOL_MANAGED) { {
TRACE("Ignoring SetLOD on %s texture, returning 0\n", debug_d3dpool(This->resource.pool)); TRACE("Ignoring SetLOD on %s texture, returning 0.\n", debug_d3dpool(texture->resource.pool));
return 0; return 0;
} }
if (LODNew >= This->baseTexture.level_count) if (lod >= texture->baseTexture.level_count)
LODNew = This->baseTexture.level_count - 1; lod = texture->baseTexture.level_count - 1;
if(This->baseTexture.LOD != LODNew) { if (texture->baseTexture.LOD != lod)
This->baseTexture.LOD = LODNew; {
texture->baseTexture.LOD = lod;
This->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U; texture->baseTexture.texture_rgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U;
This->baseTexture.texture_srgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U; texture->baseTexture.texture_srgb.states[WINED3DTEXSTA_MAXMIPLEVEL] = ~0U;
if(This->baseTexture.bindCount) { if (texture->baseTexture.bindCount)
IWineD3DDeviceImpl_MarkStateDirty(This->resource.device, STATE_SAMPLER(This->baseTexture.sampler)); IWineD3DDeviceImpl_MarkStateDirty(texture->resource.device, STATE_SAMPLER(texture->baseTexture.sampler));
} }
}
TRACE("(%p) : set LOD to %d\n", This, This->baseTexture.LOD);
return old; return old;
} }

View File

@ -247,7 +247,7 @@ static void * WINAPI IWineD3DCubeTextureImpl_GetParent(IWineD3DCubeTexture *ifac
IWineD3DCubeTexture IWineD3DBaseTexture parts follow IWineD3DCubeTexture IWineD3DBaseTexture parts follow
****************************************************** */ ****************************************************** */
static DWORD WINAPI IWineD3DCubeTextureImpl_SetLOD(IWineD3DCubeTexture *iface, DWORD LODNew) { static DWORD WINAPI IWineD3DCubeTextureImpl_SetLOD(IWineD3DCubeTexture *iface, DWORD LODNew) {
return basetexture_set_lod((IWineD3DBaseTexture *)iface, LODNew); return basetexture_set_lod((IWineD3DBaseTextureImpl *)iface, LODNew);
} }
static DWORD WINAPI IWineD3DCubeTextureImpl_GetLOD(IWineD3DCubeTexture *iface) { static DWORD WINAPI IWineD3DCubeTextureImpl_GetLOD(IWineD3DCubeTexture *iface) {

View File

@ -238,7 +238,7 @@ static void * WINAPI IWineD3DTextureImpl_GetParent(IWineD3DTexture *iface)
IWineD3DTexture IWineD3DBaseTexture parts follow IWineD3DTexture IWineD3DBaseTexture parts follow
****************************************************** */ ****************************************************** */
static DWORD WINAPI IWineD3DTextureImpl_SetLOD(IWineD3DTexture *iface, DWORD LODNew) { static DWORD WINAPI IWineD3DTextureImpl_SetLOD(IWineD3DTexture *iface, DWORD LODNew) {
return basetexture_set_lod((IWineD3DBaseTexture *)iface, LODNew); return basetexture_set_lod((IWineD3DBaseTextureImpl *)iface, LODNew);
} }
static DWORD WINAPI IWineD3DTextureImpl_GetLOD(IWineD3DTexture *iface) { static DWORD WINAPI IWineD3DTextureImpl_GetLOD(IWineD3DTexture *iface) {

View File

@ -202,7 +202,7 @@ static void * WINAPI IWineD3DVolumeTextureImpl_GetParent(IWineD3DVolumeTexture *
IWineD3DVolumeTexture IWineD3DBaseTexture parts follow IWineD3DVolumeTexture IWineD3DBaseTexture parts follow
****************************************************** */ ****************************************************** */
static DWORD WINAPI IWineD3DVolumeTextureImpl_SetLOD(IWineD3DVolumeTexture *iface, DWORD LODNew) { static DWORD WINAPI IWineD3DVolumeTextureImpl_SetLOD(IWineD3DVolumeTexture *iface, DWORD LODNew) {
return basetexture_set_lod((IWineD3DBaseTexture *)iface, LODNew); return basetexture_set_lod((IWineD3DBaseTextureImpl *)iface, LODNew);
} }
static DWORD WINAPI IWineD3DVolumeTextureImpl_GetLOD(IWineD3DVolumeTexture *iface) { static DWORD WINAPI IWineD3DVolumeTextureImpl_GetLOD(IWineD3DVolumeTexture *iface) {

View File

@ -1927,7 +1927,7 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UIN
HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface,
WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN; WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN;
BOOL basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPEC_HIDDEN; BOOL basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPEC_HIDDEN;
DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD new_lod) DECLSPEC_HIDDEN; DWORD basetexture_set_lod(IWineD3DBaseTextureImpl *texture, DWORD lod) DECLSPEC_HIDDEN;
void basetexture_unload(IWineD3DBaseTextureImpl *texture) DECLSPEC_HIDDEN; void basetexture_unload(IWineD3DBaseTextureImpl *texture) DECLSPEC_HIDDEN;
/***************************************************************************** /*****************************************************************************