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
| 93 | ** windows? Or at least all but WIN_INFO? -dean |
| 94 | */ |
| 95 | void |
| 96 | mswin_init_nhwindows(int *argc, char **argv) |
| 97 | { |
| 98 | HWND hWnd; |
| 99 | logDebug("mswin_init_nhwindows()\n"); |
| 100 | |
| 101 | #ifdef _DEBUG |
| 102 | { |
| 103 | /* truncate trace file */ |
| 104 | FILE *dfp = fopen("nhtrace.log", "w"); |
| 105 | fclose(dfp); |
| 106 | } |
| 107 | #endif |
| 108 | |
| 109 | /* intialize input subsystem */ |
| 110 | mswin_nh_input_init(); |
| 111 | |
| 112 | /* read registry settings */ |
| 113 | mswin_read_reg(); |
| 114 | |
| 115 | /* set it to WIN_ERR so we can detect attempts to |
| 116 | use this ID before it is inialized */ |
| 117 | WIN_MAP = WIN_ERR; |
| 118 | |
| 119 | /* check default values */ |
| 120 | if (iflags.wc_fontsiz_status < NHFONT_SIZE_MIN |
| 121 | || iflags.wc_fontsiz_status > NHFONT_SIZE_MAX) |
| 122 | iflags.wc_fontsiz_status = NHFONT_STATUS_DEFAULT_SIZE; |
| 123 | |
| 124 | if (iflags.wc_fontsiz_message < NHFONT_SIZE_MIN |
| 125 | || iflags.wc_fontsiz_message > NHFONT_SIZE_MAX) |
| 126 | iflags.wc_fontsiz_message = NHFONT_DEFAULT_SIZE; |
| 127 | |
| 128 | if (iflags.wc_fontsiz_text < NHFONT_SIZE_MIN |
| 129 | || iflags.wc_fontsiz_text > NHFONT_SIZE_MAX) |
| 130 | iflags.wc_fontsiz_text = NHFONT_DEFAULT_SIZE; |
| 131 | |
| 132 | if (iflags.wc_fontsiz_menu < NHFONT_SIZE_MIN |
| 133 | || iflags.wc_fontsiz_menu > NHFONT_SIZE_MAX) |
| 134 | iflags.wc_fontsiz_menu = NHFONT_DEFAULT_SIZE; |
| 135 | |
| 136 | if (iflags.wc_align_message == 0) |
| 137 | iflags.wc_align_message = ALIGN_BOTTOM; |
| 138 | if (iflags.wc_align_status == 0) |
| 139 | iflags.wc_align_status = ALIGN_TOP; |
| 140 | if (iflags.wc_scroll_margin == 0) |
| 141 | iflags.wc_scroll_margin = DEF_CLIPAROUND_MARGIN; |
| 142 | if (iflags.wc_tile_width == 0) |
| 143 | iflags.wc_tile_width = TILE_X; |
| 144 | if (iflags.wc_tile_height == 0) |
| 145 | iflags.wc_tile_height = TILE_Y; |
| 146 | |
| 147 | if (iflags.wc_vary_msgcount == 0) |
| 148 | iflags.wc_vary_msgcount = 3; |
| 149 | |
| 150 | /* force tabs in menus */ |
| 151 | iflags.menu_tab_sep = 1; |
| 152 |
nothing calls this directly
no test coverage detected