diff options
Diffstat (limited to 'src/setup/display.c')
-rw-r--r-- | src/setup/display.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/setup/display.c b/src/setup/display.c index f5f190f2..9ed0ae5f 100644 --- a/src/setup/display.c +++ b/src/setup/display.c @@ -257,9 +257,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. @@ -277,7 +275,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; + } } } @@ -715,6 +717,7 @@ void BindDisplayVariables(void) M_BindVariable("fullscreen", &fullscreen); M_BindVariable("screen_width", &screen_width); M_BindVariable("screen_height", &screen_height); + M_BindVariable("screen_bpp", &screen_bpp); M_BindVariable("startup_delay", &startup_delay); M_BindVariable("video_driver", &video_driver); M_BindVariable("usegamma", &usegamma); |