shithub: choc

Download patch

ref: 909d93ce182c215fddcd48acec9dd291dd8aba34
parent: a366f68b2959282b22ab6f08569a253f0540745c
author: Simon Howard <[email protected]>
date: Mon Feb 28 15:48:27 EST 2011

Fix autoadjust of pixel depth in setup tool.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2283

--- a/setup/display.c
+++ b/setup/display.c
@@ -247,9 +247,7 @@
         }
     }
 
-    // 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 @@
         if (pixel_depths[i].bpp == screen_bpp)
         {
             selected_bpp = GetSupportedBPPIndex(pixel_depths[i].description);
-            return 1;
+
+            if (selected_bpp >= 0)
+            {
+                return 1;
+            }
         }
     }