From f1faeeae3a765c3967270c36239fd84f5d798205 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 13 Dec 2015 17:05:19 -0800 Subject: [PATCH] Use separate config options for min and mag texture filters --- apps/openmw/engine.cpp | 3 ++- apps/openmw/mwrender/renderingmanager.cpp | 3 ++- components/resource/texturemanager.cpp | 18 +++++++++++------- components/resource/texturemanager.hpp | 3 ++- files/settings-default.cfg | 7 +++++-- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 50f097ce7..b43fd2f53 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -452,7 +452,8 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings) mResourceSystem.reset(new Resource::ResourceSystem(mVFS.get())); mResourceSystem->getTextureManager()->setUnRefImageDataAfterApply(true); mResourceSystem->getTextureManager()->setFilterSettings( - Settings::Manager::getString("texture filter", "General"), + Settings::Manager::getString("texture mag filter", "General"), + Settings::Manager::getString("texture min filter", "General"), Settings::Manager::getString("texture mipmap", "General"), Settings::Manager::getInt("anisotropy", "General"), NULL diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index ceea7ce97..b44d77722 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -782,7 +782,8 @@ namespace MWRender void RenderingManager::updateTextureFiltering() { mResourceSystem->getTextureManager()->setFilterSettings( - Settings::Manager::getString("texture filter", "General"), + Settings::Manager::getString("texture mag filter", "General"), + Settings::Manager::getString("texture min filter", "General"), Settings::Manager::getString("texture mipmap", "General"), Settings::Manager::getInt("anisotropy", "General"), mViewer diff --git a/components/resource/texturemanager.cpp b/components/resource/texturemanager.cpp index ea9e7ae5d..d7f3fc61a 100644 --- a/components/resource/texturemanager.cpp +++ b/components/resource/texturemanager.cpp @@ -66,18 +66,22 @@ namespace Resource mUnRefImageDataAfterApply = unref; } - void TextureManager::setFilterSettings(const std::string &filter, const std::string &mipmap, int maxAnisotropy, osgViewer::Viewer *viewer) + void TextureManager::setFilterSettings(const std::string &magfilter, const std::string &minfilter, + const std::string &mipmap, int maxAnisotropy, + osgViewer::Viewer *viewer) { osg::Texture::FilterMode min = osg::Texture::LINEAR; osg::Texture::FilterMode mag = osg::Texture::LINEAR; - if(filter == "nearest") - { - min = osg::Texture::NEAREST; + if(magfilter == "nearest") mag = osg::Texture::NEAREST; - } - else if(filter != "linear") - std::cerr<< "Invalid texture filter: "<