some windows fixes

Resolves #1526
This commit is contained in:
nhmall
2026-05-10 16:00:33 -04:00
parent 9d5b02d912
commit 745c7fb8d8
5 changed files with 111 additions and 36 deletions
+4
View File
@@ -347,6 +347,10 @@ extern void disregard_this_config_statement(int);
extern boolean config_unmatched_ignored(void); extern boolean config_unmatched_ignored(void);
extern void clear_ignore_errors_on_unmatched(void); extern void clear_ignore_errors_on_unmatched(void);
extern void set_ignore_errors_on_unmatched(void); extern void set_ignore_errors_on_unmatched(void);
#ifdef MSWIN_GRAPHICS
extern void disregard_some_mswin_options(void);
extern void rcfile_only_some_mswin_options(void);
#endif
/* ### coloratt.c ### */ /* ### coloratt.c ### */
+78 -34
View File
@@ -1956,40 +1956,6 @@ rcfile(void)
/*[end of nethackrc handling]*/ /*[end of nethackrc handling]*/
} }
void
rcfile_interface_options(void)
{
allopt_array_init();
disregard_all_options();
disregard_all_config_statements();
heed_this_option(opt_windowtype);
heed_this_option(opt_soundlib);
set_ignore_errors_on_unmatched();
ignore_statement_errors = TRUE;
rcfile();
heed_all_config_statements();
heed_all_options();
disregard_this_option(opt_windowtype);
disregard_this_option(opt_soundlib);
clear_ignore_errors_on_unmatched();
ignore_statement_errors = FALSE;
}
void
rcfile_only_this_option(enum opt heeded_option)
{
allopt_array_init();
disregard_all_options();
disregard_all_config_statements();
heed_this_option(heeded_option);
set_ignore_errors_on_unmatched();
ignore_statement_errors = TRUE;
rcfile();
heed_all_config_statements();
heed_all_options();
clear_ignore_errors_on_unmatched();
ignore_statement_errors = FALSE;
}
void void
heed_all_config_statements(void) heed_all_config_statements(void)
@@ -2039,6 +2005,84 @@ config_unmatched_ignored(void)
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
void
rcfile_interface_options(void)
{
allopt_array_init();
disregard_all_options();
disregard_all_config_statements();
heed_this_option(opt_windowtype);
heed_this_option(opt_soundlib);
set_ignore_errors_on_unmatched();
ignore_statement_errors = TRUE;
rcfile();
heed_all_config_statements();
heed_all_options();
disregard_this_option(opt_windowtype);
disregard_this_option(opt_soundlib);
clear_ignore_errors_on_unmatched();
ignore_statement_errors = FALSE;
}
void
rcfile_only_this_option(enum opt heeded_option)
{
allopt_array_init();
disregard_all_options();
disregard_all_config_statements();
heed_this_option(heeded_option);
set_ignore_errors_on_unmatched();
ignore_statement_errors = TRUE;
rcfile();
heed_all_config_statements();
heed_all_options();
clear_ignore_errors_on_unmatched();
ignore_statement_errors = FALSE;
}
#ifdef MSWIN_GRAPHICS
void
disregard_some_mswin_options(void)
{
/* later for these */
disregard_this_option(opt_map_mode);
disregard_this_option(opt_font_map);
disregard_this_option(opt_font_menu);
disregard_this_option(opt_font_message);
disregard_this_option(opt_font_status);
disregard_this_option(opt_font_size_map);
disregard_this_option(opt_font_size_menu);
disregard_this_option(opt_font_size_message);
disregard_this_option(opt_font_size_status);
}
void
rcfile_only_some_mswin_options(void)
{
allopt_array_init();
disregard_all_options();
disregard_all_config_statements();
heed_this_option(opt_map_mode);
heed_this_option(opt_font_map);
heed_this_option(opt_font_menu);
heed_this_option(opt_font_message);
heed_this_option(opt_font_status);
heed_this_option(opt_font_size_map);
heed_this_option(opt_font_size_menu);
heed_this_option(opt_font_size_message);
heed_this_option(opt_font_size_status);
set_ignore_errors_on_unmatched();
ignore_statement_errors = TRUE;
rcfile();
heed_all_config_statements();
heed_all_options();
clear_ignore_errors_on_unmatched();
ignore_statement_errors = FALSE;
}
#endif /* MSWIN_GRAPHICS */
#endif /* SFCTOOL */ #endif /* SFCTOOL */
#ifdef SYSCF #ifdef SYSCF
+6 -1
View File
@@ -260,6 +260,9 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
early_options(&argc, &argv, &dir); early_options(&argc, &argv, &dir);
program_state.early_options = 0; program_state.early_options = 0;
#ifdef MSWIN_GRAPHICS
disregard_some_mswin_options();
#endif
initoptions(); initoptions();
#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS) #if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
chdir(gf.fqn_prefix[HACKPREFIX]); chdir(gf.fqn_prefix[HACKPREFIX]);
@@ -325,7 +328,9 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
#elif defined(SND_LIB_WINDSOUND) #elif defined(SND_LIB_WINDSOUND)
assign_soundlib(soundlib_windsound); assign_soundlib(soundlib_windsound);
#endif #endif
#ifdef MSWIN_GRAPHICS
rcfile_only_some_mswin_options();
#endif
u.uhp = 1; /* prevent RIP on early quits */ u.uhp = 1; /* prevent RIP on early quits */
u.ux = 0; /* prevent flush_screen() */ u.ux = 0; /* prevent flush_screen() */
+21
View File
@@ -1193,6 +1193,11 @@ mswin_select_map_mode(int mode)
data = data =
(PNHMainWindow) GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA); (PNHMainWindow) GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA);
if (!data) {
impossible("data is null in %s:%d", __func__, __LINE__);
return;
}
/* override for Rogue level */ /* override for Rogue level */
if (Is_rogue_level(&u.uz) && !IS_MAP_ASCII(mode)) if (Is_rogue_level(&u.uz) && !IS_MAP_ASCII(mode))
return; return;
@@ -1268,6 +1273,22 @@ mapmode2menuid(int map_mode)
return -1; return -1;
} }
void
only_some_mswin_options(void)
{
disregard_this_option(opt_map_mode); /* later */
disregard_this_option(opt_font_map);
disregard_this_option(opt_font_menu);
disregard_this_option(opt_font_message);
disregard_this_option(opt_font_status);
disregard_this_option(opt_font_size_map);
disregard_this_option(opt_font_size_menu);
disregard_this_option(opt_font_size_message);
disregard_this_option(opt_font_size_status);
}
void void
nhlock_windows(BOOL lock) nhlock_windows(BOOL lock)
{ {
+2 -1
View File
@@ -883,7 +883,8 @@ mswin_display_nhwindow(winid wid, boolean block)
} else { } else {
if ((GetNHApp()->windowlist[wid].type == NHW_MAP) if ((GetNHApp()->windowlist[wid].type == NHW_MAP)
|| (GetNHApp()->windowlist[wid].type == NHW_MESSAGE)) { || (GetNHApp()->windowlist[wid].type == NHW_MESSAGE)) {
(void) mswin_nhgetch(); if (!program_state.savefile_completed)
(void) mswin_nhgetch();
} }
} }
} }