This commit is contained in:
Glenn Maynard
2005-02-07 09:23:20 +00:00
parent dc0582de4b
commit c622e6efd9
+10 -9
View File
@@ -291,12 +291,13 @@ static void GameLoop();
static bool ChangeAppPri() static bool ChangeAppPri()
{ {
if(PREFSMAN->m_iBoostAppPriority == 0) if( PREFSMAN->m_iBoostAppPriority == 0 )
return false; return false;
// if using NTPAD don't boost or else input is laggy // if using NTPAD don't boost or else input is laggy
if(PREFSMAN->m_iBoostAppPriority == -1) if( PREFSMAN->m_iBoostAppPriority == -1 )
{ vector<InputDevice> vDevices; {
vector<InputDevice> vDevices;
vector<CString> vDescriptions; vector<CString> vDescriptions;
INPUTMAN->GetDevicesAndDescriptions(vDevices,vDescriptions); INPUTMAN->GetDevicesAndDescriptions(vDevices,vDescriptions);
CString sInputDevices = join( ",", vDescriptions ); CString sInputDevices = join( ",", vDescriptions );
@@ -309,7 +310,7 @@ static bool ChangeAppPri()
/* If -1 and this is a debug build, don't. It makes the debugger sluggish. */ /* If -1 and this is a debug build, don't. It makes the debugger sluggish. */
#ifdef DEBUG #ifdef DEBUG
if(PREFSMAN->m_iBoostAppPriority == -1) if( PREFSMAN->m_iBoostAppPriority == -1 )
return false; return false;
#endif #endif
@@ -318,7 +319,7 @@ static bool ChangeAppPri()
static void BoostAppPri() static void BoostAppPri()
{ {
if(!ChangeAppPri()) if( !ChangeAppPri() )
return; return;
#ifdef _WINDOWS #ifdef _WINDOWS
@@ -328,9 +329,9 @@ static void BoostAppPri()
* and later. */ * and later. */
OSVERSIONINFO version; OSVERSIONINFO version;
version.dwOSVersionInfoSize=sizeof(version); version.dwOSVersionInfoSize=sizeof(version);
if(!GetVersionEx(&version)) if( !GetVersionEx(&version) )
{ {
LOG->Warn(werr_ssprintf(GetLastError(), "GetVersionEx failed")); LOG->Warn( werr_ssprintf(GetLastError(), "GetVersionEx failed") );
return; return;
} }
@@ -339,12 +340,12 @@ static void BoostAppPri()
#endif #endif
DWORD pri = HIGH_PRIORITY_CLASS; DWORD pri = HIGH_PRIORITY_CLASS;
if(version.dwMajorVersion >= 5) if( version.dwMajorVersion >= 5 )
pri = ABOVE_NORMAL_PRIORITY_CLASS; pri = ABOVE_NORMAL_PRIORITY_CLASS;
/* Be sure to boost the app, not the thread, to make sure the /* Be sure to boost the app, not the thread, to make sure the
* sound thread stays higher priority than the main thread. */ * sound thread stays higher priority than the main thread. */
SetPriorityClass(GetCurrentProcess(), pri); SetPriorityClass( GetCurrentProcess(), pri );
#endif #endif
} }