From 909d93ce182c215fddcd48acec9dd291dd8aba34 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 28 Feb 2011 20:48:27 +0000 Subject: Fix autoadjust of pixel depth in setup tool. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2283 --- setup/display.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup/display.c b/setup/display.c index f4a82520..b4e95688 100644 --- a/setup/display.c +++ b/setup/display.c @@ -247,9 +247,7 @@ static int GetSupportedBPPIndex(char *description) } } - // Shouldn't happen; fall back to the first in the list. - - return 0; + return -1; } // Set selected_bpp to match screen_bpp. @@ -267,7 +265,11 @@ static int TrySetSelectedBPP(void) if (pixel_depths[i].bpp == screen_bpp) { selected_bpp = GetSupportedBPPIndex(pixel_depths[i].description); - return 1; + + if (selected_bpp >= 0) + { + return 1; + } } } -- cgit v1.2.3