gs: Fix recent clamp range changes.

Arguments were in wrong order by mistake.
Let's pretend that didn't happen.
This commit is contained in:
lightningterror 2021-10-09 02:40:30 +02:00
parent 2e0b8302dd
commit 575b88ac04
3 changed files with 13 additions and 13 deletions

View File

@ -69,14 +69,14 @@ GSOsdManager::GSOsdManager()
{
m_monitor_enabled = theApp.GetConfigB("osd_monitor_enabled");
m_log_enabled = theApp.GetConfigB("osd_log_enabled");
m_size = std::clamp(1, theApp.GetConfigI("osd_fontsize"), 100);
m_opacity = std::clamp(0, theApp.GetConfigI("osd_color_opacity"), 100);
m_log_timeout = std::clamp(2, theApp.GetConfigI("osd_log_timeout"), 10);
m_max_onscreen_messages = std::clamp(1, theApp.GetConfigI("osd_max_log_messages"), 20);
m_size = std::clamp(theApp.GetConfigI("osd_fontsize"), 1, 100);
m_opacity = std::clamp(theApp.GetConfigI("osd_color_opacity"), 0, 100);
m_log_timeout = std::clamp(theApp.GetConfigI("osd_log_timeout"), 2, 10);
m_max_onscreen_messages = std::clamp(theApp.GetConfigI("osd_max_log_messages"), 1, 20);
int r = std::clamp(0, theApp.GetConfigI("osd_color_r"), 255);
int g = std::clamp(0, theApp.GetConfigI("osd_color_g"), 255);
int b = std::clamp(0, theApp.GetConfigI("osd_color_b"), 255);
const int r = std::clamp(theApp.GetConfigI("osd_color_r"), 0, 255);
const int g = std::clamp(theApp.GetConfigI("osd_color_g"), 0, 255);
const int b = std::clamp(theApp.GetConfigI("osd_color_b"), 0, 255);
m_color = r | (g << 8) | (b << 16) | (255 << 24);

View File

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

View File

@ -471,9 +471,9 @@ bool GSDeviceOGL::Create(const std::shared_ptr<GSWnd>& wnd)
{
GL_PUSH("GSDeviceOGL::Shadeboost");
const int ShadeBoost_Contrast = std::clamp(0, theApp.GetConfigI("ShadeBoost_Contrast"), 100);
const int ShadeBoost_Brightness = std::clamp(0, theApp.GetConfigI("ShadeBoost_Brightness"), 100);
const int ShadeBoost_Saturation = std::clamp(0, theApp.GetConfigI("ShadeBoost_Saturation"), 100);
const int ShadeBoost_Contrast = std::clamp(theApp.GetConfigI("ShadeBoost_Contrast"), 0, 100);
const int ShadeBoost_Brightness = std::clamp(theApp.GetConfigI("ShadeBoost_Brightness"), 0, 100);
const int ShadeBoost_Saturation = std::clamp(theApp.GetConfigI("ShadeBoost_Saturation"), 0, 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);