Merge branch 'fix-nearest-gui-options' into 'master'

Fix incorrect texture filtering GUI for nearest, allow to disable nearest from GUI

See merge request OpenMW/openmw!4114
esm4-texture
psi29a 7 months ago
commit d15be7a685

@ -43,16 +43,22 @@
namespace
{
std::string textureMipmappingToStr(const std::string& val)
std::string textureFilteringToStr(const std::string& mipFilter, const std::string& magFilter)
{
if (val == "linear")
return "#{OMWEngine:TextureFilteringTrilinear}";
if (val == "nearest")
return "#{OMWEngine:TextureFilteringBilinear}";
if (val == "none")
if (mipFilter == "none")
return "#{OMWEngine:TextureFilteringDisabled}";
Log(Debug::Warning) << "Warning: Invalid texture mipmap option: " << val;
if (magFilter == "linear")
{
if (mipFilter == "linear")
return "#{OMWEngine:TextureFilteringTrilinear}";
if (mipFilter == "nearest")
return "#{OMWEngine:TextureFilteringBilinear}";
}
else if (magFilter == "nearest")
return "#{OMWEngine:TextureFilteringNearest}";
Log(Debug::Warning) << "Warning: Invalid texture filtering options: " << mipFilter << ", " << magFilter;
return "#{OMWEngine:TextureFilteringOther}";
}
@ -365,8 +371,8 @@ namespace MWGui
}
highlightCurrentResolution();
const std::string& tmip = Settings::general().mTextureMipmap;
mTextureFilteringButton->setCaptionWithReplacing(textureMipmappingToStr(tmip));
mTextureFilteringButton->setCaptionWithReplacing(
textureFilteringToStr(Settings::general().mTextureMipmap, Settings::general().mTextureMinFilter));
int waterTextureSize = Settings::water().mRttSize;
if (waterTextureSize >= 512)
@ -684,12 +690,24 @@ namespace MWGui
void SettingsWindow::onTextureFilteringChanged(MyGUI::ComboBox* _sender, size_t pos)
{
if (pos == 0)
Settings::general().mTextureMipmap.set("nearest");
else if (pos == 1)
Settings::general().mTextureMipmap.set("linear");
else
Log(Debug::Warning) << "Unexpected option pos " << pos;
auto& generalSettings = Settings::general();
switch (pos)
{
case 0: // Bilinear with mips
generalSettings.mTextureMipmap.set("nearest");
generalSettings.mTextureMagFilter.set("linear");
generalSettings.mTextureMinFilter.set("linear");
break;
case 1: // Trilinear with mips
generalSettings.mTextureMipmap.set("linear");
generalSettings.mTextureMagFilter.set("linear");
generalSettings.mTextureMinFilter.set("linear");
break;
default:
Log(Debug::Warning) << "Unexpected texture filtering option pos " << pos;
break;
}
apply();
}

@ -159,6 +159,7 @@ TestingExteriorCells: "Außenzellen testen"
TestingInteriorCells: "Innenzellen testen"
TextureFiltering: "Texturfilter"
TextureFilteringBilinear: "Bilinear"
TextureFilteringNearest: "Nächstgelegen"
TextureFilteringDisabled: "Keiner"
TextureFilteringOther: "Sonstiges"
TextureFilteringTrilinear: "Trilinear"

@ -159,6 +159,7 @@ TestingExteriorCells: "Testing Exterior Cells"
TestingInteriorCells: "Testing Interior Cells"
TextureFiltering: "Texture Filtering"
TextureFilteringBilinear: "Bilinear"
TextureFilteringNearest: "Nearest"
TextureFilteringDisabled: "None"
TextureFilteringOther: "Other"
TextureFilteringTrilinear: "Trilinear"

@ -159,6 +159,7 @@ TestingExteriorCells: "Vérification des espaces (cells) extérieurs"
TestingInteriorCells: "Vérification des espaces (cells) intérieurs"
TextureFiltering: "Filtre appliqué aux textures"
TextureFilteringBilinear: "Bilinéaire"
TextureFilteringNearest: "Plus proche voisin"
TextureFilteringDisabled: "Aucun"
TextureFilteringOther: "Autre"
TextureFilteringTrilinear: "Trilinéaire"

@ -159,6 +159,7 @@ TestingExteriorCells: "Проверка наружных ячеек"
TestingInteriorCells: "Проверка ячеек-помещений"
TextureFiltering: "Фильтрация текстур"
TextureFilteringBilinear: "Билинейная"
TextureFilteringNearest: "Ступенчатая"
TextureFilteringDisabled: "Отключена"
TextureFilteringOther: "Другая"
TextureFilteringTrilinear: "Трилинейная"

@ -159,6 +159,7 @@ TestingExteriorCells: "Testar exteriöra celler"
TestingInteriorCells: "Testar interiöra celler"
TextureFiltering: "Texturfiltrering"
TextureFilteringBilinear: "Bilinjär"
TextureFilteringNearest: "Närmaste"
TextureFilteringDisabled: "Ingen"
TextureFilteringOther: "Annan"
TextureFilteringTrilinear: "Trilinjär"

Loading…
Cancel
Save