diff --git a/Core/Config.cpp b/Core/Config.cpp index 75ff92f6c..146f20e29 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -96,6 +96,7 @@ void Config::Load(const char *iniFileName) #endif graphics->Get("BufferedRendering", &bBufferedRendering, true); graphics->Get("HardwareTransform", &bHardwareTransform, true); + graphics->Get("NearestFiltering", &bNearestFiltering, false); graphics->Get("LinearFiltering", &bLinearFiltering, false); graphics->Get("SSAA", &SSAntiAliasing, 0); graphics->Get("VBO", &bUseVBO, false); @@ -201,6 +202,7 @@ void Config::Save() graphics->Set("ResolutionScale", iWindowZoom); graphics->Set("BufferedRendering", bBufferedRendering); graphics->Set("HardwareTransform", bHardwareTransform); + graphics->Set("NearestFiltering", bNearestFiltering); graphics->Set("LinearFiltering", bLinearFiltering); graphics->Set("SSAA", SSAntiAliasing); graphics->Set("VBO", bUseVBO); diff --git a/Core/Config.h b/Core/Config.h index 06f1df64b..9881c582b 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -61,6 +61,7 @@ public: bool bDisplayFramebuffer; bool bHardwareTransform; bool bBufferedRendering; + bool bNearestFiltering; bool bLinearFiltering; bool bUseVBO; #ifdef BLACKBERRY diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index c613c6f26..d2a3b83ac 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -514,6 +514,11 @@ void TextureCache::UpdateSamplingParams(TexCacheEntry &entry, bool force) { minFilt |= 1; } + if (g_Config.bNearestFiltering) { + magFilt &= ~1; + minFilt &= ~1; + } + if (!g_Config.bMipMap) { magFilt &= 1; minFilt &= 1; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index af739fb77..5ae7b4b89 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -56,7 +56,8 @@ void GameSettingsScreen::CreateViews() { ViewGroup *graphicsSettings = new LinearLayout(ORIENT_VERTICAL); graphicsSettingsScroll->Add(graphicsSettings); tabHolder->AddTab("Graphics", graphicsSettingsScroll); - graphicsSettings->Add(new CheckBox(&g_Config.bLinearFiltering, gs->T("Linear Filtering"))); + graphicsSettings->Add(new CheckBox(&g_Config.bNearestFiltering, gs->T("Force Nearest Filtering"))); + graphicsSettings->Add(new CheckBox(&g_Config.bLinearFiltering, gs->T("Force Linear Filtering"))); graphicsSettings->Add(new CheckBox(&g_Config.bStretchToDisplay, gs->T("Stretch to Display"))); graphicsSettings->Add(new CheckBox(&g_Config.bBufferedRendering, gs->T("Buffered Rendering"))); graphicsSettings->Add(new CheckBox(&g_Config.bDisplayFramebuffer, gs->T("Display Raw Framebuffer"))); diff --git a/UI/MenuScreens.cpp b/UI/MenuScreens.cpp index d18b1b0e8..9fe31e893 100644 --- a/UI/MenuScreens.cpp +++ b/UI/MenuScreens.cpp @@ -833,7 +833,12 @@ void GraphicsScreenP2::render() { int stride = 40; int columnw = 400; - UICheckBox(GEN_ID, x, y += stride, gs->T("Linear Filtering"), ALIGN_TOPLEFT, &g_Config.bLinearFiltering); + if ( UICheckBox(GEN_ID, x, y += stride, gs->T("Force Nearest Filtering"), ALIGN_TOPLEFT, &g_Config.bNearestFiltering) ) { + g_Config.bLinearFiltering = false; // disable linear filtering if someone turns on nearest + } + if ( UICheckBox(GEN_ID, x, y += stride, gs->T("Force Linear Filtering"), ALIGN_TOPLEFT, &g_Config.bLinearFiltering) ) { + g_Config.bNearestFiltering = false; // and vice versa + } bool AnisotropicFiltering = g_Config.iAnisotropyLevel != 0; UICheckBox(GEN_ID, x, y += stride, gs->T("Anisotropic Filtering"), ALIGN_TOPLEFT, &AnisotropicFiltering); diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 90ff964f7..378c2911f 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -737,7 +737,12 @@ namespace MainWindow case ID_OPTIONS_USEVBO: g_Config.bUseVBO = !g_Config.bUseVBO; break; + case ID_OPTIONS_NEARESTFILTERING: + g_Config.bNearestFiltering = !g_Config.bNearestFiltering; + g_Config.bLinearFiltering = false; + break; case ID_OPTIONS_LINEARFILTERING: + g_Config.bNearestFiltering = false; g_Config.bLinearFiltering = !g_Config.bLinearFiltering; break; case ID_OPTIONS_TOPMOST: @@ -895,6 +900,7 @@ namespace MainWindow CHECKITEM(ID_OPTIONS_SHOWDEBUGSTATISTICS, g_Config.bShowDebugStats); CHECKITEM(ID_OPTIONS_HARDWARETRANSFORM, g_Config.bHardwareTransform); CHECKITEM(ID_OPTIONS_FASTMEMORY, g_Config.bFastMemory); + CHECKITEM(ID_OPTIONS_NEARESTFILTERING, g_Config.bNearestFiltering); CHECKITEM(ID_OPTIONS_LINEARFILTERING, g_Config.bLinearFiltering); CHECKITEM(ID_OPTIONS_SIMPLE2XSSAA, g_Config.SSAntiAliasing); CHECKITEM(ID_OPTIONS_STRETCHDISPLAY, g_Config.bStretchToDisplay); diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 6b5528c9d..943473b64 100644 Binary files a/Windows/ppsspp.rc and b/Windows/ppsspp.rc differ diff --git a/Windows/resource.h b/Windows/resource.h index ccf442fae..1613f9aa7 100644 Binary files a/Windows/resource.h and b/Windows/resource.h differ