mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-29 11:20:40 +00:00
User define linear filtering
This commit is contained in:
parent
3c8d52031e
commit
e407ec4314
@ -60,6 +60,7 @@ void CConfig::Load(const char *iniFileName)
|
||||
graphics->Get("WindowZoom", &iWindowZoom, 1);
|
||||
graphics->Get("BufferedRendering", &bBufferedRendering, true);
|
||||
graphics->Get("HardwareTransform", &bHardwareTransform, false);
|
||||
graphics->Get("LinearFiltering", &bLinearFiltering, false);
|
||||
|
||||
IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
|
||||
sound->Get("Enable", &bEnableSound, true);
|
||||
@ -98,6 +99,7 @@ void CConfig::Save()
|
||||
graphics->Set("WindowZoom", iWindowZoom);
|
||||
graphics->Set("BufferedRendering", bBufferedRendering);
|
||||
graphics->Set("HardwareTransform", bHardwareTransform);
|
||||
graphics->Set("LinearFiltering", bLinearFiltering);
|
||||
|
||||
IniFile::Section *sound = iniFile.GetOrCreateSection("Sound");
|
||||
sound->Set("Enable", bEnableSound);
|
||||
|
@ -52,6 +52,7 @@ public:
|
||||
bool bHardwareTransform;
|
||||
bool bBufferedRendering;
|
||||
bool bDrawWireframe;
|
||||
bool bLinearFiltering;
|
||||
int iWindowZoom; // for Windows
|
||||
|
||||
// Sound
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "../ge_constants.h"
|
||||
#include "../GPUState.h"
|
||||
#include "TextureCache.h"
|
||||
|
||||
#include "../Core/Config.h"
|
||||
|
||||
// If a texture hasn't been seen for 200 frames, get rid of it.
|
||||
#define TEXTURE_KILL_AGE 200
|
||||
@ -428,8 +428,17 @@ void UpdateSamplingParams()
|
||||
int tClamp = (gstate.texwrap>>8) & 1;
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, sClamp ? GL_CLAMP_TO_EDGE : GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, tClamp ? GL_CLAMP_TO_EDGE : GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magFilt ? GL_LINEAR : GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minFilt ? GL_LINEAR : GL_NEAREST);
|
||||
// Tested mag/minFilt only work in either one case that can allow GL_LINEAR to be enable
|
||||
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magFilt ? GL_LINEAR : GL_NEAREST);
|
||||
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minFilt ? GL_LINEAR : GL_NEAREST);
|
||||
// User define linear filtering
|
||||
if ( g_Config.bLinearFiltering ) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
} else {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user