mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Fix incorrect texture filtering GUI for nearest, allow to disable nearest from GUI
This commit is contained in:
parent
2be6116ef6
commit
d3c1aa6653
@ -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ächster"
|
||||
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…
Reference in New Issue
Block a user