From a86f31658b88137ca8c64fcd1501627d60453e36 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 5 Aug 2009 09:01:00 +0200 Subject: [PATCH] wined3d: Move texture filter lookup table initialization to basetexture_init(). --- dlls/wined3d/basetexture.c | 11 +++++++++++ dlls/wined3d/cubetexture.c | 11 ----------- dlls/wined3d/texture.c | 11 ----------- dlls/wined3d/volumetexture.c | 11 ----------- 4 files changed, 11 insertions(+), 33 deletions(-) diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index c3063674929..086315e62bf 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -48,6 +48,17 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT levels, WINED3DR texture->baseTexture.is_srgb = FALSE; texture->baseTexture.pow2Matrix_identity = TRUE; + if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING) + { + texture->baseTexture.minMipLookup = minMipLookup; + texture->baseTexture.magLookup = magLookup; + } + else + { + texture->baseTexture.minMipLookup = minMipLookup_noFilter; + texture->baseTexture.magLookup = magLookup_noFilter; + } + return WINED3D_OK; } diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index afba1e84ea3..4b6900a87f8 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -192,17 +192,6 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN return hr; } - if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING) - { - texture->baseTexture.minMipLookup = minMipLookup; - texture->baseTexture.magLookup = magLookup; - } - else - { - texture->baseTexture.minMipLookup = minMipLookup_noFilter; - texture->baseTexture.magLookup = magLookup_noFilter; - } - /* Find the nearest pow2 match. */ pow2_edge_length = 1; while (pow2_edge_length < edge_length) pow2_edge_length <<= 1; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index ab0544948eb..d89b3b57f28 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -197,17 +197,6 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT return hr; } - if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING) - { - texture->baseTexture.minMipLookup = minMipLookup; - texture->baseTexture.magLookup = magLookup; - } - else - { - texture->baseTexture.minMipLookup = minMipLookup_noFilter; - texture->baseTexture.magLookup = magLookup_noFilter; - } - /* Precalculated scaling for 'faked' non power of two texture coords. * Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE * is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index a847f87623b..134ff74398c 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -150,17 +150,6 @@ HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT return hr; } - if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING) - { - texture->baseTexture.minMipLookup = minMipLookup; - texture->baseTexture.magLookup = magLookup; - } - else - { - texture->baseTexture.minMipLookup = minMipLookup_noFilter; - texture->baseTexture.magLookup = magLookup_noFilter; - } - /* Is NP2 support for volumes needed? */ texture->baseTexture.pow2Matrix[0] = 1.0f; texture->baseTexture.pow2Matrix[5] = 1.0f;