From dd760cc6f2323c2e18cca405401f808696afeddc Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Thu, 21 Nov 2024 03:29:37 -0500 Subject: [PATCH] Disable Obsolete ImGui Functions --- dependencies/imgui/CMakeLists.txt | 1 + launcher/src/ui/color.cpp | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dependencies/imgui/CMakeLists.txt b/dependencies/imgui/CMakeLists.txt index 56fad54bbc..4f077e22c1 100644 --- a/dependencies/imgui/CMakeLists.txt +++ b/dependencies/imgui/CMakeLists.txt @@ -32,6 +32,7 @@ target_compile_definitions(imgui PUBLIC IMGUI_DISABLE_DEMO_WINDOWS IMGUI_DISABLE_DEBUG_TOOLS IMGUI_DISABLE_DEFAULT_FONT + IMGUI_DISABLE_OBSOLETE_FUNCTIONS ) # Patch diff --git a/launcher/src/ui/color.cpp b/launcher/src/ui/color.cpp index f277afd9ed..5c04d87f2e 100644 --- a/launcher/src/ui/color.cpp +++ b/launcher/src/ui/color.cpp @@ -1,10 +1,5 @@ #include "frame.h" -// Clamp Function -static float clamp(const float value, const float min = 0.0f, const float max = 1.0f) { - return std::max(min, std::min(value, max)); -} - // Calculate Perceived Brightness Of Color // See: https://en.wikipedia.org/w/index.php?title=Relative_luminance&useskin=vector static float compute_luma(const ImVec4 &color) { @@ -12,6 +7,9 @@ static float compute_luma(const ImVec4 &color) { } // Apply Luma To RGB +static float clamp(const float value) { + return std::max(0.0f, std::min(value, 1.0f)); +} static ImVec4 apply_luma_to_color(const float target_luma, const ImVec4 &color) { const float current_luma = compute_luma(color); const float luma_ratio = (current_luma != 0) ? target_luma / current_luma : 0;