some further Windows startup tweaking

This commit is contained in:
nhmall
2026-04-09 14:04:28 -04:00
parent 699c31459b
commit 335cd65d5a
2 changed files with 26 additions and 12 deletions

View File

@@ -198,6 +198,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
#endif
gh.hname = "NetHack"; /* used for syntax messages */
set_emergency_io();
#ifndef MSWIN_GRAPHICS
early_init(argc, argv); /* already in WinMain for MSWIN_GRAPHICS */
#endif
@@ -219,7 +220,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
nethack_enter_consoletty();
consoletty_open(1);
#endif
set_emergency_io();
#ifdef EARLY_CONFIGFILE_PASS
rcfile_interface_options();
@@ -237,10 +237,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
choose_windows(
windowtype); /* sets all the window port function pointers */
init_nhwindows(&argc, argv);
/* if (GUILaunched || IsDebuggerPresent()) */
getreturn_enabled = TRUE;
#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
/* Save current directory and make sure it gets restored when
* the game is exited.
@@ -252,19 +248,19 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
set_default_prefix_locations(
argv[0]); /* must be re-done after initoptions_init()
* which clears out gp.fqn_prefix[] */
iflags.windowtype_deferred = TRUE;
// iflags.windowtype_deferred = TRUE;
program_state.early_options = 1;
early_options(&argc, &argv, &dir);
program_state.early_options = 0;
initoptions();
/* if (GUILaunched || IsDebuggerPresent()) */
getreturn_enabled = TRUE;
initoptions();
#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
chdir(gf.fqn_prefix[HACKPREFIX]);
#endif
check_recordfile((char *) 0);
/* did something earlier flag a need to exit without starting a game? */
if (windows_startup_state > 0) {
@@ -292,7 +288,21 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
&& (strstri(argv[0], "nethackw.exe") || GUILaunched))
iflags.windowtype_locked = TRUE;
#endif
#ifdef WINCHAIN
commit_windowchain();
#endif
init_nhwindows(&argc, argv);
#ifdef TTY_GRAPHICS
if WINDOWPORT(tty) {
int i;
for (i = 0; i < 20; ++i) {
nh_delay_output();
}
/* wait_synch(); */
}
#endif
#ifdef DLB
if (!dlb_init()) {
pline("%s\n%s\n%s\n%s\n\n", copyright_banner_line(1),
@@ -318,9 +328,6 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
iflags.use_background_glyph = FALSE;
if (WINDOWPORT(mswin))
iflags.use_background_glyph = TRUE;
#ifdef WINCHAIN
commit_windowchain();
#endif
// init_nhwindows(&argc, argv);