MCPcopy Create free account
hub / github.com/NetHack/NetHack / curses_create_main_windows

Function curses_create_main_windows

win/curses/cursinit.c:97–298  ·  view source on GitHub ↗

Create the "main" nonvolatile windows used by nethack */

Source from the content-addressed store, hash-verified

95
96/* Create the "main" nonvolatile windows used by nethack */
97void
98curses_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 */

Callers 2

curses_init_nhwindowsFunction · 0.85
curs_reset_windowsFunction · 0.85

Calls 7

set_window_positionFunction · 0.85
curses_get_nhwinFunction · 0.85
curses_del_nhwinFunction · 0.85
curses_count_windowFunction · 0.85
curses_add_nhwinFunction · 0.85
refreshFunction · 0.85

Tested by

no test coverage detected