mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
gl_vidsdl.c: be bit more lenient (and safer) regarding bpp
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@836 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
e2ea2d2360
commit
1c59d663ad
1 changed files with 7 additions and 6 deletions
|
@ -203,6 +203,11 @@ static qboolean VID_ValidMode (int width, int height, int bpp, qboolean fullscre
|
|||
if (height < 200)
|
||||
return false;
|
||||
|
||||
if (fullscreen)
|
||||
flags |= SDL_FULLSCREEN;
|
||||
|
||||
bpp = SDL_VideoModeOK(width, height, bpp, flags);
|
||||
|
||||
switch (bpp)
|
||||
{
|
||||
case 16:
|
||||
|
@ -213,12 +218,6 @@ static qboolean VID_ValidMode (int width, int height, int bpp, qboolean fullscre
|
|||
return false;
|
||||
}
|
||||
|
||||
if (fullscreen)
|
||||
flags |= SDL_FULLSCREEN;
|
||||
|
||||
if (!SDL_VideoModeOK(width, height, bpp, flags))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -250,6 +249,8 @@ static int VID_SetMode (int width, int height, int bpp, qboolean fullscreen)
|
|||
if (SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, (vid_vsync.value) ? 1 : 0) == -1)
|
||||
gl_swap_control = false;
|
||||
|
||||
bpp = SDL_VideoModeOK(width, height, bpp, flags);
|
||||
|
||||
draw_context = SDL_SetVideoMode(width, height, bpp, flags);
|
||||
if (!draw_context)
|
||||
Sys_Error ("Couldn't set video mode");
|
||||
|
|
Loading…
Reference in a new issue