gl_vidsdl.c: fix ValidMode(), bpp < 16 is problematic on windows

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@815 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Sander van Dijk 2013-02-21 19:17:18 +00:00
parent 6c23dcd91f
commit ca18412bac

View file

@ -203,10 +203,26 @@ static qboolean VID_ValidMode (int width, int height, int bpp, qboolean fullscre
{
Uint32 flags = SDL_DEFAULT_FLAGS;
if (width < 320)
return false;
if (height < 200)
return false;
switch (bpp)
{
case 16:
case 24:
case 32:
break;
default:
return false;
}
if (fullscreen)
flags |= SDL_FULLSCREEN;
if (width < 320 || height < 200 || !SDL_VideoModeOK(width, height, bpp, flags))
if (!SDL_VideoModeOK(width, height, bpp, flags))
return false;
return true;