diff options
| author | 2018-04-19 23:01:50 -0400 | |
|---|---|---|
| committer | 2018-04-20 10:14:13 -0400 | |
| commit | fae2dd034462c5a6b086e46b3437ea6e2456d5eb (patch) | |
| tree | 3a53e7b4786e4712874d63a2a1cecc6755475051 /src/core/perf_stats.cpp | |
| parent | Merge pull request #356 from lioncash/shader (diff) | |
| download | yuzu-fae2dd034462c5a6b086e46b3437ea6e2456d5eb.tar.gz yuzu-fae2dd034462c5a6b086e46b3437ea6e2456d5eb.tar.xz yuzu-fae2dd034462c5a6b086e46b3437ea6e2456d5eb.zip | |
math_util: Remove the Clamp() function
C++17 adds clamp() to the standard library, so we can remove ours in
favor of it.
Diffstat (limited to 'src/core/perf_stats.cpp')
| -rw-r--r-- | src/core/perf_stats.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index ad3b56fcc..5f53b16d3 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <chrono> | 6 | #include <chrono> |
| 6 | #include <mutex> | 7 | #include <mutex> |
| 7 | #include <thread> | 8 | #include <thread> |
| @@ -87,7 +88,7 @@ void FrameLimiter::DoFrameLimiting(u64 current_system_time_us) { | |||
| 87 | frame_limiting_delta_err += microseconds(current_system_time_us - previous_system_time_us); | 88 | frame_limiting_delta_err += microseconds(current_system_time_us - previous_system_time_us); |
| 88 | frame_limiting_delta_err -= duration_cast<microseconds>(now - previous_walltime); | 89 | frame_limiting_delta_err -= duration_cast<microseconds>(now - previous_walltime); |
| 89 | frame_limiting_delta_err = | 90 | frame_limiting_delta_err = |
| 90 | MathUtil::Clamp(frame_limiting_delta_err, -MAX_LAG_TIME_US, MAX_LAG_TIME_US); | 91 | std::clamp(frame_limiting_delta_err, -MAX_LAG_TIME_US, MAX_LAG_TIME_US); |
| 91 | 92 | ||
| 92 | if (frame_limiting_delta_err > microseconds::zero()) { | 93 | if (frame_limiting_delta_err > microseconds::zero()) { |
| 93 | std::this_thread::sleep_for(frame_limiting_delta_err); | 94 | std::this_thread::sleep_for(frame_limiting_delta_err); |