summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2011-02-28 20:48:27 +0000
committerSimon Howard2011-02-28 20:48:27 +0000
commit909d93ce182c215fddcd48acec9dd291dd8aba34 (patch)
tree115f0944013c651882d47bc07c1aae7c0a746d58
parenta366f68b2959282b22ab6f08569a253f0540745c (diff)
downloadchocolate-doom-909d93ce182c215fddcd48acec9dd291dd8aba34.tar.gz
chocolate-doom-909d93ce182c215fddcd48acec9dd291dd8aba34.tar.bz2
chocolate-doom-909d93ce182c215fddcd48acec9dd291dd8aba34.zip
Fix autoadjust of pixel depth in setup tool.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2283
-rw-r--r--setup/display.c10
1 files 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;
+ }
}
}