Added support to pause emulator when running in the background

This commit is contained in:
pagefault
2006-02-10 01:49:04 +00:00
parent 0e01ed0f09
commit 75e06ff237

View File

@@ -188,7 +188,6 @@ BYTE IsActivated=1;
WORD PrevRes=0; WORD PrevRes=0;
RECT BlitArea; RECT BlitArea;
BYTE AltSurface=0; BYTE AltSurface=0;
extern "C" { extern "C" {
DWORD MouseButton; DWORD MouseButton;
DWORD SurfaceX=0; DWORD SurfaceX=0;
@@ -344,6 +343,8 @@ void DDrawError(){
extern "C" BYTE vsyncon; extern "C" BYTE vsyncon;
extern "C" BYTE KitchenSync; extern "C" BYTE KitchenSync;
extern "C" BYTE TripleBufferWin; extern "C" BYTE TripleBufferWin;
extern "C" BYTE EMUPaused;
extern "C" BYTE PauseFocusChange;
void DrawScreen() void DrawScreen()
{ {
@@ -663,6 +664,7 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
IsActivated = 1; IsActivated = 1;
if (FirstActivate == 0) initwinvideo(); if (FirstActivate == 0) initwinvideo();
if (PauseFocusChange) EMUPause = 0;
InputAcquire(); InputAcquire();
if (FirstActivate == 1) FirstActivate = 0; if (FirstActivate == 1) FirstActivate = 0;
if (FullScreen == 1) Clear2xSaIBuffer(); if (FullScreen == 1) Clear2xSaIBuffer();
@@ -671,6 +673,7 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (LOWORD(wParam) == WA_INACTIVE) if (LOWORD(wParam) == WA_INACTIVE)
{ {
IsActivated = 0; IsActivated = 0;
if (PauseFocusChange) EMUPause = 1;
InputDeAcquire(); InputDeAcquire();
if (GUIOn || GUIOn2 || EMUPause) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); if (GUIOn || GUIOn2 || EMUPause) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
} }