Change Windows startup

remove the safeproc pseudo-windowport routines from
almost a decade ago.

A very early pass is made through the config file,
seeking out just the interface-related OPTIONS=windowport
and OPTIONS=soundlib and ignoring all other options in the
config file during that early pass, so the windowport
can be activated without the NetHack core initialization
in place that some of the other rcfile OPTIONS require.

Bundles the existing rcfile processing code into rcfile().

New functions to control which rcfile options will be
disregarded in the early config file pass, and which will be
processed:

    set_all_options_disregarded();
    set_all_options_heeded();
    disregard_this_option(opt_xx);
    heed_this_option(opt_xx);

Windows calls rcfile_interface_options(), which is
a bundling of a series of function calls to achieve
the desired result.

    void
    rcfile_interface_options(void)
    {
        allopt_array_init();
        set_all_options_disregarded();
        heed_this_option(opt_windowtype);
        heed_this_option(opt_soundlib);
        rcfile();
        set_all_options_heeded();
        disregard_this_option(opt_windowtype);
        disregard_this_option(opt_soundlib);
    }
This commit is contained in:
nhmall
2026-04-05 11:36:19 -04:00
parent 92340a6827
commit acb85b18cf
23 changed files with 450 additions and 959 deletions

View File

@@ -335,6 +335,8 @@ extern boolean parse_conf_file(FILE *fp, boolean (*proc)(char *arg));
extern void set_configfile_name(const char *);
extern char *get_configfile(void);
extern const char *get_default_configfile(void);
extern void rcfile(void);
extern void rcfile_interface_options(void);
/* ### coloratt.c ### */
@@ -2320,6 +2322,10 @@ extern int msgtype_type(const char *, boolean) NONNULLARG1;
extern void hide_unhide_msgtypes(boolean, int);
extern void msgtype_free(void);
extern void options_free_window_colors(void);
extern void set_all_options_heeded(void);
extern void set_all_options_disregarded(void);
extern void heed_this_option(enum opt);
extern void disregard_this_option(enum opt);
#ifdef TTY_PERM_INVENT
extern void check_perm_invent_again(void);
#endif
@@ -2345,6 +2351,7 @@ extern int dowhatdoes(void);
extern char *dowhatdoes_core(char, char *) NONNULLARG2; /*might return NULL*/
extern int dohelp(void);
extern int dohistory(void);
void allopt_array_init(void);
/* ### xxmain.c ### */