From 8861b845d7e42ba570912bb8423de0ffcd491e17 Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Thu, 20 Aug 2020 15:51:12 -0500 Subject: [PATCH] chrono: replace duration_cast to duration --- src/core/hle/D3D8/Direct3D9/Direct3D9.cpp | 2 +- src/devices/video/EmuNV2A_PTIMER.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp index 52307f3b7..867b0eadf 100644 --- a/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp +++ b/src/core/hle/D3D8/Direct3D9/Direct3D9.cpp @@ -5217,7 +5217,7 @@ DWORD WINAPI XTL::EMUPATCH(D3DDevice_Swap) // Only enter the wait loop if the frame took too long if (actualDuration < targetDuration) { // If we need to wait for a larger amount of time (>= 1 frame at 60FPS), we can just sleep - if (std::chrono::duration_cast(targetTimestamp - std::chrono::steady_clock::now()).count() > 16) { + if ((targetTimestamp - std::chrono::steady_clock::now()) > std::chrono::duration(16.0)) { std::this_thread::sleep_until(targetTimestamp); } else { // Otherwise, we fall-through and just keep polling diff --git a/src/devices/video/EmuNV2A_PTIMER.cpp b/src/devices/video/EmuNV2A_PTIMER.cpp index 33e1a4b48..d6f6f42f5 100644 --- a/src/devices/video/EmuNV2A_PTIMER.cpp +++ b/src/devices/video/EmuNV2A_PTIMER.cpp @@ -41,7 +41,7 @@ static uint64_t ptimer_get_clock(NV2AState * d) { // Get time in nanoseconds - uint64_t time = std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count(); + uint64_t time = std::chrono::duration(std::chrono::steady_clock::now().time_since_epoch()).count(); return Muldiv64(Muldiv64(time, (uint32_t)d->pramdac.core_clock_freq, // TODO : Research how this can be updated to accept uint64_t