Use separate config options for min and mag texture filters

openmw-38
Chris Robinson 9 years ago
parent 5c0a847eaf
commit f1faeeae3a

@ -452,7 +452,8 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
mResourceSystem.reset(new Resource::ResourceSystem(mVFS.get())); mResourceSystem.reset(new Resource::ResourceSystem(mVFS.get()));
mResourceSystem->getTextureManager()->setUnRefImageDataAfterApply(true); mResourceSystem->getTextureManager()->setUnRefImageDataAfterApply(true);
mResourceSystem->getTextureManager()->setFilterSettings( 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::getString("texture mipmap", "General"),
Settings::Manager::getInt("anisotropy", "General"), Settings::Manager::getInt("anisotropy", "General"),
NULL NULL

@ -782,7 +782,8 @@ namespace MWRender
void RenderingManager::updateTextureFiltering() void RenderingManager::updateTextureFiltering()
{ {
mResourceSystem->getTextureManager()->setFilterSettings( 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::getString("texture mipmap", "General"),
Settings::Manager::getInt("anisotropy", "General"), Settings::Manager::getInt("anisotropy", "General"),
mViewer mViewer

@ -66,18 +66,22 @@ namespace Resource
mUnRefImageDataAfterApply = unref; 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 min = osg::Texture::LINEAR;
osg::Texture::FilterMode mag = osg::Texture::LINEAR; osg::Texture::FilterMode mag = osg::Texture::LINEAR;
if(filter == "nearest") if(magfilter == "nearest")
{
min = osg::Texture::NEAREST;
mag = osg::Texture::NEAREST; mag = osg::Texture::NEAREST;
} else if(magfilter != "linear")
else if(filter != "linear") std::cerr<< "Invalid texture mag filter: "<<magfilter <<std::endl;
std::cerr<< "Invalid texture filter: "<<filter <<std::endl;
if(minfilter == "nearest")
min = osg::Texture::NEAREST;
else if(minfilter != "linear")
std::cerr<< "Invalid texture min filter: "<<minfilter <<std::endl;
if(mipmap == "nearest") if(mipmap == "nearest")
{ {

@ -28,7 +28,8 @@ namespace Resource
TextureManager(const VFS::Manager* vfs); TextureManager(const VFS::Manager* vfs);
~TextureManager(); ~TextureManager();
void setFilterSettings(const std::string &filter, const std::string &mipmap, int maxAnisotropy, void setFilterSettings(const std::string &magfilter, const std::string &minfilter,
const std::string &mipmap, int maxAnisotropy,
osgViewer::Viewer *view); osgViewer::Viewer *view);
/// Keep a copy of the texture data around in system memory? This is needed when using multiple graphics contexts, /// Keep a copy of the texture data around in system memory? This is needed when using multiple graphics contexts,

@ -110,8 +110,11 @@ anisotropy = 4
# File format for screenshots. (jpg, png, tga, and possibly more). # File format for screenshots. (jpg, png, tga, and possibly more).
screenshot format = png screenshot format = png
# Texture filter type. (nearest or linear). # Texture magnification filter type. (nearest or linear).
texture filter = linear texture mag filter = linear
# Texture minification filter type. (nearest or linear).
texture min filter = linear
# Texture mipmap type. (none, nearest, or linear). # Texture mipmap type. (none, nearest, or linear).
texture mipmap = nearest texture mipmap = nearest

Loading…
Cancel
Save