From eaad87ab4fe49130b622dd593b44ffaa40913c65 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 15 Aug 2021 11:54:14 +1000 Subject: [PATCH] CommonHostInterface: Make timer resolution increased static --- src/frontend-common/common_host_interface.cpp | 7 ++++--- src/frontend-common/common_host_interface.h | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 27764d83c..c2ad1482e 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -3320,12 +3320,13 @@ std::vector CommonHostInterface::GetSettingStringList(const char* s void CommonHostInterface::SetTimerResolutionIncreased(bool enabled) { - if (m_timer_resolution_increased == enabled) +#if defined(_WIN32) && !defined(_UWP) + static bool current_state = false; + if (current_state == enabled) return; - m_timer_resolution_increased = enabled; + current_state = enabled; -#if defined(_WIN32) && !defined(_UWP) if (enabled) timeBeginPeriod(1); else diff --git a/src/frontend-common/common_host_interface.h b/src/frontend-common/common_host_interface.h index 31aa33e4d..d4d0444c6 100644 --- a/src/frontend-common/common_host_interface.h +++ b/src/frontend-common/common_host_interface.h @@ -487,7 +487,6 @@ protected: bool m_frame_step_request = false; bool m_fast_forward_enabled = false; bool m_turbo_enabled = false; - bool m_timer_resolution_increased = false; bool m_throttler_enabled = true; bool m_display_all_frames = true;