summaryrefslogtreecommitdiff
path: root/src/utils/process.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-18 21:47:43 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-18 22:27:06 +0300
commite73c5ecc896c14fa43b19e42e5b24c79766cdb44 (patch)
tree9ee72afa6d4b8e150534f64a6c15085d1ce168b9 /src/utils/process.cpp
parent25907c03212110f10c910b0ef90a416dff450ca7 (diff)
downloadmanaplus-e73c5ecc896c14fa43b19e42e5b24c79766cdb44.tar.gz
manaplus-e73c5ecc896c14fa43b19e42e5b24c79766cdb44.tar.bz2
manaplus-e73c5ecc896c14fa43b19e42e5b24c79766cdb44.tar.xz
manaplus-e73c5ecc896c14fa43b19e42e5b24c79766cdb44.zip
Change process priority depend on game state.
implimented only for windows version.
Diffstat (limited to 'src/utils/process.cpp')
-rw-r--r--src/utils/process.cpp15
1 files changed, 15 insertions, 0 deletions
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