From f29c371b8bc8fe3de60aa780edd6af7e440873da Mon Sep 17 00:00:00 2001 From: narzoul Date: Sun, 22 May 2016 14:02:20 +0200 Subject: [PATCH] Disabled dynamic thread priority boosts Fixes performance issues in The Longest Journey. --- DDrawCompat/DllMain.cpp | 2 ++ DDrawCompat/RealPrimarySurface.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DDrawCompat/DllMain.cpp b/DDrawCompat/DllMain.cpp index 4c4d219..b22a592 100644 --- a/DDrawCompat/DllMain.cpp +++ b/DDrawCompat/DllMain.cpp @@ -179,6 +179,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID /*lpvReserved*/) VISIT_ALL_DDRAW_PROCS(LOAD_ORIGINAL_DDRAW_PROC); Compat::origProcs.DirectInputCreateA = GetProcAddress(g_origDInputModule, "DirectInputCreateA"); + const BOOL disablePriorityBoost = TRUE; + SetProcessPriorityBoost(GetCurrentProcess(), disablePriorityBoost); SetProcessAffinityMask(GetCurrentProcess(), 1); SetThemeAppProperties(0); Time::init(); diff --git a/DDrawCompat/RealPrimarySurface.cpp b/DDrawCompat/RealPrimarySurface.cpp index 7f123fa..74f3809 100644 --- a/DDrawCompat/RealPrimarySurface.cpp +++ b/DDrawCompat/RealPrimarySurface.cpp @@ -121,7 +121,7 @@ namespace if (!g_updateThread) { g_updateThread = CreateThread(nullptr, 0, &updateThreadProc, nullptr, 0, nullptr); - SetThreadPriority(g_updateThread, THREAD_PRIORITY_ABOVE_NORMAL); + SetThreadPriority(g_updateThread, THREAD_PRIORITY_TIME_CRITICAL); } surface->SetPrivateData(surface, IID_IReleaseNotifier,