mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Use separate config options for min and mag texture filters
This commit is contained in:
parent
5c0a847eaf
commit
f1faeeae3a
5 changed files with 22 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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: "<<filter <<std::endl;
|
||||
else if(magfilter != "linear")
|
||||
std::cerr<< "Invalid texture mag filter: "<<magfilter <<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")
|
||||
{
|
||||
|
|
|
@ -28,7 +28,8 @@ namespace Resource
|
|||
TextureManager(const VFS::Manager* vfs);
|
||||
~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);
|
||||
|
||||
/// 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).
|
||||
screenshot format = png
|
||||
|
||||
# Texture filter type. (nearest or linear).
|
||||
texture filter = linear
|
||||
# Texture magnification filter type. (nearest or 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 = nearest
|
||||
|
|
Loading…
Reference in a new issue