forked from eden-emu/eden
math_util: Remove the Clamp() function
C++17 adds clamp() to the standard library, so we can remove ours in favor of it.
This commit is contained in:
parent
17ad56c1dc
commit
fae2dd0344
5 changed files with 22 additions and 24 deletions
|
@ -2,6 +2,7 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
@ -87,7 +88,7 @@ void FrameLimiter::DoFrameLimiting(u64 current_system_time_us) {
|
|||
frame_limiting_delta_err += microseconds(current_system_time_us - previous_system_time_us);
|
||||
frame_limiting_delta_err -= duration_cast<microseconds>(now - previous_walltime);
|
||||
frame_limiting_delta_err =
|
||||
MathUtil::Clamp(frame_limiting_delta_err, -MAX_LAG_TIME_US, MAX_LAG_TIME_US);
|
||||
std::clamp(frame_limiting_delta_err, -MAX_LAG_TIME_US, MAX_LAG_TIME_US);
|
||||
|
||||
if (frame_limiting_delta_err > microseconds::zero()) {
|
||||
std::this_thread::sleep_for(frame_limiting_delta_err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue