split g into multiple structures
The consolidation of global variables from scattered source
files into decl.c and declared in decl.h was begun in 3.7.0.
Their placement in common files was done for centralized
initialization and potential re-initialization during a
"play again" scenario.
It wasn't really necessary for all of them to be housed in a
single huge structure to meet the "play again" requirement,
and the single huge structure has been a little unwieldy when
it comes to maintenance.
Following this commit, instead of one single extremely large structure
named 'g' to house all of the relocated global variables, they
are distributed into several ga through gz.
To make things easy for the developer, each variable is placed
into the struct corresponding to the starting letter of the variable.
That way, no lookup is required in order to know which struct houses
a particular variable, it is a simple match to the starting letter
for all the centralized global variables.
A global variable named 'amulets', would be found in ga.
ga.amulets
^ ^
A global varable named 'move', would be found in gm.
gm.moves
^ ^
A global variable named 'val_for_n_or_more' would be found in gv.
gv.val_for_n_or_more
^ ^
A global variable named 'youmonst' would be found in gy.
gy.youmonst
^ ^
This commit is contained in:
208
src/symbols.c
208
src/symbols.c
@@ -54,8 +54,8 @@ void (*utf8graphics_mode_callback)(void) = 0; /* set in tty_start_screen and
|
||||
*
|
||||
* If (arg != 0), which is the normal expected
|
||||
* usage, then showsyms are taken from the
|
||||
* adjustable display symbols found in g.primary_syms.
|
||||
* g.primary_syms may have been loaded from an external
|
||||
* adjustable display symbols found in gp.primary_syms.
|
||||
* gp.primary_syms may have been loaded from an external
|
||||
* symbol file by config file options or interactively
|
||||
* in the Options menu.
|
||||
*
|
||||
@@ -65,10 +65,10 @@ void (*utf8graphics_mode_callback)(void) = 0; /* set in tty_start_screen and
|
||||
* out of other {rogue} level display modes.
|
||||
*
|
||||
* If arg is ROGUESET, this places the rogue level
|
||||
* symbols from g.rogue_syms into g.showsyms.
|
||||
* symbols from gr.rogue_syms into gs.showsyms.
|
||||
*
|
||||
* If arg is PRIMARYSET, this places the symbols
|
||||
* from g.primary_syms into g.showsyms.
|
||||
* from gp.primary_syms into gs.showsyms.
|
||||
*
|
||||
* update_primary_symset()
|
||||
* Update a member of the primary(primary_*) symbol set.
|
||||
@@ -100,15 +100,15 @@ init_showsyms(void)
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < MAXPCHARS; i++)
|
||||
g.showsyms[i + SYM_OFF_P] = defsyms[i].sym;
|
||||
gs.showsyms[i + SYM_OFF_P] = defsyms[i].sym;
|
||||
for (i = 0; i < MAXOCLASSES; i++)
|
||||
g.showsyms[i + SYM_OFF_O] = def_oc_syms[i].sym;
|
||||
gs.showsyms[i + SYM_OFF_O] = def_oc_syms[i].sym;
|
||||
for (i = 0; i < MAXMCLASSES; i++)
|
||||
g.showsyms[i + SYM_OFF_M] = def_monsyms[i].sym;
|
||||
gs.showsyms[i + SYM_OFF_M] = def_monsyms[i].sym;
|
||||
for (i = 0; i < WARNCOUNT; i++)
|
||||
g.showsyms[i + SYM_OFF_W] = def_warnsyms[i].sym;
|
||||
gs.showsyms[i + SYM_OFF_W] = def_warnsyms[i].sym;
|
||||
for (i = 0; i < MAXOTHER; i++)
|
||||
g.showsyms[i + SYM_OFF_X] = get_othersym(i, PRIMARYSET);
|
||||
gs.showsyms[i + SYM_OFF_X] = get_othersym(i, PRIMARYSET);
|
||||
}
|
||||
|
||||
/* initialize defaults for the overrides to the rogue symset */
|
||||
@@ -118,7 +118,7 @@ init_ov_rogue_symbols(void)
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < SYM_MAX; i++)
|
||||
g.ov_rogue_syms[i] = (nhsym) 0;
|
||||
go.ov_rogue_syms[i] = (nhsym) 0;
|
||||
}
|
||||
/* initialize defaults for the overrides to the primary symset */
|
||||
void
|
||||
@@ -127,7 +127,7 @@ init_ov_primary_symbols(void)
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < SYM_MAX; i++)
|
||||
g.ov_primary_syms[i] = (nhsym) 0;
|
||||
go.ov_primary_syms[i] = (nhsym) 0;
|
||||
}
|
||||
|
||||
nhsym
|
||||
@@ -137,11 +137,11 @@ get_othersym(int idx, int which_set)
|
||||
int oidx = idx + SYM_OFF_X;
|
||||
|
||||
if (which_set == ROGUESET)
|
||||
sym = g.ov_rogue_syms[oidx] ? g.ov_rogue_syms[oidx]
|
||||
: g.rogue_syms[oidx];
|
||||
sym = go.ov_rogue_syms[oidx] ? go.ov_rogue_syms[oidx]
|
||||
: gr.rogue_syms[oidx];
|
||||
else
|
||||
sym = g.ov_primary_syms[oidx] ? g.ov_primary_syms[oidx]
|
||||
: g.primary_syms[oidx];
|
||||
sym = go.ov_primary_syms[oidx] ? go.ov_primary_syms[oidx]
|
||||
: gp.primary_syms[oidx];
|
||||
if (!sym) {
|
||||
switch(idx) {
|
||||
case SYM_NOTHING:
|
||||
@@ -172,15 +172,15 @@ init_primary_symbols(void)
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < MAXPCHARS; i++)
|
||||
g.primary_syms[i + SYM_OFF_P] = defsyms[i].sym;
|
||||
gp.primary_syms[i + SYM_OFF_P] = defsyms[i].sym;
|
||||
for (i = 0; i < MAXOCLASSES; i++)
|
||||
g.primary_syms[i + SYM_OFF_O] = def_oc_syms[i].sym;
|
||||
gp.primary_syms[i + SYM_OFF_O] = def_oc_syms[i].sym;
|
||||
for (i = 0; i < MAXMCLASSES; i++)
|
||||
g.primary_syms[i + SYM_OFF_M] = def_monsyms[i].sym;
|
||||
gp.primary_syms[i + SYM_OFF_M] = def_monsyms[i].sym;
|
||||
for (i = 0; i < WARNCOUNT; i++)
|
||||
g.primary_syms[i + SYM_OFF_W] = def_warnsyms[i].sym;
|
||||
gp.primary_syms[i + SYM_OFF_W] = def_warnsyms[i].sym;
|
||||
for (i = 0; i < MAXOTHER; i++)
|
||||
g.primary_syms[i + SYM_OFF_X] = get_othersym(i, PRIMARYSET);
|
||||
gp.primary_syms[i + SYM_OFF_X] = get_othersym(i, PRIMARYSET);
|
||||
|
||||
clear_symsetentry(PRIMARYSET, FALSE);
|
||||
}
|
||||
@@ -195,25 +195,25 @@ init_rogue_symbols(void)
|
||||
later by the roguesymbols option */
|
||||
|
||||
for (i = 0; i < MAXPCHARS; i++)
|
||||
g.rogue_syms[i + SYM_OFF_P] = defsyms[i].sym;
|
||||
g.rogue_syms[S_vodoor] = g.rogue_syms[S_hodoor]
|
||||
= g.rogue_syms[S_ndoor] = '+';
|
||||
g.rogue_syms[S_upstair] = g.rogue_syms[S_dnstair] = '%';
|
||||
gr.rogue_syms[i + SYM_OFF_P] = defsyms[i].sym;
|
||||
gr.rogue_syms[S_vodoor] = gr.rogue_syms[S_hodoor]
|
||||
= gr.rogue_syms[S_ndoor] = '+';
|
||||
gr.rogue_syms[S_upstair] = gr.rogue_syms[S_dnstair] = '%';
|
||||
|
||||
for (i = 0; i < MAXOCLASSES; i++)
|
||||
g.rogue_syms[i + SYM_OFF_O] = def_r_oc_syms[i];
|
||||
gr.rogue_syms[i + SYM_OFF_O] = def_r_oc_syms[i];
|
||||
for (i = 0; i < MAXMCLASSES; i++)
|
||||
g.rogue_syms[i + SYM_OFF_M] = def_monsyms[i].sym;
|
||||
gr.rogue_syms[i + SYM_OFF_M] = def_monsyms[i].sym;
|
||||
for (i = 0; i < WARNCOUNT; i++)
|
||||
g.rogue_syms[i + SYM_OFF_W] = def_warnsyms[i].sym;
|
||||
gr.rogue_syms[i + SYM_OFF_W] = def_warnsyms[i].sym;
|
||||
for (i = 0; i < MAXOTHER; i++)
|
||||
g.rogue_syms[i + SYM_OFF_X] = get_othersym(i, ROGUESET);
|
||||
gr.rogue_syms[i + SYM_OFF_X] = get_othersym(i, ROGUESET);
|
||||
|
||||
clear_symsetentry(ROGUESET, FALSE);
|
||||
/* default on Rogue level is no color
|
||||
* but some symbol sets can override that
|
||||
*/
|
||||
g.symset[ROGUESET].nocolor = 1;
|
||||
gs.symset[ROGUESET].nocolor = 1;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -226,27 +226,27 @@ assign_graphics(int whichset)
|
||||
/* Adjust graphics display characters on Rogue levels */
|
||||
|
||||
for (i = 0; i < SYM_MAX; i++)
|
||||
g.showsyms[i] = g.ov_rogue_syms[i] ? g.ov_rogue_syms[i]
|
||||
: g.rogue_syms[i];
|
||||
gs.showsyms[i] = go.ov_rogue_syms[i] ? go.ov_rogue_syms[i]
|
||||
: gr.rogue_syms[i];
|
||||
|
||||
#if defined(MSDOS) && defined(USE_TILES)
|
||||
if (iflags.grmode)
|
||||
tileview(FALSE);
|
||||
#endif
|
||||
g.currentgraphics = ROGUESET;
|
||||
gc.currentgraphics = ROGUESET;
|
||||
break;
|
||||
|
||||
case PRIMARYSET:
|
||||
default:
|
||||
for (i = 0; i < SYM_MAX; i++)
|
||||
g.showsyms[i] = g.ov_primary_syms[i] ? g.ov_primary_syms[i]
|
||||
: g.primary_syms[i];
|
||||
gs.showsyms[i] = go.ov_primary_syms[i] ? go.ov_primary_syms[i]
|
||||
: gp.primary_syms[i];
|
||||
|
||||
#if defined(MSDOS) && defined(USE_TILES)
|
||||
if (iflags.grmode)
|
||||
tileview(TRUE);
|
||||
#endif
|
||||
g.currentgraphics = PRIMARYSET;
|
||||
gc.currentgraphics = PRIMARYSET;
|
||||
break;
|
||||
}
|
||||
reset_glyphmap(gm_symchange);
|
||||
@@ -259,8 +259,8 @@ switch_symbols(int nondefault)
|
||||
|
||||
if (nondefault) {
|
||||
for (i = 0; i < SYM_MAX; i++)
|
||||
g.showsyms[i] = g.ov_primary_syms[i] ? g.ov_primary_syms[i]
|
||||
: g.primary_syms[i];
|
||||
gs.showsyms[i] = go.ov_primary_syms[i] ? go.ov_primary_syms[i]
|
||||
: gp.primary_syms[i];
|
||||
#ifdef PC9800
|
||||
if (SYMHANDLING(H_IBM) && ibmgraphics_mode_callback)
|
||||
(*ibmgraphics_mode_callback)();
|
||||
@@ -297,44 +297,44 @@ switch_symbols(int nondefault)
|
||||
void
|
||||
update_ov_primary_symset(const struct symparse* symp, int val)
|
||||
{
|
||||
g.ov_primary_syms[symp->idx] = val;
|
||||
go.ov_primary_syms[symp->idx] = val;
|
||||
}
|
||||
|
||||
void
|
||||
update_ov_rogue_symset(const struct symparse* symp, int val)
|
||||
{
|
||||
g.ov_rogue_syms[symp->idx] = val;
|
||||
go.ov_rogue_syms[symp->idx] = val;
|
||||
}
|
||||
|
||||
void
|
||||
update_primary_symset(const struct symparse* symp, int val)
|
||||
{
|
||||
g.primary_syms[symp->idx] = val;
|
||||
gp.primary_syms[symp->idx] = val;
|
||||
}
|
||||
|
||||
void
|
||||
update_rogue_symset(const struct symparse* symp, int val)
|
||||
{
|
||||
g.rogue_syms[symp->idx] = val;
|
||||
gr.rogue_syms[symp->idx] = val;
|
||||
}
|
||||
|
||||
void
|
||||
clear_symsetentry(int which_set, boolean name_too)
|
||||
{
|
||||
if (g.symset[which_set].desc)
|
||||
free((genericptr_t) g.symset[which_set].desc);
|
||||
g.symset[which_set].desc = (char *) 0;
|
||||
if (gs.symset[which_set].desc)
|
||||
free((genericptr_t) gs.symset[which_set].desc);
|
||||
gs.symset[which_set].desc = (char *) 0;
|
||||
|
||||
g.symset[which_set].handling = H_UNK;
|
||||
g.symset[which_set].nocolor = 0;
|
||||
gs.symset[which_set].handling = H_UNK;
|
||||
gs.symset[which_set].nocolor = 0;
|
||||
/* initialize restriction bits */
|
||||
g.symset[which_set].primary = 0;
|
||||
g.symset[which_set].rogue = 0;
|
||||
gs.symset[which_set].primary = 0;
|
||||
gs.symset[which_set].rogue = 0;
|
||||
|
||||
if (name_too) {
|
||||
if (g.symset[which_set].name)
|
||||
free((genericptr_t) g.symset[which_set].name);
|
||||
g.symset[which_set].name = (char *) 0;
|
||||
if (gs.symset[which_set].name)
|
||||
free((genericptr_t) gs.symset[which_set].name);
|
||||
gs.symset[which_set].name = (char *) 0;
|
||||
}
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
free_all_glyphmap_u();
|
||||
@@ -423,7 +423,7 @@ const struct symparse loadsyms[] = {
|
||||
boolean
|
||||
proc_symset_line(char *buf)
|
||||
{
|
||||
return !((boolean) parse_sym_line(buf, g.symset_which_set));
|
||||
return !((boolean) parse_sym_line(buf, gs.symset_which_set));
|
||||
}
|
||||
|
||||
/* returns 0 on error */
|
||||
@@ -458,9 +458,9 @@ parse_sym_line(char *buf, int which_set)
|
||||
if (!bufp) {
|
||||
if (strncmpi(buf, "finish", 6) == 0) {
|
||||
/* end current graphics set */
|
||||
if (g.chosen_symset_start)
|
||||
g.chosen_symset_end = TRUE;
|
||||
g.chosen_symset_start = FALSE;
|
||||
if (gc.chosen_symset_start)
|
||||
gc.chosen_symset_end = TRUE;
|
||||
gc.chosen_symset_start = FALSE;
|
||||
return 1;
|
||||
}
|
||||
config_error_add("No \"finish\"");
|
||||
@@ -475,7 +475,7 @@ parse_sym_line(char *buf, int which_set)
|
||||
symp = match_sym(buf);
|
||||
if (!symp && buf[0] == 'G' && buf[1] == '_') {
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
if (g.chosen_symset_start) {
|
||||
if (gc.chosen_symset_start) {
|
||||
is_glyph = match_glyph(buf);
|
||||
} else {
|
||||
is_glyph = TRUE; /* report error only once */
|
||||
@@ -489,14 +489,14 @@ parse_sym_line(char *buf, int which_set)
|
||||
return 0;
|
||||
}
|
||||
if (symp) {
|
||||
if (!g.symset[which_set].name) {
|
||||
if (!gs.symset[which_set].name) {
|
||||
/* A null symset name indicates that we're just
|
||||
building a pick-list of possible symset
|
||||
values from the file, so only do that */
|
||||
if (symp->range == SYM_CONTROL) {
|
||||
struct symsetentry *tmpsp, *lastsp;
|
||||
|
||||
for (lastsp = g.symset_list; lastsp; lastsp = lastsp->next)
|
||||
for (lastsp = gs.symset_list; lastsp; lastsp = lastsp->next)
|
||||
if (!lastsp->next)
|
||||
break;
|
||||
switch (symp->idx) {
|
||||
@@ -504,10 +504,10 @@ parse_sym_line(char *buf, int which_set)
|
||||
tmpsp = (struct symsetentry *) alloc(sizeof *tmpsp);
|
||||
tmpsp->next = (struct symsetentry *) 0;
|
||||
if (!lastsp)
|
||||
g.symset_list = tmpsp;
|
||||
gs.symset_list = tmpsp;
|
||||
else
|
||||
lastsp->next = tmpsp;
|
||||
tmpsp->idx = g.symset_count++;
|
||||
tmpsp->idx = gs.symset_count++;
|
||||
tmpsp->name = dupstr(bufp);
|
||||
tmpsp->desc = (char *) 0;
|
||||
tmpsp->handling = H_UNK;
|
||||
@@ -556,9 +556,9 @@ parse_sym_line(char *buf, int which_set)
|
||||
switch (symp->idx) {
|
||||
case 0:
|
||||
/* start of symset */
|
||||
if (!strcmpi(bufp, g.symset[which_set].name)) {
|
||||
if (!strcmpi(bufp, gs.symset[which_set].name)) {
|
||||
/* matches desired one */
|
||||
g.chosen_symset_start = TRUE;
|
||||
gc.chosen_symset_start = TRUE;
|
||||
/* these init_*() functions clear symset fields too */
|
||||
if (which_set == ROGUESET)
|
||||
init_rogue_symbols();
|
||||
@@ -568,41 +568,41 @@ parse_sym_line(char *buf, int which_set)
|
||||
break;
|
||||
case 1:
|
||||
/* finish symset */
|
||||
if (g.chosen_symset_start)
|
||||
g.chosen_symset_end = TRUE;
|
||||
g.chosen_symset_start = FALSE;
|
||||
if (gc.chosen_symset_start)
|
||||
gc.chosen_symset_end = TRUE;
|
||||
gc.chosen_symset_start = FALSE;
|
||||
break;
|
||||
case 2:
|
||||
/* handler type identified */
|
||||
if (g.chosen_symset_start)
|
||||
if (gc.chosen_symset_start)
|
||||
set_symhandling(bufp, which_set);
|
||||
break;
|
||||
/* case 3: (description) is ignored here */
|
||||
case 4: /* color:off */
|
||||
if (g.chosen_symset_start) {
|
||||
if (gc.chosen_symset_start) {
|
||||
if (bufp) {
|
||||
if (!strcmpi(bufp, "true") || !strcmpi(bufp, "yes")
|
||||
|| !strcmpi(bufp, "on"))
|
||||
g.symset[which_set].nocolor = 0;
|
||||
gs.symset[which_set].nocolor = 0;
|
||||
else if (!strcmpi(bufp, "false")
|
||||
|| !strcmpi(bufp, "no")
|
||||
|| !strcmpi(bufp, "off"))
|
||||
g.symset[which_set].nocolor = 1;
|
||||
gs.symset[which_set].nocolor = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5: /* restrictions: xxxx*/
|
||||
if (g.chosen_symset_start) {
|
||||
if (gc.chosen_symset_start) {
|
||||
int n = 0;
|
||||
|
||||
while (known_restrictions[n]) {
|
||||
if (!strcmpi(known_restrictions[n], bufp)) {
|
||||
switch (n) {
|
||||
case 0:
|
||||
g.symset[which_set].primary = 1;
|
||||
gs.symset[which_set].primary = 1;
|
||||
break;
|
||||
case 1:
|
||||
g.symset[which_set].rogue = 1;
|
||||
gs.symset[which_set].rogue = 1;
|
||||
break;
|
||||
}
|
||||
break; /* while loop */
|
||||
@@ -614,9 +614,9 @@ parse_sym_line(char *buf, int which_set)
|
||||
}
|
||||
} else {
|
||||
/* Not SYM_CONTROL */
|
||||
if (g.symset[which_set].handling != H_UTF8) {
|
||||
if (gs.symset[which_set].handling != H_UTF8) {
|
||||
val = sym_val(bufp);
|
||||
if (g.chosen_symset_start) {
|
||||
if (gc.chosen_symset_start) {
|
||||
if (which_set == PRIMARYSET) {
|
||||
update_primary_symset(symp, val);
|
||||
} else if (which_set == ROGUESET) {
|
||||
@@ -625,7 +625,7 @@ parse_sym_line(char *buf, int which_set)
|
||||
}
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
} else {
|
||||
if (g.chosen_symset_start) {
|
||||
if (gc.chosen_symset_start) {
|
||||
glyphrep_to_custom_map_entries(buf, &glyph);
|
||||
}
|
||||
#endif
|
||||
@@ -643,10 +643,10 @@ set_symhandling(char *handling, int which_set)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
g.symset[which_set].handling = H_UNK;
|
||||
gs.symset[which_set].handling = H_UNK;
|
||||
while (known_handling[i]) {
|
||||
if (!strcmpi(known_handling[i], handling)) {
|
||||
g.symset[which_set].handling = i;
|
||||
gs.symset[which_set].handling = i;
|
||||
return;
|
||||
}
|
||||
i++;
|
||||
@@ -659,9 +659,9 @@ load_symset(const char *s, int which_set)
|
||||
{
|
||||
clear_symsetentry(which_set, TRUE);
|
||||
|
||||
if (g.symset[which_set].name)
|
||||
free((genericptr_t) g.symset[which_set].name);
|
||||
g.symset[which_set].name = dupstr(s);
|
||||
if (gs.symset[which_set].name)
|
||||
free((genericptr_t) gs.symset[which_set].name);
|
||||
gs.symset[which_set].name = dupstr(s);
|
||||
|
||||
if (read_sym_file(which_set)) {
|
||||
switch_symbols(TRUE);
|
||||
@@ -795,7 +795,7 @@ parsesymbols(register char *opts, int which_set)
|
||||
return FALSE;
|
||||
if (symp) {
|
||||
if (symp->range && symp->range != SYM_CONTROL) {
|
||||
if (g.symset[which_set].handling == H_UTF8
|
||||
if (gs.symset[which_set].handling == H_UTF8
|
||||
|| (lowc(strval[0]) == 'u' && strval[1] == '+')) {
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
char buf[BUFSZ];
|
||||
@@ -884,21 +884,21 @@ do_symset(boolean rogueflag)
|
||||
int clr = 0;
|
||||
|
||||
which_set = rogueflag ? ROGUESET : PRIMARYSET;
|
||||
g.symset_list = (struct symsetentry *) 0;
|
||||
gs.symset_list = (struct symsetentry *) 0;
|
||||
/* clear symset[].name as a flag to read_sym_file() to build list */
|
||||
symset_name = g.symset[which_set].name;
|
||||
g.symset[which_set].name = (char *) 0;
|
||||
symset_name = gs.symset[which_set].name;
|
||||
gs.symset[which_set].name = (char *) 0;
|
||||
|
||||
res = read_sym_file(which_set);
|
||||
/* put symset name back */
|
||||
g.symset[which_set].name = symset_name;
|
||||
gs.symset[which_set].name = symset_name;
|
||||
|
||||
if (res && g.symset_list) {
|
||||
if (res && gs.symset_list) {
|
||||
int thissize,
|
||||
biggest = (int) (sizeof "Default Symbols" - sizeof ""),
|
||||
big_desc = 0;
|
||||
|
||||
for (sl = g.symset_list; sl; sl = sl->next) {
|
||||
for (sl = gs.symset_list; sl; sl = sl->next) {
|
||||
/* check restrictions */
|
||||
if (rogueflag ? sl->primary : sl->rogue)
|
||||
continue;
|
||||
@@ -937,7 +937,7 @@ do_symset(boolean rogueflag)
|
||||
(any.a_int == defindx) ? MENU_ITEMFLAGS_SELECTED
|
||||
: MENU_ITEMFLAGS_NONE);
|
||||
|
||||
for (sl = g.symset_list; sl; sl = sl->next) {
|
||||
for (sl = gs.symset_list; sl; sl = sl->next) {
|
||||
/* check restrictions */
|
||||
if (rogueflag ? sl->primary : sl->rogue)
|
||||
continue;
|
||||
@@ -983,7 +983,7 @@ do_symset(boolean rogueflag)
|
||||
|
||||
if (chosen > -1) {
|
||||
/* chose an actual symset name from file */
|
||||
for (sl = g.symset_list; sl; sl = sl->next)
|
||||
for (sl = gs.symset_list; sl; sl = sl->next)
|
||||
if (sl->idx == chosen)
|
||||
break;
|
||||
if (sl) {
|
||||
@@ -991,7 +991,7 @@ do_symset(boolean rogueflag)
|
||||
clear_symsetentry(which_set, TRUE);
|
||||
|
||||
/* transfer only the name of the symbol set */
|
||||
g.symset[which_set].name = dupstr(sl->name);
|
||||
gs.symset[which_set].name = dupstr(sl->name);
|
||||
ready_to_switch = TRUE;
|
||||
}
|
||||
} else if (chosen == -1) {
|
||||
@@ -1004,15 +1004,15 @@ do_symset(boolean rogueflag)
|
||||
/* The symbols file could not be accessed */
|
||||
pline("Unable to access \"%s\" file.", SYMBOLS);
|
||||
return TRUE;
|
||||
} else if (!g.symset_list) {
|
||||
} else if (!gs.symset_list) {
|
||||
/* The symbols file was empty */
|
||||
pline("There were no symbol sets found in \"%s\".", SYMBOLS);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* clean up */
|
||||
while ((sl = g.symset_list) != 0) {
|
||||
g.symset_list = sl->next;
|
||||
while ((sl = gs.symset_list) != 0) {
|
||||
gs.symset_list = sl->next;
|
||||
if (sl->name)
|
||||
free((genericptr_t) sl->name), sl->name = (char *) 0;
|
||||
if (sl->desc)
|
||||
@@ -1029,7 +1029,7 @@ do_symset(boolean rogueflag)
|
||||
else
|
||||
init_primary_symbols();
|
||||
|
||||
if (g.symset[which_set].name) {
|
||||
if (gs.symset[which_set].name) {
|
||||
/* non-default symbols */
|
||||
if (read_sym_file(which_set)) {
|
||||
ready_to_switch = TRUE;
|
||||
@@ -1073,18 +1073,18 @@ static void shuffle_customizations(void);
|
||||
void
|
||||
apply_customizations_to_symset(enum graphics_sets which_set)
|
||||
{
|
||||
glyph_map *gm;
|
||||
glyph_map *gmap;
|
||||
struct customization_detail *details;
|
||||
|
||||
if (g.symset[which_set].handling == H_UTF8
|
||||
&& g.sym_customizations[which_set].count
|
||||
&& g.sym_customizations[which_set].details) {
|
||||
if (gs.symset[which_set].handling == H_UTF8
|
||||
&& gs.sym_customizations[which_set].count
|
||||
&& gs.sym_customizations[which_set].details) {
|
||||
/* These UTF-8 customizations get applied to the glyphmap array,
|
||||
not to symset entries */
|
||||
details = g.sym_customizations[which_set].details;
|
||||
details = gs.sym_customizations[which_set].details;
|
||||
while (details) {
|
||||
gm = &glyphmap[details->content.urep.glyphidx];
|
||||
(void) set_map_u(gm,
|
||||
gmap = &glyphmap[details->content.urep.glyphidx];
|
||||
(void) set_map_u(gmap,
|
||||
details->content.urep.u.utf32ch,
|
||||
details->content.urep.u.utf8str,
|
||||
details->content.urep.u.ucolor);
|
||||
@@ -1155,7 +1155,7 @@ find_matching_symset_customization(
|
||||
int custtype,
|
||||
enum graphics_sets which_set)
|
||||
{
|
||||
struct symset_customization *gdc = &g.sym_customizations[which_set];
|
||||
struct symset_customization *gdc = &gs.sym_customizations[which_set];
|
||||
if ((gdc->custtype == custtype)
|
||||
&& (strcmp(customization_name, gdc->customization_name) != 0))
|
||||
return gdc->details;
|
||||
@@ -1165,7 +1165,7 @@ find_matching_symset_customization(
|
||||
static void
|
||||
purge_custom_entries(enum graphics_sets which_set)
|
||||
{
|
||||
struct symset_customization *gdc = &g.sym_customizations[which_set];
|
||||
struct symset_customization *gdc = &gs.sym_customizations[which_set];
|
||||
struct customization_detail *details = gdc->details, *next;
|
||||
|
||||
while (details) {
|
||||
@@ -1197,7 +1197,7 @@ find_display_sym_customization(
|
||||
const struct symparse *symparse,
|
||||
enum graphics_sets which_set)
|
||||
{
|
||||
struct symset_customization *gdc = &g.sym_customizations[which_set];
|
||||
struct symset_customization *gdc = &gs.sym_customizations[which_set];
|
||||
struct customization_detail *symdetails;
|
||||
|
||||
if ((gdc->custtype == custom_symbols)
|
||||
|
||||
Reference in New Issue
Block a user