summaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorSimon Howard2008-02-06 22:18:16 +0000
committerSimon Howard2008-02-06 22:18:16 +0000
commit85b1dacd10a913c4988fa62251c4553e8d19ca98 (patch)
tree41f9fb7ece7a9817f53942c50e105154adae902e /setup
parent9145cb3fd770bd643fa039d29b16eca6a6f36aac (diff)
downloadchocolate-doom-85b1dacd10a913c4988fa62251c4553e8d19ca98.tar.gz
chocolate-doom-85b1dacd10a913c4988fa62251c4553e8d19ca98.tar.bz2
chocolate-doom-85b1dacd10a913c4988fa62251c4553e8d19ca98.zip
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
Diffstat (limited to 'setup')
-rw-r--r--setup/display.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/setup/display.c b/setup/display.c
index 0ead83fe..1f48a9a6 100644
--- a/setup/display.c
+++ b/setup/display.c
@@ -136,13 +136,23 @@ static int GoodFullscreenMode(screen_mode_t *mode)
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))
{
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 @@ static int FindBestMode(screen_mode_t *modes)
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)