gsdx-ogl/d3d11: Also ensure that we set proper ini values for Shade Boost sliders.

Should avoid any potential issues if ini values are wrong for shade
boost.

Bonus: Fix gui overlapping issues when sliders are on maximum (100).
This commit is contained in:
lightningterror 2019-07-17 01:16:46 +02:00
parent 888897ed48
commit 91570a9e0f
3 changed files with 9 additions and 9 deletions

View File

@ -173,13 +173,13 @@ BEGIN
CONTROL "FXAA Shader (PgUp)",IDC_FXAA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,19,80,10
CONTROL "Shade Boost",IDC_SHADEBOOST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,32,90,10
LTEXT "Shade Boost Brightness",IDC_BRIGHTNESS_TEXT,16,50,80,8
CONTROL "",IDC_BRIGHTNESS_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,95,48,135,15
CONTROL "",IDC_BRIGHTNESS_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,95,48,133,15
RTEXT "100",IDC_BRIGHTNESS_VALUE,225,50,15,8
LTEXT "Shade Boost Contrast",IDC_CONTRAST_TEXT,16,75,80,8
CONTROL "",IDC_CONTRAST_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,95,73,135,15
CONTROL "",IDC_CONTRAST_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,95,73,133,15
RTEXT "100",IDC_CONTRAST_VALUE,225,75,15,8
LTEXT "Shade Boost Saturation",IDC_SATURATION_TEXT,16,100,80,8
CONTROL "",IDC_SATURATION_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,95,98,135,15
CONTROL "",IDC_SATURATION_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,95,98,133,15
RTEXT "100",IDC_SATURATION_VALUE,225,100,15,8
CONTROL "External Shader (Home)",IDC_SHADER_FX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,116,90,10
LTEXT "External Shader",IDC_SHADER_FX_TEXT,16,131,75,8

View File

@ -344,9 +344,9 @@ bool GSDevice11::Create(const std::shared_ptr<GSWnd> &wnd)
ShaderMacro sm_sboost(m_shader.model);
sm_sboost.AddMacro("SB_SATURATION", theApp.GetConfigI("ShadeBoost_Saturation"));
sm_sboost.AddMacro("SB_BRIGHTNESS", theApp.GetConfigI("ShadeBoost_Brightness"));
sm_sboost.AddMacro("SB_CONTRAST", theApp.GetConfigI("ShadeBoost_Contrast"));
sm_sboost.AddMacro("SB_SATURATION", std::max(0, std::min(theApp.GetConfigI("ShadeBoost_Saturation"), 100)));
sm_sboost.AddMacro("SB_BRIGHTNESS", std::max(0, std::min(theApp.GetConfigI("ShadeBoost_Brightness"), 100)));
sm_sboost.AddMacro("SB_CONTRAST", std::max(0, std::min(theApp.GetConfigI("ShadeBoost_Contrast"), 100)));
memset(&bd, 0, sizeof(bd));

View File

@ -455,9 +455,9 @@ bool GSDeviceOGL::Create(const std::shared_ptr<GSWnd> &wnd)
{
GL_PUSH("GSDeviceOGL::Shadeboost");
int ShadeBoost_Contrast = theApp.GetConfigI("ShadeBoost_Contrast");
int ShadeBoost_Brightness = theApp.GetConfigI("ShadeBoost_Brightness");
int ShadeBoost_Saturation = theApp.GetConfigI("ShadeBoost_Saturation");
int ShadeBoost_Contrast = std::max(0, std::min(theApp.GetConfigI("ShadeBoost_Contrast"), 100));
int ShadeBoost_Brightness = std::max(0, std::min(theApp.GetConfigI("ShadeBoost_Brightness"), 100));
int ShadeBoost_Saturation = std::max(0, std::min(theApp.GetConfigI("ShadeBoost_Saturation"), 100));
std::string shade_macro = format("#define SB_SATURATION %d.0\n", ShadeBoost_Saturation)
+ format("#define SB_BRIGHTNESS %d.0\n", ShadeBoost_Brightness)
+ format("#define SB_CONTRAST %d.0\n", ShadeBoost_Contrast);