From abb1aeeea2bd8ef647c23a0e4987b3915aebddf2 Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Sun, 21 Nov 2021 12:53:38 +0000 Subject: [PATCH] Enable any wrapper that supports upscaling to use any resolution and if using no wrapper (or using a wrapper that doesn't support upscaling) it will still show the error message if the resolution is not supported (by Asdow). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9215 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Standard Gaming Platform/video.cpp | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/Standard Gaming Platform/video.cpp b/Standard Gaming Platform/video.cpp index 3c7134ef..fd623560 100644 --- a/Standard Gaming Platform/video.cpp +++ b/Standard Gaming Platform/video.cpp @@ -288,28 +288,7 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void * } else // fullscreen mode { - // Buggler: Get Primary Screen Supported Resolutions - DEVMODE DevMode; - BOOLEAN fResSupported = FALSE; - for( INT32 iModeNum = 0; EnumDisplaySettings( 0, iModeNum, &DevMode ) != 0; iModeNum++ ) - { - if (SCREEN_WIDTH == DevMode.dmPelsWidth && SCREEN_HEIGHT == DevMode.dmPelsHeight ) - { - fResSupported = TRUE; - break; - } - } - - if ( !fResSupported ) - { - CHAR16 sString[ 256 ]; - swprintf( sString, Additional113Text[ADDTEXT_DIFFRES_REQUIRED], SCREEN_WIDTH, SCREEN_HEIGHT ); - MessageBoxW( NULL, sString, APPLICATION_NAMEW, MB_ICONEXCLAMATION); - PostQuitMessage(1); - return FALSE; - } - else - hWindow = CreateWindowEx(WS_EX_TOPMOST, (LPCSTR) ClassName, "Jagged Alliance 2", WS_POPUP | WS_VISIBLE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, hInstance, NULL); + hWindow = CreateWindowEx(WS_EX_TOPMOST, (LPCSTR) ClassName, "Jagged Alliance 2", WS_POPUP | WS_VISIBLE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL, NULL, hInstance, NULL); } if (hWindow == NULL) { @@ -386,6 +365,12 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void * ReturnCode = IDirectDraw2_SetDisplayMode( gpDirectDrawObject, SCREEN_WIDTH, SCREEN_HEIGHT, gbPixelDepth, 0, 0 ); if (ReturnCode != DD_OK) { + IDirectDraw2_SetCooperativeLevel(gpDirectDrawObject, ghWindow, DDSCL_NORMAL); + + CHAR16 sString[256]; + swprintf(sString, Additional113Text[ADDTEXT_DIFFRES_REQUIRED], SCREEN_WIDTH, SCREEN_HEIGHT); + MessageBoxW(NULL, sString, APPLICATION_NAMEW, MB_ICONEXCLAMATION); + PostQuitMessage(1); DirectXAttempt ( ReturnCode, __LINE__, __FILE__ ); return FALSE; }