1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Add config option for texture coordinate bounds

This commit is contained in:
s2s 2021-02-12 22:52:19 +01:00 committed by Sergey Lipskiy
parent cdd1dcc438
commit 4e0a0186f5
4 changed files with 8 additions and 1 deletions

View File

@ -64,6 +64,7 @@ void Config::resetToDefaults()
graphics2D.correctTexrectCoords = tcDisable;
graphics2D.enableNativeResTexrects = NativeResTexrectsMode::ntDisable;
graphics2D.bgMode = BGMode::bgStripped;
graphics2D.enableTexCoordBounds = 0;
frameBufferEmulation.enable = 1;
frameBufferEmulation.copyDepthToRDRAM = cdSoftwareRender;

View File

@ -90,6 +90,7 @@ struct Config
u32 correctTexrectCoords;
u32 enableNativeResTexrects;
u32 bgMode;
u32 enableTexCoordBounds;
} graphics2D;
enum Aspect {

View File

@ -230,7 +230,7 @@ public:
void update(bool _force) override {
const bool isNativeRes = config.frameBufferEmulation.nativeResFactor == 1 && config.video.multisampling == 0;
const bool isTexRect = dwnd().getDrawer().getDrawingState() == DrawingState::TexRect;
const bool useTexCoordBounds = isTexRect && !isNativeRes;
const bool useTexCoordBounds = isTexRect && !isNativeRes && config.graphics2D.enableTexCoordBounds;
float scale[2] = { 0.0f, 0.0f };
if (config.frameBufferEmulation.nativeResFactor != 0) {
scale[0] = scale[1] = static_cast<float>(config.frameBufferEmulation.nativeResFactor);

View File

@ -178,6 +178,8 @@ bool Config_SetDefault()
assert(res == M64ERR_SUCCESS);
res = ConfigSetDefaultInt(g_configVideoGliden64, "BackgroundsMode", config.graphics2D.bgMode, "Render backgrounds mode (HLE only). (0=One piece (fast), 1=Stripped (precise))");
assert(res == M64ERR_SUCCESS);
res = ConfigSetDefaultInt(g_configVideoGliden64, "EnableTexCoordBounds", config.graphics2D.enableTexCoordBounds, "Bound texture rectangle texture coordinates to the values they take in native resolutions. It prevents garbage due to fetching out of texture bounds, but can result in hard edges. (0=Off, 1=On)");
assert(res == M64ERR_SUCCESS);
//#Frame Buffer Settings:"
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableFBEmulation", config.frameBufferEmulation.enable, "Enable frame and|or depth buffer emulation.");
@ -383,6 +385,8 @@ void Config_LoadCustomConfig()
if (result == M64ERR_SUCCESS) config.graphics2D.enableNativeResTexrects = atoi(value);
result = ConfigExternalGetParameter(fileHandle, sectionName, "graphics2D\\bgMode", value, sizeof(value));
if (result == M64ERR_SUCCESS) config.graphics2D.bgMode = atoi(value);
result = ConfigExternalGetParameter(fileHandle, sectionName, "graphics2D\\enableTexCoordBounds", value, sizeof(value));
if (result == M64ERR_SUCCESS) config.graphics2D.enableTexCoordBounds = atoi(value);
result = ConfigExternalGetParameter(fileHandle, sectionName, "frameBufferEmulation\\enable", value, sizeof(value));
if (result == M64ERR_SUCCESS) config.frameBufferEmulation.enable = atoi(value);
@ -509,6 +513,7 @@ void Config_LoadConfig()
config.graphics2D.correctTexrectCoords = ConfigGetParamInt(g_configVideoGliden64, "CorrectTexrectCoords");
config.graphics2D.enableNativeResTexrects = ConfigGetParamInt(g_configVideoGliden64, "EnableNativeResTexrects");
config.graphics2D.bgMode = ConfigGetParamInt(g_configVideoGliden64, "BackgroundsMode");
config.graphics2D.enableTexCoordBounds = ConfigGetParamInt(g_configVideoGliden64, "EnableTexCoordBounds");
//#Frame Buffer Settings:"
config.frameBufferEmulation.enable = ConfigGetParamBool(g_configVideoGliden64, "EnableFBEmulation");
config.frameBufferEmulation.copyAuxToRDRAM = ConfigGetParamBool(g_configVideoGliden64, "EnableCopyAuxiliaryToRDRAM");