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.

This commit is contained in:
OBattler
2022-06-25 15:37:41 +02:00
parent a876d10df6
commit f834caca9b
3 changed files with 6 additions and 6 deletions

View File

@@ -120,10 +120,7 @@ main_thread_fn()
} }
} else { } else {
/* Just so we dont overload the host OS. */ /* Just so we dont overload the host OS. */
if (drawits < -1 || dopause) std::this_thread::sleep_for(std::chrono::milliseconds(1));
std::this_thread::sleep_for(std::chrono::milliseconds(1));
else
std::this_thread::yield();
} }
/* If needed, handle a screen resize. */ /* If needed, handle a screen resize. */

View File

@@ -758,7 +758,11 @@ ifdef EXOBJ
OBJ += $(EXOBJ) OBJ += $(EXOBJ)
endif 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 LIBS := -mwindows -lcomctl32 -lSDL2 -limagehlp -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid
endif
ifeq ($(RTMIDI), y) ifeq ($(RTMIDI), y)
SNDOBJ += midi_rtmidi.o SNDOBJ += midi_rtmidi.o

View File

@@ -549,8 +549,7 @@ main_thread(void *param)
frames = 0; frames = 0;
} }
} else /* Just so we dont overload the host OS. */ } 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 needed, handle a screen resize. */
if (!atomic_flag_test_and_set(&doresize) && !video_fullscreen && !is_quit) { if (!atomic_flag_test_and_set(&doresize) && !video_fullscreen && !is_quit) {