From 63fd9a7a9881d2175aae78c647c6c1dd4f7b5a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 6 Apr 2006 19:02:16 +0200 Subject: [PATCH] wined3d: Add WINED3DTEXTUREFILTERTYPE to wined3d_types.h. --- dlls/d3d9/basetexture.c | 4 ++-- dlls/d3d9/cubetexture.c | 4 ++-- dlls/d3d9/device.c | 2 +- dlls/d3d9/texture.c | 4 ++-- dlls/d3d9/volumetexture.c | 4 ++-- dlls/wined3d/basetexture.c | 29 ++++++++++++------------ dlls/wined3d/cubetexture.c | 4 ++-- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/directx.c | 38 ++++++++++++++++---------------- dlls/wined3d/stateblock.c | 6 ++--- dlls/wined3d/texture.c | 4 ++-- dlls/wined3d/volumetexture.c | 4 ++-- dlls/wined3d/wined3d_private.h | 6 ++--- include/wine/wined3d_interface.h | 18 +++++++-------- include/wine/wined3d_types.h | 12 ++++++++++ 15 files changed, 77 insertions(+), 66 deletions(-) diff --git a/dlls/d3d9/basetexture.c b/dlls/d3d9/basetexture.c index b8a550e9864..cd6157b40c4 100644 --- a/dlls/d3d9/basetexture.c +++ b/dlls/d3d9/basetexture.c @@ -134,13 +134,13 @@ DWORD WINAPI IDirect3DBaseTexture9Impl_GetLevelCount(LPDIRECT3DBASETEXTURE9 ifac HRESULT WINAPI IDirect3DBaseTexture9Impl_SetAutoGenFilterType(LPDIRECT3DBASETEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType) { IDirect3DBaseTexture9Impl *This = (IDirect3DBaseTexture9Impl *)iface; TRACE("(%p) Relay\n" , This); - return IWineD3DBaseTexture_SetAutoGenFilterType(This->wineD3DBaseTexture, FilterType); + return IWineD3DBaseTexture_SetAutoGenFilterType(This->wineD3DBaseTexture, (WINED3DTEXTUREFILTERTYPE) FilterType); } D3DTEXTUREFILTERTYPE WINAPI IDirect3DBaseTexture9Impl_GetAutoGenFilterType(LPDIRECT3DBASETEXTURE9 iface) { IDirect3DBaseTexture9Impl *This = (IDirect3DBaseTexture9Impl *)iface; TRACE("(%p) Relay\n" , This); - return IWineD3DBaseTexture_GetAutoGenFilterType(This->wineD3DBaseTexture); + return (D3DTEXTUREFILTERTYPE) IWineD3DBaseTexture_GetAutoGenFilterType(This->wineD3DBaseTexture); } void WINAPI IDirect3DBaseTexture9Impl_GenerateMipSubLevels(LPDIRECT3DBASETEXTURE9 iface) { diff --git a/dlls/d3d9/cubetexture.c b/dlls/d3d9/cubetexture.c index 4b4ab531b1d..255b75cecaf 100644 --- a/dlls/d3d9/cubetexture.c +++ b/dlls/d3d9/cubetexture.c @@ -136,13 +136,13 @@ DWORD WINAPI IDirect3DCubeTexture9Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE9 ifac HRESULT WINAPI IDirect3DCubeTexture9Impl_SetAutoGenFilterType(LPDIRECT3DCUBETEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType) { IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl *)iface; TRACE("(%p) Relay\n", This); - return IWineD3DCubeTexture_SetAutoGenFilterType(This->wineD3DCubeTexture, FilterType); + return IWineD3DCubeTexture_SetAutoGenFilterType(This->wineD3DCubeTexture, (WINED3DTEXTUREFILTERTYPE) FilterType); } D3DTEXTUREFILTERTYPE WINAPI IDirect3DCubeTexture9Impl_GetAutoGenFilterType(LPDIRECT3DCUBETEXTURE9 iface) { IDirect3DCubeTexture9Impl *This = (IDirect3DCubeTexture9Impl *)iface; TRACE("(%p) Relay\n", This); - return IWineD3DCubeTexture_GetAutoGenFilterType(This->wineD3DCubeTexture); + return (D3DTEXTUREFILTERTYPE) IWineD3DCubeTexture_GetAutoGenFilterType(This->wineD3DCubeTexture); } void WINAPI IDirect3DCubeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DCUBETEXTURE9 iface) { diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index ab0ffcb98eb..cd1a5cd0b31 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -344,7 +344,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetFrontBufferData(LPDIRECT3DDEVICE9 iface HRESULT WINAPI IDirect3DDevice9Impl_StretchRect(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; TRACE("(%p) Relay\n" , This); - return IWineD3DDevice_StretchRect(This->WineD3DDevice, ((IDirect3DSurface9Impl *)pSourceSurface)->wineD3DSurface, pSourceRect, ((IDirect3DSurface9Impl *)pDestSurface)->wineD3DSurface, pDestRect, Filter); + return IWineD3DDevice_StretchRect(This->WineD3DDevice, ((IDirect3DSurface9Impl *)pSourceSurface)->wineD3DSurface, pSourceRect, ((IDirect3DSurface9Impl *)pDestSurface)->wineD3DSurface, pDestRect, (WINED3DTEXTUREFILTERTYPE) Filter); } HRESULT WINAPI IDirect3DDevice9Impl_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) { diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 011c094b4bb..4763239c786 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -135,13 +135,13 @@ DWORD WINAPI IDirect3DTexture9Impl_GetLevelCount(LPDIRECT3DTEXTURE9 iface) { HRESULT WINAPI IDirect3DTexture9Impl_SetAutoGenFilterType(LPDIRECT3DTEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType) { IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface; TRACE("(%p) Relay\n", This); - return IWineD3DTexture_SetAutoGenFilterType(This->wineD3DTexture, FilterType); + return IWineD3DTexture_SetAutoGenFilterType(This->wineD3DTexture, (WINED3DTEXTUREFILTERTYPE) FilterType); } D3DTEXTUREFILTERTYPE WINAPI IDirect3DTexture9Impl_GetAutoGenFilterType(LPDIRECT3DTEXTURE9 iface) { IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface; TRACE("(%p) Relay\n", This); - return IWineD3DTexture_GetAutoGenFilterType(This->wineD3DTexture); + return (D3DTEXTUREFILTERTYPE) IWineD3DTexture_GetAutoGenFilterType(This->wineD3DTexture); } void WINAPI IDirect3DTexture9Impl_GenerateMipSubLevels(LPDIRECT3DTEXTURE9 iface) { diff --git a/dlls/d3d9/volumetexture.c b/dlls/d3d9/volumetexture.c index db330c56892..d92e4b544ba 100644 --- a/dlls/d3d9/volumetexture.c +++ b/dlls/d3d9/volumetexture.c @@ -134,13 +134,13 @@ DWORD WINAPI IDirect3DVolumeTexture9Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE9 HRESULT WINAPI IDirect3DVolumeTexture9Impl_SetAutoGenFilterType(LPDIRECT3DVOLUMETEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType) { IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface; TRACE("(%p) Relay\n", This); - return IWineD3DVolumeTexture_SetAutoGenFilterType(This->wineD3DVolumeTexture, FilterType); + return IWineD3DVolumeTexture_SetAutoGenFilterType(This->wineD3DVolumeTexture, (WINED3DTEXTUREFILTERTYPE) FilterType); } D3DTEXTUREFILTERTYPE WINAPI IDirect3DVolumeTexture9Impl_GetAutoGenFilterType(LPDIRECT3DVOLUMETEXTURE9 iface) { IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface; TRACE("(%p) Relay\n", This); - return IWineD3DVolumeTexture_GetAutoGenFilterType(This->wineD3DVolumeTexture); + return (D3DTEXTUREFILTERTYPE) IWineD3DVolumeTexture_GetAutoGenFilterType(This->wineD3DVolumeTexture); } void WINAPI IDirect3DVolumeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DVOLUMETEXTURE9 iface) { diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 9938abd7d98..1aaac3c4150 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -184,7 +184,7 @@ DWORD WINAPI IWineD3DBaseTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface) { return This->baseTexture.levels; } -HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface, D3DTEXTUREFILTERTYPE FilterType) { +HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) { IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; if (!(This->baseTexture.usage & WINED3DUSAGE_AUTOGENMIPMAP)) { @@ -196,14 +196,13 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture return D3D_OK; } -D3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface) { +WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface) { IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; FIXME("(%p) : stub\n", This); if (!(This->baseTexture.usage & WINED3DUSAGE_AUTOGENMIPMAP)) { - return D3DTEXF_NONE; + return WINED3DTEXF_NONE; } return This->baseTexture.filterType; - return D3DTEXF_LINEAR; /* default */ } void WINAPI IWineD3DBaseTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface) { @@ -260,9 +259,9 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) { This->baseTexture.states[WINED3DTEXSTA_ADDRESSV] = D3DTADDRESS_WRAP; This->baseTexture.states[WINED3DTEXSTA_ADDRESSW] = D3DTADDRESS_WRAP; This->baseTexture.states[WINED3DTEXSTA_BORDERCOLOR] = 0; - This->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = D3DTEXF_LINEAR; - This->baseTexture.states[WINED3DTEXSTA_MINFILTER] = D3DTEXF_POINT; /* GL_NEAREST_MIPMAP_LINEAR */ - This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] = D3DTEXF_LINEAR; /* GL_NEAREST_MIPMAP_LINEAR */ + This->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_LINEAR; + This->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; /* GL_NEAREST_MIPMAP_LINEAR */ + This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_LINEAR; /* GL_NEAREST_MIPMAP_LINEAR */ This->baseTexture.states[WINED3DTEXSTA_MAXMIPLEVEL] = 0; This->baseTexture.states[WINED3DTEXSTA_MAXANISOTROPY] = 0; This->baseTexture.states[WINED3DTEXSTA_SRGBTEXTURE] = 0; @@ -386,8 +385,8 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface glValue = stateLookup[WINELOOKUP_MAGFILTER][*state - minLookup[WINELOOKUP_MAGFILTER]]; TRACE("ValueMAG=%ld setting MAGFILTER to %x\n", *state, glValue); glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue); - /* We need to reset the Aniotropic filtering state when we change the mag filter to D3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentataion to see how it should be switched off. */ - if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC) && D3DTEXF_ANISOTROPIC == *state) { + /* We need to reset the Aniotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentataion to see how it should be switched off. */ + if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC) && WINED3DTEXF_ANISOTROPIC == *state) { glTexParameteri(textureDimensions, GL_TEXTURE_MAX_ANISOTROPY_EXT, samplerStates[WINED3DSAMP_MAXANISOTROPY]); } } @@ -399,10 +398,10 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface { GLint glValue; *state = samplerStates[textureObjectSamplerStates[i].state]; - if (This->baseTexture.states[WINED3DTEXSTA_MINFILTER] < D3DTEXF_NONE || - This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] < D3DTEXF_NONE || - This->baseTexture.states[WINED3DTEXSTA_MINFILTER] > D3DTEXF_ANISOTROPIC || - This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] > D3DTEXF_LINEAR) + if (This->baseTexture.states[WINED3DTEXSTA_MINFILTER] < WINED3DTEXF_NONE || + This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] < WINED3DTEXF_NONE || + This->baseTexture.states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC || + This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_LINEAR) { FIXME("Unrecognized or unsupported D3DSAMP_MINFILTER value %ld, state %d D3DSAMP_MIPFILTER value %ld, state %d\n", @@ -411,8 +410,8 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface This->baseTexture.states[WINED3DTEXSTA_MIPFILTER], textureObjectSamplerStates[WINED3DTEXSTA_MIPFILTER].function); } - glValue = minMipLookup[min(max(This->baseTexture.states[WINED3DTEXSTA_MINFILTER],D3DTEXF_NONE), D3DTEXF_ANISOTROPIC)] - [min(max(This->baseTexture.states[WINED3DTEXSTA_MIPFILTER],D3DTEXF_NONE), D3DTEXF_LINEAR)]; + glValue = minMipLookup[min(max(This->baseTexture.states[WINED3DTEXSTA_MINFILTER],WINED3DTEXF_NONE), WINED3DTEXF_ANISOTROPIC)] + [min(max(This->baseTexture.states[WINED3DTEXSTA_MIPFILTER],WINED3DTEXF_NONE), WINED3DTEXF_LINEAR)]; TRACE("ValueMIN=%ld, ValueMIP=%ld, setting MINFILTER to %x\n", This->baseTexture.states[WINED3DTEXSTA_MINFILTER], diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index f07c58bb4cb..33af9f431a8 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -180,11 +180,11 @@ DWORD WINAPI IWineD3DCubeTextureImpl_GetLevelCount(IWineD3DCubeTexture *iface) { return IWineD3DBaseTextureImpl_GetLevelCount((IWineD3DBaseTexture *)iface); } -HRESULT WINAPI IWineD3DCubeTextureImpl_SetAutoGenFilterType(IWineD3DCubeTexture *iface, D3DTEXTUREFILTERTYPE FilterType) { +HRESULT WINAPI IWineD3DCubeTextureImpl_SetAutoGenFilterType(IWineD3DCubeTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) { return IWineD3DBaseTextureImpl_SetAutoGenFilterType((IWineD3DBaseTexture *)iface, FilterType); } -D3DTEXTUREFILTERTYPE WINAPI IWineD3DCubeTextureImpl_GetAutoGenFilterType(IWineD3DCubeTexture *iface) { +WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DCubeTextureImpl_GetAutoGenFilterType(IWineD3DCubeTexture *iface) { return IWineD3DBaseTextureImpl_GetAutoGenFilterType((IWineD3DBaseTexture *)iface); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 24409ea7fb8..7b0c1208fe4 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -113,7 +113,7 @@ static void WINAPI IWineD3DDeviceImpl_ApplyTextureUnitState(IWineD3DDevice *ifac #define D3DINITIALIZEBASETEXTURE(_basetexture) { \ _basetexture.levels = Levels; \ - _basetexture.filterType = (Usage & WINED3DUSAGE_AUTOGENMIPMAP) ? D3DTEXF_LINEAR : D3DTEXF_NONE; \ + _basetexture.filterType = (Usage & WINED3DUSAGE_AUTOGENMIPMAP) ? WINED3DTEXF_LINEAR : WINED3DTEXF_NONE; \ _basetexture.LOD = 0; \ _basetexture.dirty = TRUE; \ } @@ -5269,7 +5269,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture (IWineD3DDevice *iface, IWineD3D HRESULT WINAPI IWineD3DDeviceImpl_StretchRect(IWineD3DDevice *iface, IWineD3DSurface *pSourceSurface, CONST RECT* pSourceRect, IWineD3DSurface *pDestinationSurface, - CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) { + CONST RECT* pDestRect, WINED3DTEXTUREFILTERTYPE Filter) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; TRACE("(%p) : stub\n", This); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index e6f36997005..c6994d88167 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -63,7 +63,7 @@ int minLookup[MAX_LOOKUPS]; int maxLookup[MAX_LOOKUPS]; DWORD *stateLookup[MAX_LOOKUPS]; -DWORD minMipLookup[D3DTEXF_ANISOTROPIC + 1][D3DTEXF_LINEAR + 1]; +DWORD minMipLookup[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1]; @@ -667,8 +667,8 @@ static BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) minLookup[WINELOOKUP_WARPPARAM] = D3DTADDRESS_WRAP; maxLookup[WINELOOKUP_WARPPARAM] = D3DTADDRESS_MIRRORONCE; - minLookup[WINELOOKUP_MAGFILTER] = D3DTEXF_NONE; - maxLookup[WINELOOKUP_MAGFILTER] = D3DTEXF_ANISOTROPIC; + minLookup[WINELOOKUP_MAGFILTER] = WINED3DTEXF_NONE; + maxLookup[WINELOOKUP_MAGFILTER] = WINED3DTEXF_ANISOTROPIC; for (i = 0; i < MAX_LOOKUPS; i++) { @@ -686,26 +686,26 @@ static BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) stateLookup[WINELOOKUP_WARPPARAM][D3DTADDRESS_MIRRORONCE - minLookup[WINELOOKUP_WARPPARAM]] = gl_info->supported[ATI_TEXTURE_MIRROR_ONCE] ? GL_MIRROR_CLAMP_TO_EDGE_ATI : GL_REPEAT; - stateLookup[WINELOOKUP_MAGFILTER][D3DTEXF_NONE - minLookup[WINELOOKUP_MAGFILTER]] = GL_NEAREST; - stateLookup[WINELOOKUP_MAGFILTER][D3DTEXF_POINT - minLookup[WINELOOKUP_MAGFILTER]] = GL_NEAREST; - stateLookup[WINELOOKUP_MAGFILTER][D3DTEXF_LINEAR - minLookup[WINELOOKUP_MAGFILTER]] = GL_LINEAR; - stateLookup[WINELOOKUP_MAGFILTER][D3DTEXF_ANISOTROPIC - minLookup[WINELOOKUP_MAGFILTER]] = + stateLookup[WINELOOKUP_MAGFILTER][WINED3DTEXF_NONE - minLookup[WINELOOKUP_MAGFILTER]] = GL_NEAREST; + stateLookup[WINELOOKUP_MAGFILTER][WINED3DTEXF_POINT - minLookup[WINELOOKUP_MAGFILTER]] = GL_NEAREST; + stateLookup[WINELOOKUP_MAGFILTER][WINED3DTEXF_LINEAR - minLookup[WINELOOKUP_MAGFILTER]] = GL_LINEAR; + stateLookup[WINELOOKUP_MAGFILTER][WINED3DTEXF_ANISOTROPIC - minLookup[WINELOOKUP_MAGFILTER]] = gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC] ? GL_LINEAR : GL_NEAREST; - minMipLookup[D3DTEXF_NONE][D3DTEXF_NONE] = GL_LINEAR; - minMipLookup[D3DTEXF_NONE][D3DTEXF_POINT] = GL_LINEAR; - minMipLookup[D3DTEXF_NONE][D3DTEXF_LINEAR] = GL_LINEAR; - minMipLookup[D3DTEXF_POINT][D3DTEXF_NONE] = GL_NEAREST; - minMipLookup[D3DTEXF_POINT][D3DTEXF_POINT] = GL_NEAREST_MIPMAP_NEAREST; - minMipLookup[D3DTEXF_POINT][D3DTEXF_LINEAR] = GL_NEAREST_MIPMAP_LINEAR; - minMipLookup[D3DTEXF_LINEAR][D3DTEXF_NONE] = GL_LINEAR; - minMipLookup[D3DTEXF_LINEAR][D3DTEXF_POINT] = GL_LINEAR_MIPMAP_NEAREST; - minMipLookup[D3DTEXF_LINEAR][D3DTEXF_LINEAR] = GL_LINEAR_MIPMAP_LINEAR; - minMipLookup[D3DTEXF_ANISOTROPIC][D3DTEXF_NONE] = gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC] ? + minMipLookup[WINED3DTEXF_NONE][WINED3DTEXF_NONE] = GL_LINEAR; + minMipLookup[WINED3DTEXF_NONE][WINED3DTEXF_POINT] = GL_LINEAR; + minMipLookup[WINED3DTEXF_NONE][WINED3DTEXF_LINEAR] = GL_LINEAR; + minMipLookup[WINED3DTEXF_POINT][WINED3DTEXF_NONE] = GL_NEAREST; + minMipLookup[WINED3DTEXF_POINT][WINED3DTEXF_POINT] = GL_NEAREST_MIPMAP_NEAREST; + minMipLookup[WINED3DTEXF_POINT][WINED3DTEXF_LINEAR] = GL_NEAREST_MIPMAP_LINEAR; + minMipLookup[WINED3DTEXF_LINEAR][WINED3DTEXF_NONE] = GL_LINEAR; + minMipLookup[WINED3DTEXF_LINEAR][WINED3DTEXF_POINT] = GL_LINEAR_MIPMAP_NEAREST; + minMipLookup[WINED3DTEXF_LINEAR][WINED3DTEXF_LINEAR] = GL_LINEAR_MIPMAP_LINEAR; + minMipLookup[WINED3DTEXF_ANISOTROPIC][WINED3DTEXF_NONE] = gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC] ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR; - minMipLookup[D3DTEXF_ANISOTROPIC][D3DTEXF_POINT] = gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC] ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR; - minMipLookup[D3DTEXF_ANISOTROPIC][D3DTEXF_LINEAR] = gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC] ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR; + minMipLookup[WINED3DTEXF_ANISOTROPIC][WINED3DTEXF_POINT] = gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC] ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR; + minMipLookup[WINED3DTEXF_ANISOTROPIC][WINED3DTEXF_LINEAR] = gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC] ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR; /* TODO: config lookups */ diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index fe0a98f39c4..4183b81b849 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -785,9 +785,9 @@ HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock* This->samplerState[i][WINED3DSAMP_ADDRESSV ] = D3DTADDRESS_WRAP; This->samplerState[i][WINED3DSAMP_ADDRESSW ] = D3DTADDRESS_WRAP; This->samplerState[i][WINED3DSAMP_BORDERCOLOR ] = 0x00; - This->samplerState[i][WINED3DSAMP_MAGFILTER ] = D3DTEXF_POINT; - This->samplerState[i][WINED3DSAMP_MINFILTER ] = D3DTEXF_POINT; - This->samplerState[i][WINED3DSAMP_MIPFILTER ] = D3DTEXF_NONE; + This->samplerState[i][WINED3DSAMP_MAGFILTER ] = WINED3DTEXF_POINT; + This->samplerState[i][WINED3DSAMP_MINFILTER ] = WINED3DTEXF_POINT; + This->samplerState[i][WINED3DSAMP_MIPFILTER ] = WINED3DTEXF_NONE; This->samplerState[i][WINED3DSAMP_MIPMAPLODBIAS ] = 0; This->samplerState[i][WINED3DSAMP_MAXMIPLEVEL ] = 0; This->samplerState[i][WINED3DSAMP_MAXANISOTROPY ] = 1; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index ae6f56b7ff5..47c2c504ca3 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -164,11 +164,11 @@ DWORD WINAPI IWineD3DTextureImpl_GetLevelCount(IWineD3DTexture *iface) { return IWineD3DBaseTextureImpl_GetLevelCount((IWineD3DBaseTexture *)iface); } -HRESULT WINAPI IWineD3DTextureImpl_SetAutoGenFilterType(IWineD3DTexture *iface, D3DTEXTUREFILTERTYPE FilterType) { +HRESULT WINAPI IWineD3DTextureImpl_SetAutoGenFilterType(IWineD3DTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) { return IWineD3DBaseTextureImpl_SetAutoGenFilterType((IWineD3DBaseTexture *)iface, FilterType); } -D3DTEXTUREFILTERTYPE WINAPI IWineD3DTextureImpl_GetAutoGenFilterType(IWineD3DTexture *iface) { +WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DTextureImpl_GetAutoGenFilterType(IWineD3DTexture *iface) { return IWineD3DBaseTextureImpl_GetAutoGenFilterType((IWineD3DBaseTexture *)iface); } diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index 8eb9a4f2d94..bd08bcfc2a4 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -155,11 +155,11 @@ DWORD WINAPI IWineD3DVolumeTextureImpl_GetLevelCount(IWineD3DVolumeTexture *ifac return IWineD3DBaseTextureImpl_GetLevelCount((IWineD3DBaseTexture *)iface); } -HRESULT WINAPI IWineD3DVolumeTextureImpl_SetAutoGenFilterType(IWineD3DVolumeTexture *iface, D3DTEXTUREFILTERTYPE FilterType) { +HRESULT WINAPI IWineD3DVolumeTextureImpl_SetAutoGenFilterType(IWineD3DVolumeTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType) { return IWineD3DBaseTextureImpl_SetAutoGenFilterType((IWineD3DBaseTexture *)iface, FilterType); } -D3DTEXTUREFILTERTYPE WINAPI IWineD3DVolumeTextureImpl_GetAutoGenFilterType(IWineD3DVolumeTexture *iface) { +WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DVolumeTextureImpl_GetAutoGenFilterType(IWineD3DVolumeTexture *iface) { return IWineD3DBaseTextureImpl_GetAutoGenFilterType((IWineD3DBaseTexture *)iface); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 817f05db451..2c51b74ad4b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -689,7 +689,7 @@ typedef struct IWineD3DBaseTextureClass DWORD usage; UINT textureName; UINT LOD; - D3DTEXTUREFILTERTYPE filterType; + WINED3DTEXTUREFILTERTYPE filterType; DWORD states[MAX_WINETEXTURESTATES]; } IWineD3DBaseTextureClass; @@ -1131,8 +1131,8 @@ int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, i extern DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew); extern DWORD WINAPI IWineD3DBaseTextureImpl_GetLOD(IWineD3DBaseTexture *iface); extern DWORD WINAPI IWineD3DBaseTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface); - extern HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface, D3DTEXTUREFILTERTYPE FilterType); - extern D3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface); + extern HRESULT WINAPI IWineD3DBaseTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE FilterType); + extern WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DBaseTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface); extern void WINAPI IWineD3DBaseTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface); extern BOOL WINAPI IWineD3DBaseTextureImpl_SetDirty(IWineD3DBaseTexture *iface, BOOL); extern BOOL WINAPI IWineD3DBaseTextureImpl_GetDirty(IWineD3DBaseTexture *iface); diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index c9318ff64fb..cecfcf3bb24 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -434,7 +434,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD3DBase) STDMETHOD(UpdateTexture)(THIS_ struct IWineD3DBaseTexture *pSourceTexture, struct IWineD3DBaseTexture *pDestinationTexture) PURE; STDMETHOD(UpdateSurface)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST POINT* pDestPoint) PURE; STDMETHOD(CopyRects)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, struct IWineD3DSurface* pDestinationSurface, CONST POINT* pDestPointsArray); - STDMETHOD(StretchRect)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) PURE; + STDMETHOD(StretchRect)(THIS_ struct IWineD3DSurface* pSourceSurface, CONST RECT* pSourceRect, struct IWineD3DSurface* pDestinationSurface, CONST RECT* pDestRect, WINED3DTEXTUREFILTERTYPE Filter) PURE; STDMETHOD(GetRenderTargetData)(THIS_ struct IWineD3DSurface* pRenderTarget, struct IWineD3DSurface* pSurface) PURE; STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,struct IWineD3DSurface* pSurface) PURE; /*** Internal use IWineD3Device methods ***/ @@ -749,8 +749,8 @@ DECLARE_INTERFACE_(IWineD3DBaseTexture,IWineD3DResource) STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; STDMETHOD_(DWORD, GetLOD)(THIS) PURE; STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; - STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ WINED3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(WINED3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; STDMETHOD_(BOOL, SetDirty)(THIS_ BOOL) PURE; STDMETHOD_(BOOL, GetDirty)(THIS) PURE; @@ -819,8 +819,8 @@ DECLARE_INTERFACE_(IWineD3DTexture,IWineD3DBaseTexture) STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; STDMETHOD_(DWORD, GetLOD)(THIS) PURE; STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; - STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ WINED3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(WINED3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; STDMETHOD_(BOOL, SetDirty)(THIS_ BOOL) PURE; STDMETHOD_(BOOL, GetDirty)(THIS) PURE; @@ -899,8 +899,8 @@ DECLARE_INTERFACE_(IWineD3DCubeTexture,IWineD3DBaseTexture) STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; STDMETHOD_(DWORD, GetLOD)(THIS) PURE; STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; - STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ WINED3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(WINED3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; STDMETHOD_(BOOL, SetDirty)(THIS_ BOOL) PURE; STDMETHOD_(BOOL, GetDirty)(THIS) PURE; @@ -980,8 +980,8 @@ DECLARE_INTERFACE_(IWineD3DVolumeTexture,IWineD3DBaseTexture) STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE; STDMETHOD_(DWORD, GetLOD)(THIS) PURE; STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE; - STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE; - STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; + STDMETHOD(SetAutoGenFilterType)(THIS_ WINED3DTEXTUREFILTERTYPE FilterType) PURE; + STDMETHOD_(WINED3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE; STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE; STDMETHOD_(BOOL, SetDirty)(THIS_ BOOL) PURE; STDMETHOD_(BOOL, GetDirty)(THIS) PURE; diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index 9658ebbd278..b31d9f412c1 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -473,6 +473,18 @@ typedef enum _WINED3DCUBEMAP_FACES { WINED3DCUBEMAP_FACE_FORCE_DWORD = 0xffffffff } WINED3DCUBEMAP_FACES; +typedef enum _WINED3DTEXTUREFILTERTYPE { + WINED3DTEXF_NONE = 0, + WINED3DTEXF_POINT = 1, + WINED3DTEXF_LINEAR = 2, + WINED3DTEXF_ANISOTROPIC = 3, + WINED3DTEXF_FLATCUBIC = 4, + WINED3DTEXF_GAUSSIANCUBIC = 5, + WINED3DTEXF_PYRAMIDALQUAD = 6, + WINED3DTEXF_GAUSSIANQUAD = 7, + WINED3DTEXF_FORCE_DWORD = 0x7fffffff +} WINED3DTEXTUREFILTERTYPE; + typedef struct _WINEDD3DRECTPATCH_INFO { UINT StartVertexOffsetWidth; UINT StartVertexOffsetHeight;