foxygit / doom Log in
commit e512baa1c728602a3b7077741ec97ae4561b1200
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Thu Mar 17 22:43:56 2011 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Thu Mar 17 22:43:56 2011 +0000

    Fix up placement of display settings window.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 2304
---
 setup/display.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/setup/display.c b/setup/display.c
index b4e95688..44376eef 100644
--- a/setup/display.c
+++ b/setup/display.c
@@ -579,6 +579,7 @@ void ConfigDisplay(void)
     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 @@ void ConfigDisplay(void)

     BuildFullscreenModesList();

-    window_y = 5;
-
     if (num_screen_modes_fullscreen <= 18)
     {
         num_columns = 3;
@@ -624,7 +623,17 @@ void ConfigDisplay(void)
     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);