allow a deferred windowport init during options processing

When options processing encountered OPTIONS=windowtype:X,
the code would immediately attempt to switch over to that
windowtype right in the midst of options processing.

This stores the chosen option into
chosen_window[WINTYPELEN]
thus allowing the startup code to choose it after
options processing has been completed.
This commit is contained in:
nhmall
2018-12-10 00:44:18 -05:00
parent 04d3be930b
commit 56dc7e150c
3 changed files with 86 additions and 120 deletions

View File

@@ -221,6 +221,10 @@ enum getloc_filters {
NUM_GFILTER
};
/* max size of a windowtype option */
#define WINTYPELEN 16
char chosen_windowtype[WINTYPELEN];
struct debug_flags {
boolean test;
#ifdef TTY_GRAPHICS
@@ -445,6 +449,9 @@ struct instance_flags {
short soko_prize_type2; /* amulet of reflection */
struct debug_flags debug;
boolean windowtype_locked; /* windowtype can't change from configfile */
boolean windowtype_deferred; /* pick a windowport and store it in
chosen_windowport[], but do not switch to
it in the midst of options processing */
};
/*