diff --git a/src/earlyarg.c b/src/earlyarg.c index e7a09887a..352a9cf46 100755 --- a/src/earlyarg.c +++ b/src/earlyarg.c @@ -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 diff --git a/src/options.c b/src/options.c index 55a4ad0bc..69283567e 100644 --- a/src/options.c +++ b/src/options.c @@ -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; diff --git a/src/symbols.c b/src/symbols.c index 7c32af3e3..0d60df7b2 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -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); diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c index 65a5401c4..ad2cef7de 100644 --- a/sys/unix/unixmain.c +++ b/sys/unix/unixmain.c @@ -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 , --version, --showpaths */ early_options(&argc, &argv, &dir); program_state.early_options = 0; diff --git a/sys/windows/windmain.c b/sys/windows/windmain.c index e15f9a882..99567f9d2 100644 --- a/sys/windows/windmain.c +++ b/sys/windows/windmain.c @@ -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()