diff --git a/plugins/GSdx/GSdx.rc b/plugins/GSdx/GSdx.rc index e5833f2e35..77b9d9e801 100644 --- a/plugins/GSdx/GSdx.rc +++ b/plugins/GSdx/GSdx.rc @@ -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 diff --git a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp index a49988cca9..694bd48c2e 100644 --- a/plugins/GSdx/Renderers/DX11/GSDevice11.cpp +++ b/plugins/GSdx/Renderers/DX11/GSDevice11.cpp @@ -344,9 +344,9 @@ bool GSDevice11::Create(const std::shared_ptr &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)); diff --git a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp index 1f8daaf590..ba20e646d3 100644 --- a/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/plugins/GSdx/Renderers/OpenGL/GSDeviceOGL.cpp @@ -455,9 +455,9 @@ bool GSDeviceOGL::Create(const std::shared_ptr &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);