shithub: choc

Download patch

ref: e512baa1c728602a3b7077741ec97ae4561b1200
parent: 3d641baeb5a3cfce3c35b23af3486e28541c2aac
author: Simon Howard <fraggle@gmail.com>
date: Thu Mar 17 18:43:56 EDT 2011

Fix up placement of display settings window.

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

--- a/setup/display.c
+++ b/setup/display.c
@@ -579,6 +579,7 @@
     txt_checkbox_t *ar_checkbox;
     txt_dropdown_list_t *bpp_selector;
     int num_columns;
+    int num_rows;
     int window_y;
 
     // What color depths are supported?  Generate supported_bpps array
@@ -611,8 +612,6 @@
 
     BuildFullscreenModesList();
 
-    window_y = 5;
-
     if (num_screen_modes_fullscreen <= 18)
     {
         num_columns = 3;
@@ -624,7 +623,17 @@
     else
     {
         num_columns = 5;
-        window_y -= 3;
+    }
+
+    num_rows = (num_screen_modes_fullscreen + num_columns - 1) / num_columns;
+
+    if (num_rows < 10)
+    {
+        window_y = 6 - ((num_rows + 1) / 2);
+    }
+    else
+    {
+        window_y = 1;
     }
 
     modes_table = TXT_NewTable(num_columns);