some further startup, option processing bits
This commit is contained in:
@@ -182,6 +182,11 @@ early_options(int *argc_p, char ***argv_p, char **hackdir_p)
|
||||
char **argv, *arg, *origarg;
|
||||
int argc, oldargc, ndx = 0, consumed = 0;
|
||||
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
if (argcheck(*argc_p, *argv_p, ARG_DUMPGLYPHIDS) == 2)
|
||||
opt_terminate();
|
||||
#endif
|
||||
|
||||
config_error_init(FALSE, "command line", FALSE);
|
||||
|
||||
/* treat "nethack ?" as a request for usage info; due to shell
|
||||
|
||||
@@ -7368,7 +7368,7 @@ initoptions_finish(void)
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
if (glyphid_cache_status())
|
||||
free_glyphid_cache();
|
||||
apply_customizations(gc.currentgraphics, do_custom_symbols);
|
||||
apply_customizations(gc.currentgraphics, do_custom_symbols | do_custom_colors);
|
||||
#endif
|
||||
go.opt_initial = FALSE;
|
||||
return;
|
||||
|
||||
@@ -638,14 +638,14 @@ parse_sym_line(char *buf, int which_set)
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
} else {
|
||||
if (gc.chosen_symset_start) {
|
||||
glyphrep_to_custom_map_entries(buf, &glyph);
|
||||
(void) glyphrep_to_custom_map_entries(buf, &glyph);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else if (gc.chosen_symset_start) {
|
||||
/* glyph, not symbol */
|
||||
glyphrep_to_custom_map_entries(buf, &glyph);
|
||||
(void) glyphrep_to_custom_map_entries(buf, &glyph);
|
||||
}
|
||||
#ifndef ENHANCED_SYMBOLS
|
||||
nhUse(glyph);
|
||||
|
||||
@@ -123,10 +123,6 @@ main(int argc, char *argv[])
|
||||
dir = nh_getenv("HACKDIR");
|
||||
#endif /* CHDIR */
|
||||
program_state.early_options = 1;
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
if (argcheck(argc, argv, ARG_DUMPGLYPHIDS) == 2)
|
||||
exit(EXIT_SUCCESS);
|
||||
#endif
|
||||
/* handle -dalthackdir, -s <score stuff>, --version, --showpaths */
|
||||
early_options(&argc, &argv, &dir);
|
||||
program_state.early_options = 0;
|
||||
|
||||
@@ -167,12 +167,6 @@ MAIN(int argc, char *argv[])
|
||||
/* setting iflags.colorcount has to be after early_init()
|
||||
* because it zeros out all of iflags */
|
||||
hwnd = GetDesktopWindow();
|
||||
hdc = GetDC(hwnd);
|
||||
if (hdc) {
|
||||
bpp = GetDeviceCaps(hdc, BITSPIXEL);
|
||||
iflags.colorcount = (bpp >= 16) ? 16777216 : (bpp >= 8) ? 256 : 16;
|
||||
ReleaseDC(hwnd, hdc);
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef DEBUG
|
||||
@@ -201,6 +195,15 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
|
||||
#ifndef MSWIN_GRAPHICS
|
||||
early_init(argc, argv); /* already in WinMain for MSWIN_GRAPHICS */
|
||||
#endif
|
||||
|
||||
/* this must be done after early_init() because early_init()
|
||||
sets iflags to zero */
|
||||
hdc = GetDC(hwnd);
|
||||
if (hdc) {
|
||||
bpp = GetDeviceCaps(hdc, BITSPIXEL);
|
||||
iflags.colorcount = (bpp >= 16) ? 16777216 : (bpp >= 8) ? 256 : 16;
|
||||
ReleaseDC(hwnd, hdc);
|
||||
}
|
||||
gh.hname = "NetHack"; /* used for syntax messages */
|
||||
set_default_prefix_locations(
|
||||
argv[0]); /* must be re-done after initoptions_init()
|
||||
|
||||
Reference in New Issue
Block a user