From ca18412bacebba2ec3c4e92803d48711b934fb1f Mon Sep 17 00:00:00 2001 From: Sander van Dijk Date: Thu, 21 Feb 2013 19:17:18 +0000 Subject: [PATCH] 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 --- Quake/gl_vidsdl.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Quake/gl_vidsdl.c b/Quake/gl_vidsdl.c index 5b4b6433..f19cd0b8 100644 --- a/Quake/gl_vidsdl.c +++ b/Quake/gl_vidsdl.c @@ -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;