Change Windows startup - take 2
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:
@@ -102,8 +102,6 @@ typedef unsigned readLenType;
|
||||
#endif
|
||||
#define BOOL_RANDOM (-1)
|
||||
|
||||
enum optchoice { opt_in, opt_out};
|
||||
|
||||
/*
|
||||
* type nhsym: loadable symbols go into this type
|
||||
*/
|
||||
@@ -575,6 +573,45 @@ typedef enum NHL_pcall_action {
|
||||
NHLpa_impossible
|
||||
} NHL_pcall_action;
|
||||
|
||||
enum optchoice { opt_in, opt_out};
|
||||
/*
|
||||
* option setting restrictions
|
||||
*/
|
||||
enum optset_restrictions {
|
||||
set_in_sysconf = 0, /* system config file option only */
|
||||
set_in_config = 1, /* config file option only */
|
||||
set_viaprog = 2, /* may be set via extern program, not seen in game */
|
||||
set_gameview = 3, /* may be set via extern program, displayed in game */
|
||||
set_in_game = 4, /* may be set via extern program or set in the game */
|
||||
set_wizonly = 5, /* may be set in the game if wizmode */
|
||||
set_wiznofuz = 6, /* wizard-mode only, but not by fuzzer */
|
||||
set_hidden = 7 /* placeholder for prefixed entries, never show it */
|
||||
};
|
||||
|
||||
/* these aren't the same as set_xxx */
|
||||
enum option_phases {
|
||||
phase_not_set = 0,
|
||||
builtin_opt = 1, /* compiled-in default value of an option */
|
||||
syscf_opt, /* sysconf setting of an option, overrides builtin */
|
||||
rc_file_opt, /* player's run-time config file setting, overrides syscf */
|
||||
environ_opt, /* player's environment NETHACKOPTIONS, overrides rc_file */
|
||||
cmdline_opt, /* program invocation command-line, overrides environ */
|
||||
play_opt, /* 'O' command, interactively set so overrides all */
|
||||
num_opt_phases
|
||||
};
|
||||
|
||||
#define SET__IS_VALUE_VALID(s) ((s < set_in_sysconf) || (s > set_wiznofuz))
|
||||
#include "optlist.h"
|
||||
enum opt {
|
||||
opt_prefix_only = -1,
|
||||
#define NHOPT_ENUM
|
||||
#include "optlist.h"
|
||||
#undef NHOPT_ENUM
|
||||
OPTCOUNT
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define SFCTOOL_BIT (1UL << 30)
|
||||
|
||||
#endif /* GLOBAL_H */
|
||||
|
||||
Reference in New Issue
Block a user