diff --git a/Standard Gaming Platform/sgp.cpp b/Standard Gaming Platform/sgp.cpp index 70aeca411..7a9488bee 100644 --- a/Standard Gaming Platform/sgp.cpp +++ b/Standard Gaming Platform/sgp.cpp @@ -386,25 +386,29 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP } break; case FALSE: // We are suspending direct draw -//#ifdef JA2 -// // pause the JA2 Global clock -// PauseTime( TRUE ); -// SuspendVideoManager(); -//#else -//#ifndef UTIL -// if(!VideoInspectorIsEnabled()) -// SuspendVideoManager(); -//#endif -//#endif -// // suspend movement timer, to prevent timer crash if delay becomes long -// // * it doesn't matter whether the 3-D engine is actually running or not, or if it's even been initialized -// // * restore is automatic, no need to do anything on reactivation -//#if !defined( JA2 ) && !defined( UTIL ) -// MoveTimer(TIMER_SUSPEND); -//#endif -// -// gfApplicationActive = FALSE; -// fRestore = TRUE; + + if (iScreenMode == 0) + { +#ifdef JA2 + // pause the JA2 Global clock + PauseTime( TRUE ); + SuspendVideoManager(); +#else +#ifndef UTIL + if(!VideoInspectorIsEnabled()) + SuspendVideoManager(); +#endif +#endif + // suspend movement timer, to prevent timer crash if delay becomes long + // * it doesn't matter whether the 3-D engine is actually running or not, or if it's even been initialized + // * restore is automatic, no need to do anything on reactivation +#if !defined( JA2 ) && !defined( UTIL ) + MoveTimer(TIMER_SUSPEND); +#endif + + gfApplicationActive = FALSE; + fRestore = TRUE; + } break; } break; @@ -419,27 +423,32 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP break; case WM_SETFOCUS: -//#if !defined( JA2 ) && !defined( UTIL ) -// if(!VideoInspectorIsEnabled()) -// RestoreVideoManager(); -// gfApplicationActive=TRUE; -//// RestrictMouseToXYXY(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); -//#else -// RestoreCursorClipRect( ); -//#endif - + if (iScreenMode == 0) + { +#if !defined( JA2 ) && !defined( UTIL ) + if(!VideoInspectorIsEnabled()) + RestoreVideoManager(); + gfApplicationActive=TRUE; +// RestrictMouseToXYXY(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); +#else + RestoreCursorClipRect( ); +#endif + } break; case WM_KILLFOCUS: -//#if !defined( JA2 ) && !defined( UTIL ) -// if(!VideoInspectorIsEnabled()) -// SuspendVideoManager(); -// -// gfApplicationActive=FALSE; -// FreeMouseCursor(); -//#endif -// // Set a flag to restore surfaces once a WM_ACTIVEATEAPP is received -// fRestore = TRUE; + if (iScreenMode == 0) + { +#if !defined( JA2 ) && !defined( UTIL ) + if(!VideoInspectorIsEnabled()) + SuspendVideoManager(); + + gfApplicationActive=FALSE; + FreeMouseCursor(); +#endif + // Set a flag to restore surfaces once a WM_ACTIVEATEAPP is received + fRestore = TRUE; + } break;