mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-16 00:52:30 +00:00
gl_vidsdl.c: fix ValidMode(), bpp < 16 is problematic on windows
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@815 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
fde0ddf143
commit
224d3c720c
1 changed files with 17 additions and 1 deletions
|
@ -203,10 +203,26 @@ static qboolean VID_ValidMode (int width, int height, int bpp, qboolean fullscre
|
||||||
{
|
{
|
||||||
Uint32 flags = SDL_DEFAULT_FLAGS;
|
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)
|
if (fullscreen)
|
||||||
flags |= SDL_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 false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue