From 575b88ac04aae1e3027f830a51d0b9160111a103 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Sat, 9 Oct 2021 02:40:30 +0200 Subject: [PATCH] gs: Fix recent clamp range changes. Arguments were in wrong order by mistake. Let's pretend that didn't happen. --- pcsx2/GS/Renderers/Common/GSOsdManager.cpp | 14 +++++++------- pcsx2/GS/Renderers/DX11/GSDevice11.cpp | 6 +++--- pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pcsx2/GS/Renderers/Common/GSOsdManager.cpp b/pcsx2/GS/Renderers/Common/GSOsdManager.cpp index 13fb45343c..4a8d7cbee7 100644 --- a/pcsx2/GS/Renderers/Common/GSOsdManager.cpp +++ b/pcsx2/GS/Renderers/Common/GSOsdManager.cpp @@ -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); diff --git a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp index 8e97c89a26..a74c802d88 100644 --- a/pcsx2/GS/Renderers/DX11/GSDevice11.cpp +++ b/pcsx2/GS/Renderers/DX11/GSDevice11.cpp @@ -306,9 +306,9 @@ bool GSDevice11::Create(const std::shared_ptr& 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)); diff --git a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp index 229326a5e9..40b35cf8ef 100644 --- a/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp +++ b/pcsx2/GS/Renderers/OpenGL/GSDeviceOGL.cpp @@ -471,9 +471,9 @@ bool GSDeviceOGL::Create(const std::shared_ptr& 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);