From 52a9af72780ee800348d8ba41eb7622393392849 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 13 Nov 2024 13:57:18 -0500 Subject: [PATCH] early_init() was being called twice on Windows GUI --- sys/windows/windmain.c | 4 +++- win/win32/NetHackW.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/windows/windmain.c b/sys/windows/windmain.c index 14cc255a6..0cbded52d 100644 --- a/sys/windows/windmain.c +++ b/sys/windows/windmain.c @@ -179,7 +179,9 @@ MAIN(int argc, char *argv[]) safe_routines(); #endif /* WIN32CON */ - early_init(argc, argv); +#ifndef MSWIN_GRAPHICS + early_init(argc, argv); /* already in WinMain for MSWIN_GRAPHICS */ +#endif /* setting iflags.colorcount has to be after early_init() * because it zeros out all of iflags */ hwnd = GetDesktopWindow(); diff --git a/win/win32/NetHackW.c b/win/win32/NetHackW.c index 00a4d1b47..033dc797c 100644 --- a/win/win32/NetHackW.c +++ b/win/win32/NetHackW.c @@ -131,7 +131,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, windowprocs.win_wait_synch = mswin_wait_synch; win10_init(); - /* early_init(0, NULL); */ /* Change as needed to support CRASHREPORT */ + early_init(0, NULL); /* Change as needed to support CRASHREPORT */ /* init application structure */ _nethack_app.hApp = hInstance;