mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Merged from revision: 7716
- Improved message prompt when launching game in fullscreen mode on unsupported screen resolutions instead of just those that's set to larger than primary desktop resolution (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7717 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -288,14 +288,22 @@ BOOLEAN InitializeVideoManager(HINSTANCE hInstance, UINT16 usCommandShow, void *
|
||||
}
|
||||
else // fullscreen mode
|
||||
{
|
||||
// Buggler: Get Primary Desktop Resolution
|
||||
DWORD dwScreenWidth = ::GetSystemMetrics(SM_CXSCREEN);
|
||||
DWORD dwScreenHeight = ::GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
if (SCREEN_WIDTH > dwScreenWidth || SCREEN_HEIGHT > dwScreenHeight )
|
||||
// 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_LOWERRES_REQUIRED], dwScreenWidth, dwScreenHeight );
|
||||
swprintf( sString, Additional113Text[ADDTEXT_DIFFRES_REQUIRED], SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
MessageBoxW( NULL, sString, APPLICATION_NAMEW, MB_ICONEXCLAMATION);
|
||||
PostQuitMessage(1);
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user