shithub: choc

Download patch

ref: 85b1dacd10a913c4988fa62251c4553e8d19ca98
parent: 9145cb3fd770bd643fa039d29b16eca6a6f36aac
author: Simon Howard <fraggle@gmail.com>
date: Wed Feb 6 17:18:16 EST 2008

Make 320x240 a "good" mode when aspect ratio correction is turned off.
Don't switch to "bad" modes when changing other settings.

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

--- a/setup/display.c
+++ b/setup/display.c
@@ -136,7 +136,7 @@
     w = mode->w;
     h = mode->h;
 
-    // 320x200 and 640x400 are always good
+    // 320x200 and 640x400 are always good (special case)
 
     if ((w == 320 && h == 200) || (w == 640 && h == 400))
     {
@@ -143,6 +143,16 @@
         return 1;
     }
 
+    // Special case: 320x240 letterboxed mode is okay (but not aspect
+    // ratio corrected 320x240)
+
+    if (w == 320 && h == 240 && !aspect_ratio_correct)
+    {
+        return 1;
+    }
+
+    // Ignore all modes less than 640x480
+
     return w >= 640 && h >= 480;
 }
 
@@ -207,6 +217,11 @@
 
     for (i=0; modes[i].w != 0; ++i)
     {
+        if (fullscreen && !GoodFullscreenMode(&modes[i]))
+        {
+            continue;
+        }
+
         diff = (selected_screen_width - modes[i].w)
                   * (selected_screen_width - modes[i].w) 
              + (selected_screen_height - modes[i].h)