Create the "main" nonvolatile windows used by nethack */
| 95 | |
| 96 | /* Create the "main" nonvolatile windows used by nethack */ |
| 97 | void |
| 98 | curses_create_main_windows(void) |
| 99 | { |
| 100 | /* int min_message_height = 1; */ |
| 101 | int message_orientation = 0; |
| 102 | int status_orientation = 0; |
| 103 | int border_space = 0; |
| 104 | int hspace = term_cols - 80; |
| 105 | boolean borders = FALSE, noperminv_borders = FALSE; |
| 106 | |
| 107 | switch (iflags.wc2_windowborders) { |
| 108 | default: |
| 109 | case 0: /* Off */ |
| 110 | borders = FALSE; |
| 111 | break; |
| 112 | |
| 113 | case 3: |
| 114 | noperminv_borders = TRUE; |
| 115 | FALLTHROUGH; |
| 116 | /*FALLTHRU*/ |
| 117 | case 1: /* On */ |
| 118 | borders = TRUE; |
| 119 | break; |
| 120 | |
| 121 | case 4: |
| 122 | noperminv_borders = TRUE; |
| 123 | FALLTHROUGH; |
| 124 | /*FALLTHRU*/ |
| 125 | case 2: /* Auto */ |
| 126 | borders = (term_cols >= 80 + 2 && term_rows >= 24 + 2); |
| 127 | break; |
| 128 | } |
| 129 | |
| 130 | if (borders) { |
| 131 | border_space = 2; |
| 132 | hspace -= border_space; |
| 133 | } |
| 134 | |
| 135 | if ((term_cols - border_space) < COLNO) { |
| 136 | /* min_message_height++; */ |
| 137 | } |
| 138 | |
| 139 | /* Determine status window orientation */ |
| 140 | if (!iflags.wc_align_status) |
| 141 | iflags.wc_align_status = ALIGN_BOTTOM; |
| 142 | if (iflags.wc_align_status == ALIGN_TOP |
| 143 | || iflags.wc_align_status == ALIGN_BOTTOM) { |
| 144 | status_orientation = iflags.wc_align_status; |
| 145 | } else { /* left or right alignment */ |
| 146 | /* |
| 147 | * Max space for player name and title horizontally. |
| 148 | * [Width of 26 gives enough room for a 24 character |
| 149 | * hitpoint bar (horizontal layout uses 30 for that) and |
| 150 | * can accommodate widest field ("Experience : 30/123456789") |
| 151 | * other than title without truncating anything. |
| 152 | * Height originally required at least 24 lines, but 21 |
| 153 | * suffices and 20 can be made to work by suppressing score.] |
| 154 | */ |
no test coverage detected