From 5e4eac8db3036963da256c7cdced90462012ca0b Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:52:03 +0300 Subject: [PATCH] Fix compilation error. --- UnleashedRecomp/ui/imgui_utils.cpp | 7 ++++++- UnleashedRecomp/ui/imgui_utils.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UnleashedRecomp/ui/imgui_utils.cpp b/UnleashedRecomp/ui/imgui_utils.cpp index 2b30b073..be38d093 100644 --- a/UnleashedRecomp/ui/imgui_utils.cpp +++ b/UnleashedRecomp/ui/imgui_utils.cpp @@ -131,9 +131,14 @@ float Scale(float size) return size * g_aspectRatioScale; } +double ComputeLinearMotion(double duration, double offset, double total) +{ + return std::clamp((ImGui::GetTime() - duration - offset / 60.0) / total * 60.0, 0.0, 1.0); +} + double ComputeMotion(double duration, double offset, double total) { - return sqrt(std::clamp((ImGui::GetTime() - duration - offset / 60.0) / total * 60.0, 0.0, 1.0)); + return sqrt(ComputeLinearMotion(duration, offset, total)); } void DrawPauseContainer(ImVec2 min, ImVec2 max, float alpha) diff --git a/UnleashedRecomp/ui/imgui_utils.h b/UnleashedRecomp/ui/imgui_utils.h index 61a88eca..cb84497e 100644 --- a/UnleashedRecomp/ui/imgui_utils.h +++ b/UnleashedRecomp/ui/imgui_utils.h @@ -37,6 +37,7 @@ void ResetProceduralOrigin(); void SetAdditive(bool enabled); void ResetAdditive(); float Scale(float size); +double ComputeLinearMotion(double duration, double offset, double total); double ComputeMotion(double duration, double offset, double total); void DrawPauseContainer(ImVec2 min, ImVec2 max, float alpha = 1); void DrawPauseHeaderContainer(ImVec2 min, ImVec2 max, float alpha = 1);