Mirror F1/F3 menu CPU usage fix in Windows version and a type in the previous commit I just put in CVS a second ago

This commit is contained in:
pagefault
2005-02-03 23:31:40 +00:00
parent 39e9235cda
commit b6a35f7833
2 changed files with 5 additions and 4 deletions

View File

@@ -422,6 +422,7 @@ BOOL InputDeAcquire(void)
extern "C" {
void initwinvideo();
void DosExit(void);
extern BYTE GUIOn;
extern BYTE GUIOn2;
extern BYTE cfgsoundon;
extern BYTE StereoSound;
@@ -658,7 +659,7 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
IsActivated = 0;
InputDeAcquire();
if (GUIOn2 == 1) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
if (GUIOn || GUIOn2) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
}
break;
case WM_SETFOCUS:
@@ -669,7 +670,7 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_KILLFOCUS:
InputDeAcquire();
IsActivated = 0;
if (GUIOn2 == 1) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
if (GUIOn || GUIOn2) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
break;
case WM_DESTROY:
break;
@@ -2110,7 +2111,7 @@ void CheckTimers(void)
{
// Lame fix for GUI using 100% CPU
if (GUIOn2) Sleep(1);
if (GUIOn || GUIOn2) Sleep(1);
QueryPerformanceCounter((LARGE_INTEGER*)&end2);