From e73c5ecc896c14fa43b19e42e5b24c79766cdb44 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 18 Feb 2013 21:47:43 +0300 Subject: Change process priority depend on game state. implimented only for windows version. --- src/utils/process.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/utils/process.cpp') diff --git a/src/utils/process.cpp b/src/utils/process.cpp index b424b42e3..1efd850cc 100644 --- a/src/utils/process.cpp +++ b/src/utils/process.cpp @@ -257,3 +257,18 @@ bool openBrowser(std::string url) } #endif + +#ifdef WIN32 +void setPriority(const bool big) +{ + HANDLE hCurrentProcess = GetCurrentProcess(); + if (big) + SetPriorityClass(hCurrentProcess, ABOVE_NORMAL_PRIORITY_CLASS); + else + SetPriorityClass(hCurrentProcess, BELOW_NORMAL_PRIORITY_CLASS); +} +#else +void setPriority(const bool big A_UNUSED) +{ +} +#endif -- cgit v1.2.3-70-g09d2