From f834caca9b3ba2333917fe593df589ed7ef32b19 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 25 Jun 2022 15:37:41 +0200 Subject: [PATCH] Temporarily reverted main thread delays to the old way to reduce CPU usage until we figure out a better way that gives more accuracy at comparably reduced CPU usage. --- src/qt/qt_main.cpp | 5 +---- src/win/Makefile.mingw | 4 ++++ src/win/win.c | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index d14b95ae0..30e3df2ee 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -120,10 +120,7 @@ main_thread_fn() } } else { /* Just so we dont overload the host OS. */ - if (drawits < -1 || dopause) - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - else - std::this_thread::yield(); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); } /* If needed, handle a screen resize. */ diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 9d657989a..278ef11f7 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -758,7 +758,11 @@ ifdef EXOBJ OBJ += $(EXOBJ) endif +ifeq ($(OPENAL), y) +LIBS := -mwindows -lopenal -lcomctl32 -lSDL2 -limagehlp -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid +else LIBS := -mwindows -lcomctl32 -lSDL2 -limagehlp -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid +endif ifeq ($(RTMIDI), y) SNDOBJ += midi_rtmidi.o diff --git a/src/win/win.c b/src/win/win.c index cd938217e..382c58b70 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -549,8 +549,7 @@ main_thread(void *param) frames = 0; } } else /* Just so we dont overload the host OS. */ - Sleep((drawits < -1) ? 1 : 0); - // Sleep(1); + Sleep(1); /* If needed, handle a screen resize. */ if (!atomic_flag_test_and_set(&doresize) && !video_fullscreen && !is_quit) {