mirror of
https://github.com/blendogames/thirtyflightsofloving.git
synced 2025-01-18 06:22:30 +00:00
Use proper detection of error/failure from GetSystemMetrics() API calls in win32/vid_dll.c->VID_GetModeInfo().
This commit is contained in:
parent
95295401a4
commit
d552aa1e48
1 changed files with 9 additions and 3 deletions
|
@ -562,10 +562,16 @@ qboolean VID_GetModeInfo (int *width, int *height, int mode)
|
|||
// desktop-resolution display mode
|
||||
if ( r_mode_desktop->integer && (vid_fullscreen->integer >= 2) )
|
||||
{
|
||||
*width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||
*height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
|
||||
if ( (width == 0) || (height == 0) )
|
||||
int dskWidth=0, dskHeight=0;
|
||||
dskWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||
dskHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN);
|
||||
// Check for API call failure
|
||||
if ( (dskWidth == 0) || (dskHeight == 0) )
|
||||
return false;
|
||||
|
||||
*width = dskWidth;
|
||||
*height = dskHeight;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue