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

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

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

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

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

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

Loading…
Cancel
Save