init_nhwindows(int *argcp, char **argv) -- Initialize the windows used by NetHack. This can also create the standard windows listed at the top, but does not display them. -- Any commandline arguments relevant to the windowport should be interpreted, and *argcp and *argv should be changed to
| 172 | ** windows? Or at least all but WIN_INFO? -dean |
| 173 | */ |
| 174 | void |
| 175 | curses_init_nhwindows( |
| 176 | int *argcp UNUSED, |
| 177 | char **argv UNUSED) |
| 178 | { |
| 179 | #ifdef PDCURSES |
| 180 | char window_title[BUFSZ]; |
| 181 | #endif |
| 182 | #ifdef CURSES_UNICODE |
| 183 | #ifdef PDCURSES |
| 184 | static char pdc_font[BUFSZ] = ""; |
| 185 | #endif |
| 186 | #endif |
| 187 | |
| 188 | #ifdef CURSES_UNICODE |
| 189 | setlocale(LC_CTYPE, ""); |
| 190 | #ifdef PDCURSES |
| 191 | /* Assume the DOSVGA port of PDCursesMod, or the SDL1 or SDL2 port of |
| 192 | either PDCurses or PDCursesMod. Honor the font_map option to set |
| 193 | a font. |
| 194 | On MS-DOS, if no font_map is set, use ter-u16v.psf if it is present. |
| 195 | PDC_FONT has no effect on other PDCurses or PDCursesMod ports. */ |
| 196 | if (iflags.wc_font_map && iflags.wc_font_map[0]) { |
| 197 | Snprintf(pdc_font, sizeof(pdc_font), "PDC_FONT=%s", |
| 198 | iflags.wc_font_map); |
| 199 | #ifdef MSDOS |
| 200 | } else if (access("ter-u16v.psf", R_OK) >= 0) { |
| 201 | Snprintf(pdc_font, sizeof(pdc_font), "PDC_FONT=ter-u16v.psf"); |
| 202 | #endif |
| 203 | } |
| 204 | if (pdc_font[0] != '\0') { |
| 205 | putenv(pdc_font); |
| 206 | } |
| 207 | #endif |
| 208 | #endif |
| 209 | |
| 210 | /* if anything has already been output by nethack (for instance, warnings |
| 211 | about RC file issues), let the player acknowlege it before initscr() |
| 212 | erases the screen */ |
| 213 | if (iflags.raw_printed) |
| 214 | curses_wait_synch(); |
| 215 | |
| 216 | #ifdef XCURSES |
| 217 | base_term = Xinitscr(*argcp, argv); |
| 218 | #else |
| 219 | base_term = initscr(); |
| 220 | #endif |
| 221 | if (has_colors()) { |
| 222 | start_color(); |
| 223 | curses_init_nhcolors(); |
| 224 | } else { |
| 225 | iflags.use_color = FALSE; |
| 226 | set_option_mod_status("color", set_in_config); |
| 227 | iflags.wc2_guicolor = FALSE; |
| 228 | set_wc2_option_mod_status(WC2_GUICOLOR, set_in_config); |
| 229 | } |
| 230 | noecho(); |
| 231 | raw(); |
nothing calls this directly
no test coverage detected