finish
start: RogueEpyx
+ Description: Rogue level color symbol set like Epyx Rogue
Handling: IBM
+ Color: Yes
S_weapon: \x18 # up arrow
S_armor: \x0a # Vert rect with o
S_ring: \x09 # circle with arrow
E void NDECL(init_symbols);
E void NDECL(init_disp_symbols);
E void NDECL(init_l_symbols);
+E void FDECL(clear_symsetentry, (int,BOOLEAN_P));
#ifdef ASCIIGRAPH
E void FDECL(update_l_symset, (struct symparse *,int));
E void FDECL(update_r_symset, (struct symparse *,int));
const char *name;
};
-/* general linked list of text pointers */
-struct textlist {
- char *text; /* the text */
- int idx; /* an index value */
- struct textlist *next; /* next in list */
+/* linked list of symsets and their characteristics */
+struct symsetentry {
+ struct symsetentry *next; /* next in list */
+ char *name; /* ptr to symset name */
+ char *desc; /* ptr to description */
+ int idx; /* an index value */
+ int handling; /* known handlers value */
+ Bitfield(nocolor,1); /* don't use color if set */
+ /* 7 free bits */
};
/*
extern const struct symdef defsyms[MAXPCHARS]; /* defaults */
extern uchar showsyms[MAXPCHARS];
extern const struct symdef def_warnsyms[WARNCOUNT];
-extern char *symset[NUM_GRAPHICS]; /* from drawing.c */
-extern int symhandling[NUM_GRAPHICS], currentgraphics; /* from drawing.c */
+extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */
+extern int currentgraphics; /* from drawing.c */
-#define SYMHANDLING(ht) (symhandling[currentgraphics] == (ht))
+#define SYMHANDLING(ht) (symset[currentgraphics].handling == (ht))
/*
* The 5 possible states of doors
#define C(n)
#endif
-char *symset[NUM_GRAPHICS] = {0,0};
-int symhandling[NUM_GRAPHICS] = {0,0}, currentgraphics = 0;
+struct symsetentry symset[NUM_GRAPHICS];
+int currentgraphics = 0;
uchar oc_syms[MAXOCLASSES] = DUMMY; /* the current object display symbols */
uchar showsyms[MAXPCHARS] = DUMMY; /* the current feature display symbols */
if (SYMHANDLING(H_IBM)
&& ibmgraphics_mode_callback)
(*ibmgraphics_mode_callback)();
- else if (!symset[currentgraphics] && ascgraphics_mode_callback)
+ else if (!symset[currentgraphics].name && ascgraphics_mode_callback)
(*ascgraphics_mode_callback)();
# endif
# ifdef TERMLIB
for (i = 0; i < MAXOCLASSES; i++)
l_oc_syms[i] = def_oc_syms[i].sym;
- symhandling[PRIMARY] = H_UNK;
+ clear_symsetentry(PRIMARY, FALSE);
}
void
assign_graphics(whichset)
int whichset;
{
- /* Adjust graphics display characters on Rogue levels */
register int i;
switch(whichset) {
# ifdef REINCARNATION
case ROGUESET:
+ /* Adjust graphics display characters on Rogue levels */
for (i = 0; i < MAXMCLASSES; i++)
monsyms[i] = r_monsyms[i];
for (i = 0; i < MAXOCLASSES; i++)
r_oc_syms[i] = def_r_oc_syms[i];
- symhandling[ROGUESET] = H_UNK;
+ clear_symsetentry(ROGUESET, FALSE);
+ symset[ROGUESET].nocolor = 1; /* default on Rogue level is no color
+ * but some symbol sets can
+ * override that
+ */
}
void
}
}
+void
+clear_symsetentry(which_set, name_too)
+int which_set;
+boolean name_too;
+{
+ if (symset[which_set].desc)
+ free((genericptr_t)symset[which_set].desc);
+ symset[which_set].desc = (char *)0;
+
+ symset[which_set].nocolor = 0;
+ symset[which_set].handling = H_UNK;
+
+ if (name_too) {
+ if (symset[which_set].name)
+ free((genericptr_t *)symset[which_set].name);
+ symset[which_set].name = (char *)0;
+ }
+}
+
/*
* If you are adding code somewhere to be able to recognize
* particular types of symset "handling", define a
{SYM_CONTROL, 0, "begin"},
{SYM_CONTROL, 1, "finish"},
{SYM_CONTROL, 2, "handling"},
+ {SYM_CONTROL, 3, "description"},
+ {SYM_CONTROL, 4, "color"},
+ {SYM_CONTROL, 4, "colour"},
{SYM_PCHAR, S_stone, "S_stone"},
{SYM_PCHAR, S_vwall, "S_vwall"},
{SYM_PCHAR, S_hwall, "S_hwall"},
#endif /*WIZARD*/
#ifdef ASCIIGRAPH
-extern struct textlist *symset_list; /* options.c */
+extern struct symsetentry *symset_list; /* options.c */
extern struct symparse loadsyms[]; /* drawing.c */
extern const char *known_handling[]; /* drawing.c */
static int symset_count = 0; /* for pick-list building only */
}
(void) fclose(fp);
if (!chosen_symset_end && !chosen_symset_start)
- return (symset[which_set] == 0) ? 1 : 0;
+ return (symset[which_set].name == 0) ? 1 : 0;
if (!chosen_symset_end) {
raw_printf("Missing finish for symset \"%s\"",
- symset[which_set] ? symset[which_set] : "unknown");
+ symset[which_set].name ?
+ symset[which_set].name : "unknown");
wait_synch();
}
return 1;
if (!symp)
return 0;
- if (!symset[which_set]) {
+ if (!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 && symp->idx == 0) {
- struct textlist *tmpsp;
- tmpsp = (struct textlist *)alloc(sizeof(struct textlist));
- tmpsp->next = (struct textlist *)0;
- if (!symset_list) {
+ if (symp->range == SYM_CONTROL) {
+ struct symsetentry *tmpsp;
+ switch (symp->idx) {
+ case 0:
+ tmpsp = (struct symsetentry *)alloc(sizeof(struct symsetentry));
+ tmpsp->next = (struct symsetentry *)0;
+ if (!symset_list) {
symset_list = tmpsp;
symset_count = 0;
- } else {
+ } else {
symset_count++;
tmpsp->next = symset_list;
symset_list = tmpsp;
- }
- tmpsp->idx = symset_count;
- tmpsp->text = (char *)alloc(strlen(bufp)+1);
- Strcpy(tmpsp->text, bufp);
+ }
+ tmpsp->idx = symset_count;
+ tmpsp->name = (char *)alloc(strlen(bufp)+1);
+ Strcpy(tmpsp->name, bufp);
+ tmpsp->desc = (char *)0;
+ tmpsp->nocolor = 0;
+ break;
+ case 3: /* description:something */
+ tmpsp = symset_list; /* most recent symset */
+ if (tmpsp && !tmpsp->desc) {
+ tmpsp->desc = (char *)alloc(strlen(bufp)+1);
+ Strcpy(tmpsp->desc, bufp);
+ }
+ break;
+ }
}
return 1;
}
switch(symp->idx) {
case 0:
/* start of symset */
- if (!strcmpi(bufp, symset[which_set])) { /* desired one? */
+ if (!strcmpi(bufp, symset[which_set].name)) {
+ /* matches desired one */
chosen_symset_start = TRUE;
#ifdef REINCARNATION
if (which_set == ROGUESET) init_r_symbols();
if (chosen_symset_start)
set_symhandling(bufp, which_set);
break;
+ /* case 3: (description) is ignored here */
+ case 4: /* color:off */
+ if (chosen_symset_start) {
+ if (bufp) {
+ if (!strcmpi(bufp, "true") ||
+ !strcmpi(bufp, "yes") ||
+ !strcmpi(bufp, "on"))
+ symset[which_set].nocolor = 0;
+ else if (!strcmpi(bufp, "false") ||
+ !strcmpi(bufp, "no") ||
+ !strcmpi(bufp, "off"))
+ symset[which_set].nocolor = 1;
+ }
+ }
+ break;
}
} else { /* !SYM_CONTROL */
val = sym_val(bufp);
{
int i = 0;
- symhandling[which_set] = H_UNK;
+ symset[which_set].handling = H_UNK;
while (known_handling[i]) {
if (!strcmpi(known_handling[i], handling)) {
- symhandling[which_set] = i;
+ symset[which_set].handling = i;
return;
}
i++;
#define explode_color(n)
#endif
-#ifdef ROGUE_COLOR
# if defined(USE_TILES) && defined(MSDOS)
#define HAS_ROGUE_IBM_GRAPHICS (currentgraphics == ROGUESET && \
SYMHANDLING(H_IBM) && !iflags.grmode)
#define HAS_ROGUE_IBM_GRAPHICS (currentgraphics == ROGUESET && \
SYMHANDLING(H_IBM))
# endif
-#endif
/*ARGSUSED*/
void
#endif
uchar ch;
unsigned special = 0;
-#ifdef ROGUE_COLOR
/* condense multiple tests in macro version down to single */
boolean has_rogue_ibm_graphics = HAS_ROGUE_IBM_GRAPHICS;
+#ifdef ROGUE_COLOR
+ boolean has_rogue_color = (has_rogue_ibm_graphics &&
+ (symset[currentgraphics].nocolor == 0));
#endif
/*
if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */
ch = warnsyms[offset];
# ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics)
+ if (has_rogue_color)
color = NO_COLOR;
else
# endif
/* see swallow_to_glyph() in display.c */
ch = (uchar) showsyms[S_sw_tl + (offset & 0x7)];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics && iflags.use_color)
+ if (has_rogue_color && iflags.use_color)
color = NO_COLOR;
else
#endif
/* see zapdir_to_glyph() in display.c */
ch = showsyms[S_vbeam + (offset & 0x3)];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics && iflags.use_color)
+ if (has_rogue_color && iflags.use_color)
color = NO_COLOR;
else
#endif
} else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */
ch = showsyms[offset];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics && iflags.use_color) {
+ if (has_rogue_color && iflags.use_color) {
if (offset >= S_vwall && offset <= S_hcdoor)
color = CLR_BROWN;
else if (offset >= S_arrow_trap && offset <= S_polymorph_trap)
if (offset == BOULDER && iflags.bouldersym) ch = iflags.bouldersym;
else ch = oc_syms[(int)objects[offset].oc_class];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics && iflags.use_color) {
+ if (has_rogue_color && iflags.use_color) {
switch(objects[offset].oc_class) {
case COIN_CLASS: color = CLR_YELLOW; break;
case FOOD_CLASS: color = CLR_RED; break;
} else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */
ch = monsyms[(int)mons[offset].mlet];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics)
+ if (has_rogue_color)
/* This currently implies that the hero is here -- monsters */
/* don't ride (yet...). Should we set it to yellow like in */
/* the monster case below? There is no equivalent in rogue. */
} else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */
ch = oc_syms[(int)objects[CORPSE].oc_class];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics && iflags.use_color)
+ if (has_rogue_color && iflags.use_color)
color = CLR_RED;
else
#endif
} else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */
ch = monsyms[(int)mons[offset].mlet];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics)
+ if (has_rogue_color)
color = NO_COLOR; /* no need to check iflags.use_color */
else
#endif
} else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */
ch = DEF_INVISIBLE;
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics)
+ if (has_rogue_color)
color = NO_COLOR; /* no need to check iflags.use_color */
else
#endif
} else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */
ch = monsyms[(int)mons[offset].mlet];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics)
+ if (has_rogue_color)
color = NO_COLOR; /* no need to check iflags.use_color */
else
#endif
} else { /* a monster */
ch = monsyms[(int)mons[glyph].mlet];
#ifdef ROGUE_COLOR
- if (has_rogue_ibm_graphics && iflags.use_color) {
+ if (has_rogue_color && iflags.use_color) {
if (x == u.ux && y == u.uy)
/* actually player should be yellow-on-gray if in a corridor */
color = CLR_YELLOW;
/* Turn off color if no color defined, or rogue level w/o PC graphics. */
# ifdef REINCARNATION
# ifdef ROGUE_COLOR
- if (!has_color(color) || (Is_rogue_level(&u.uz) && !has_rogue_ibm_graphics))
+ if (!has_color(color) || (Is_rogue_level(&u.uz) && !has_rogue_color))
# else
if (!has_color(color) || Is_rogue_level(&u.uz))
# endif
/* this detects the IBM-compatible console on most 386 boxes */
if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) {
#ifdef ASCIIGRAPH
- if (!symset[PRIMARY]) load_symset("IBMGraphics", PRIMARY);
+ if (!symset[PRIMARY].name) load_symset("IBMGraphics", PRIMARY);
- if (!symset[ROGUESET]) load_symset("RogueIBM", ROGUESET);
+ if (!symset[ROGUESET].name) load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
#endif
!strncmpi(opts, "vt", 2) && AS && AE &&
index(AS, '\016') && index(AE, '\017')) {
# ifdef ASCIIGRAPH
- if (!symset[PRIMARY]) load_symset("DECGraphics", PRIMARY);
-
-
-
+ if (!symset[PRIMARY].name) load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
# endif /*ASCIIGRAPH*/
}
#endif /* UNIX || VMS */
#ifdef MAC_GRAPHICS_ENV
- if (!symset[PRIMARY]) load_symset("MACGraphics", PRIMARY);
+ if (!symset[PRIMARY].name) load_symset("MACGraphics", PRIMARY);
switch_symbols(TRUE);
#endif /* MAC_GRAPHICS_ENV */
flags.menu_style = MENU_FULL;
if (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) {
- symset[ROGUESET] = (char *)alloc(strlen(op) + 1);
- Strcpy(symset[ROGUESET], op);
+ symset[ROGUESET].name = (char *)alloc(strlen(op) + 1);
+ Strcpy(symset[ROGUESET].name, op);
if (!read_sym_file(ROGUESET)) {
- free((char *)symset[ROGUESET]);
- symset[ROGUESET] = (char *)0;
+ clear_symsetentry(ROGUESET, TRUE);
raw_printf("Unable to load symbol set \"%s\" from \"%s\".",
op, SYMBOLS);
wait_synch();
if (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) {
- symset[PRIMARY] = (char *)alloc(strlen(op) + 1);
- Strcpy(symset[PRIMARY], op);
+ symset[PRIMARY].name = (char *)alloc(strlen(op) + 1);
+ Strcpy(symset[PRIMARY].name, op);
if (!read_sym_file(PRIMARY)) {
- free((char *)symset[PRIMARY]);
- symset[PRIMARY] = (char *)0;
+ clear_symsetentry(PRIMARY, TRUE);
raw_printf("Unable to load symbol set \"%s\" from \"%s\".",
op, SYMBOLS);
wait_synch();
if (duplicate) complain_about_duplicate(opts,1);
if (!negated) {
/* There is no rogue level DECgraphics-specific set */
- if (symset[PRIMARY])
+ if (symset[PRIMARY].name)
badflag = TRUE;
else {
- symset[PRIMARY] = (char *)alloc(strlen(fullname) + 1);
- Strcpy(symset[PRIMARY], fullname);
+ symset[PRIMARY].name = (char *)alloc(strlen(fullname) + 1);
+ Strcpy(symset[PRIMARY].name, fullname);
if (!read_sym_file(PRIMARY)) {
badflag = TRUE;
- free((char *)symset[PRIMARY]);
- symset[PRIMARY] = (char *)0;
+ clear_symsetentry(PRIMARY, TRUE);
} else switch_symbols(TRUE);
}
if (badflag) {
if (duplicate) complain_about_duplicate(opts,1);
if (!negated) {
for (i = 0; i < NUM_GRAPHICS; ++i) {
- if (symset[i])
+ if (symset[i].name)
badflag = TRUE;
else {
if (i == ROGUESET) sym_name = "RogueIBM";
- symset[i] = (char *)alloc(strlen(sym_name) + 1);
- Strcpy(symset[i], sym_name);
+ symset[i].name = (char *)alloc(strlen(sym_name) + 1);
+ Strcpy(symset[i].name, sym_name);
if (!read_sym_file(i)) {
badflag = TRUE;
- free((char *)symset[i]);
- symset[i] = (char *)0;
+ clear_symsetentry(i, TRUE);
break;
}
}
boolean badflag = FALSE;
if (duplicate) complain_about_duplicate(opts,1);
if (!negated) {
- if (symset[PRIMARY]) badflag = TRUE;
+ if (symset[PRIMARY]).name badflag = TRUE;
else {
- symset[PRIMARY] = (char *)alloc(strlen(fullname) + 1);
- Strcpy(symset[PRIMARY], fullname);
+ symset[PRIMARY].name = (char *)alloc(strlen(fullname) + 1);
+ Strcpy(symset[PRIMARY].name, fullname);
if (!read_sym_file(PRIMARY)) {
badflag = TRUE;
- free((char *)symset[PRIMARY]);
- symset[PRIMARY] = (char *)0;
+ clear_symsetentry(PRIMARY, TRUE);
}
}
if (badflag) {
badoption(opts);
}
-
static NEARDATA const char *menutype[] = {
"traditional", "combination", "partial", "full"
};
return 0;
}
-struct textlist *symset_list = 0; /* files.c will populate this with
+struct symsetentry *symset_list = 0; /* files.c will populate this with
list of available sets */
STATIC_OVL boolean
!strcmp("roguesymset", optname)) {
menu_item *symset_pick = (menu_item *)0;
boolean rogueflag = (*optname == 'r');
- char *symset_name;
+ struct symsetentry *sl;
+ char *symset_name, fmtstr[20];
int chosen = -2, res, which_set =
#ifdef REINCARNATION
rogueflag ? ROGUESET :
if (rogueflag) return TRUE;
#endif
#ifdef ASCIIGRAPH
- /* clear symset as a flag to read_sym_file() to build list */
- symset_name = symset[which_set];
- symset[which_set] = (char *)0;
+ /* clear symset[].name as a flag to read_sym_file() to build list */
+ symset_name = symset[which_set].name;
+ symset[which_set].name = (char *)0;
+ symset_list = (struct symsetentry *)0;
res = read_sym_file(which_set);
if (res && symset_list) {
- int let = 'a';
- struct textlist *sl;
+ char symsetchoice[BUFSZ];
+ int let = 'a', biggest = 0, thissize = 0;
tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin);
any.a_int = 1;
ATR_NONE, "Default Symbols", MENU_UNSELECTED);
sl = symset_list;
while (sl) {
- if (sl->text) {
+ /* find biggest name */
+ if (sl->name) thissize = strlen(sl->name);
+ if (thissize > biggest) biggest = thissize;
+ sl = sl->next;
+ }
+ Sprintf(fmtstr,"%%-%ds %%s", biggest + 5);
+
+ sl = symset_list;
+ while (sl) {
+ if (sl->name) {
any.a_int = sl->idx + 2;
+ Sprintf(symsetchoice, fmtstr, sl->name,
+ sl->desc ? sl->desc : "");
add_menu(tmpwin, NO_GLYPH, &any, let, 0,
- ATR_NONE, sl->text, MENU_UNSELECTED);
+ ATR_NONE, symsetchoice, MENU_UNSELECTED);
sl = sl->next;
if (let == 'z') let = 'A';
else let++;
free((genericptr_t)symset_pick);
}
destroy_nhwindow(tmpwin);
+
if (chosen > -1) {
- /* chose an actual symset name from file */
- sl = symset_list;
- while (sl) {
- if (sl->idx == chosen) {
- if (symset_name) {
+ /* chose an actual symset name from file */
+ sl = symset_list;
+ while (sl) {
+ if (sl->idx == chosen) {
+ if (symset_name) {
free((genericptr_t)symset_name);
symset_name = (char *)0;
- }
- symset[which_set] = (char *)alloc(strlen(sl->text)+1);
- Strcpy(symset[which_set], sl->text);
}
- sl = sl->next;
+ /* free the now stale attributes */
+ clear_symsetentry(which_set, TRUE);
+
+ /* transfer only the name of the symbol set */
+ symset[which_set].name =
+ (char *)alloc(strlen(sl->name)+1);
+ Strcpy(symset[which_set].name, sl->name);
+
+ break;
}
- } else if (chosen == -1) {
+ sl = sl->next;
+ }
+ }
+
+ else if (chosen == -1) {
/* explicit selection of defaults */
+ /* free the now stale symset attributes */
if (symset_name) free ((genericptr_t)symset_name);
symset_name = (char *)0;
+ clear_symsetentry(which_set, TRUE);
}
- /* clean up */
- while (symset_list) {
- sl = symset_list;
- if (sl->text) free((genericptr_t)sl->text);
- symset_list = sl->next;
- }
- symset_list = (struct textlist *)0;
} else if (!res) {
/* The symbols file could not be accessed */
pline("Unable to access \"%s\" file.", SYMBOLS);
SYMBOLS);
return TRUE;
}
- /* these set default symbols and clear the handling value */
+
+ /* clean up */
+ while (symset_list) {
+ sl = symset_list;
+ if (sl->name) free((genericptr_t)sl->name);
+ sl->name = (char *)0;
+
+ if (sl->desc) free((genericptr_t)sl->desc);
+ sl->desc = (char *)0;
+
+ symset_list = sl->next;
+ free((genericptr_t)sl);
+ }
+
+ /* Set default symbols and clear the handling value */
# ifdef REINCARNATION
if(rogueflag) init_r_symbols();
else
# endif
init_l_symbols();
- if (!symset[which_set] && symset_name)
- symset[which_set] = symset_name;
+ if (!symset[which_set].name && symset_name)
+ symset[which_set].name = symset_name;
- if (symset[which_set]) {
+ if (symset[which_set].name) {
if (read_sym_file(which_set))
switch_symbols(TRUE);
else {
- free((genericptr_t)symset[which_set]);
- symset[which_set] = (char *)0;
+ clear_symsetentry(which_set, TRUE);
return TRUE;
}
}
-
+
switch_symbols(TRUE);
# ifdef REINCARNATION
if (Is_rogue_level(&u.uz))
assign_graphics(ROGUESET);
else
-#endif
+# endif
assign_graphics(PRIMARY);
need_redraw = TRUE;
#endif /*ASCIIGRAPH*/
#ifdef REINCARNATION
else if (!strcmp(optname, "roguesymset"))
Sprintf(buf, "%s",
- symset[ROGUESET] ? symset[ROGUESET] : "default");
+ symset[ROGUESET].name ?
+ symset[ROGUESET].name : "default");
#endif
else if (!strcmp(optname, "role"))
Sprintf(buf, "%s", rolestring(flags.initrole, roles, name.m));
}
else if (!strcmp(optname, "symset"))
Sprintf(buf, "%s",
- symset[PRIMARY] ? symset[PRIMARY] : "default");
+ symset[PRIMARY].name ?
+ symset[PRIMARY].name : "default");
else if (!strcmp(optname, "tile_file"))
Sprintf(buf, "%s", iflags.wc_tile_file ? iflags.wc_tile_file : defopt);
else if (!strcmp(optname, "tile_height")) {
const char *s;
int which_set;
{
- if (symset[which_set]) free((genericptr_t)symset[which_set]);
- symset[which_set] = (char *)alloc(strlen(s)+1);
- Strcpy(symset[which_set],s);
+ clear_symsetentry(which_set, TRUE);
+
+ symset[which_set].name = (char *)alloc(strlen(s)+1);
+ Strcpy(symset[which_set].name,s);
if (read_sym_file(which_set))
switch_symbols(TRUE);
else {
- free((genericptr_t)symset[which_set]);
- symset[which_set] = (char *)0;
+ clear_symsetentry(which_set, TRUE);
return 0;
}
return 1;
#if defined(MSDOS) || defined(WIN32)
/* Player didn't specify any symbol set so use IBM defaults */
- if (!symset[PRIMARY]) {
+ if (!symset[PRIMARY].name) {
load_symset("IBMGraphics_2", PRIMARY);
}
# ifdef REINCARNATION
- if (!symset[ROGUESET]) {
+ if (!symset[ROGUESET].name) {
load_symset("RogueEpyx", ROGUESET);
}
# endif