There are some bugs here, but this functionality should make it into the release
in some form.
*/
/* display features */
-#define LOADSYMSETS /* loadable symbol sets; only default symbols w/o this */
/* dungeon features */
/* dungeon levels */
#define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */
E void NDECL(init_symbols);
E void NDECL(init_showsyms);
E void NDECL(init_l_symbols);
-#ifdef LOADSYMSETS
E void FDECL(clear_symsetentry, (int,BOOLEAN_P));
E void FDECL(update_l_symset, (struct symparse *,int));
E void FDECL(update_r_symset, (struct symparse *,int));
-#endif
E boolean FDECL(cursed_object_at, (int, int));
/* ### dungeon.c ### */
E boolean FDECL(read_config_file, (const char *, int));
E void FDECL(check_recordfile, (const char *));
E void NDECL(read_wizkit);
-#ifdef LOADSYMSETS
E int FDECL(read_sym_file, (int));
E int FDECL(parse_sym_line, (char *,int));
E int FDECL(sym_val, (const char *));
-#endif
E void FDECL(paniclog, (const char *, const char *));
E int FDECL(validate_prefix_locations, (char *));
#ifdef SELECTSAVED
E void FDECL(set_option_mod_status, (const char *,int));
E int FDECL(add_autopickup_exception, (const char *));
E void NDECL(free_autopickup_exceptions);
-#ifdef LOADSYMSETS
E int FDECL(load_symset, (const char *,int));
E void FDECL(parsesymbols, (char *));
E struct symparse *FDECL(match_sym, (char *));
-#endif
E void NDECL(set_playmode);
/* ### pager.c ### */
extern int currentgraphics; /* from drawing.c */
extern nhsym showsyms[];
-#ifdef LOADSYMSETS
extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */
#define SYMHANDLING(ht) (symset[currentgraphics].handling == (ht))
-#else
-#define SYMHANDLING(ht) ((ht) == H_UNK)
-#endif
/*
* The 5 possible states of doors
#define C(n)
#endif
-#ifdef LOADSYMSETS
struct symsetentry symset[NUM_GRAPHICS];
-#endif
int currentgraphics = 0;
l_syms[i + SYM_OFF_X] = DEF_INVISIBLE;
}
-#ifdef LOADSYMSETS
clear_symsetentry(PRIMARY, FALSE);
-#endif
}
void
r_syms[i + SYM_OFF_X] = DEF_INVISIBLE;
}
-# ifdef LOADSYMSETS
clear_symsetentry(ROGUESET, FALSE);
symset[ROGUESET].nocolor = 1; /* default on Rogue level is no color
* but some symbol sets can
* override that
*/
-# endif
}
void
init_symbols();
}
-#ifdef LOADSYMSETS
void
update_l_symset(symp, val)
struct symparse *symp;
{SYM_OTH, SYM_INVISIBLE + SYM_OFF_X, "S_invisible"},
{0,0,(const char *)0} /* fence post */
};
-#endif /*LOADSYMSETS*/
/*drawing.c*/
STATIC_DCL int FDECL(get_uchars,
(FILE *,char *,char *,uchar *,BOOLEAN_P,int,const char *));
int FDECL(parse_config_line, (FILE *,char *,int));
-#ifdef LOADSYMSETS
STATIC_DCL FILE *NDECL(fopen_sym_file);
STATIC_DCL void FDECL(set_symhandling, (char *,int));
-#endif
#ifdef NOCWD_ASSUMPTIONS
STATIC_DCL void FDECL(adjust_prefix, (char *, int));
#endif
WARNCOUNT, "WARNINGS");
assign_warnings(translate);
} else if (match_varname(buf, "SYMBOLS", 4)) {
- /* This part is not ifdef LOADSYMSETS because we want to be able
- * to silently ignore its presence in a config file if that is
- * not defined.
- */
char *op, symbuf[BUFSZ];
boolean morelines;
do {
/* strip trailing space now that '\' is gone */
while (--op >= bufp && isspace(*op)) *op = '\0';
}
-#ifdef LOADSYMSETS
/* parse here */
parsesymbols(bufp);
-#endif
if (morelines)
do {
*symbuf = '\0';
bufp = symbuf;
} while (*bufp == '#');
} while (morelines);
-#ifdef LOADSYMSETS
switch_symbols(TRUE);
-#endif
} else if (match_varname(buf, "WIZKIT", 6)) {
(void) strncpy(wizkit, bufp, WIZKIT_MAX-1);
#ifdef AMIGA
return;
}
-#ifdef LOADSYMSETS
extern struct symsetentry *symset_list; /* options.c */
extern struct symparse loadsyms[]; /* drawing.c */
extern const char *known_handling[]; /* drawing.c */
}
return cval;
}
-#endif /*LOADSYMSETS*/
/* ---------- END CONFIG FILE HANDLING ----------- */
#define pet_color(n) color = iflags.use_color ? mons[n].mcolor : NO_COLOR
#define warn_color(n) color = iflags.use_color ? def_warnsyms[n].color : NO_COLOR
#define explode_color(n) color = iflags.use_color ? explcolors[n] : NO_COLOR
-#ifdef LOADSYMSETS
-# define ROGUE_COLOR
-#endif
#else /* no text color */
unsigned *ospecial;
{
register int offset, idx;
-#if defined(TEXTCOLOR) || defined(ROGUE_COLOR)
int color = NO_COLOR;
-#endif
nhsym ch;
unsigned special = 0;
/* 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
/*
* Map the glyph back to a character and color.
*/
if ((offset = (glyph - GLYPH_STATUE_OFF)) >= 0) { /* a statue */
idx = mons[offset].mlet + SYM_OFF_M;
-# ifdef ROGUE_COLOR
if (has_rogue_color)
color = CLR_RED;
else
-# endif
obj_color(STATUE);
special |= MG_STATUE;
} else if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */
idx = offset + SYM_OFF_W;
-# ifdef ROGUE_COLOR
if (has_rogue_color)
color = NO_COLOR;
else
-# endif
warn_color(offset);
} else if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) { /* swallow */
/* see swallow_to_glyph() in display.c */
idx = (S_sw_tl + (offset & 0x7)) + SYM_OFF_P;
-#ifdef ROGUE_COLOR
if (has_rogue_color && iflags.use_color)
color = NO_COLOR;
else
-#endif
mon_color(offset >> 3);
} else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) { /* zap beam */
/* see zapdir_to_glyph() in display.c */
idx = (S_vbeam + (offset & 0x3)) + SYM_OFF_P;
-#ifdef ROGUE_COLOR
if (has_rogue_color && iflags.use_color)
color = NO_COLOR;
else
-#endif
zap_color((offset >> 2));
} else if ((offset = (glyph - GLYPH_EXPLODE_OFF)) >= 0) { /* explosion */
idx = ((offset % MAXEXPCHARS) + S_explode1) + SYM_OFF_P;
explode_color(offset / MAXEXPCHARS);
} else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) { /* cmap */
idx = offset + SYM_OFF_P;
-#ifdef ROGUE_COLOR
if (has_rogue_color && iflags.use_color) {
if (offset >= S_vwall && offset <= S_hcdoor)
color = CLR_BROWN;
else
color = NO_COLOR;
} else
-#endif
#ifdef TEXTCOLOR
/* provide a visible difference if normal and lit corridor
* use the same symbol */
idx = objects[offset].oc_class + SYM_OFF_O;
if (offset == BOULDER && iflags.bouldersym)
idx = SYM_BOULDER + SYM_OFF_X;
-#ifdef ROGUE_COLOR
if (has_rogue_color && iflags.use_color) {
switch(objects[offset].oc_class) {
case COIN_CLASS: color = CLR_YELLOW; break;
default: color = CLR_BRIGHT_BLUE; break;
}
} else
-#endif
obj_color(offset);
} else if ((offset = (glyph - GLYPH_RIDDEN_OFF)) >= 0) { /* mon ridden */
idx = mons[offset].mlet + SYM_OFF_M;
-#ifdef ROGUE_COLOR
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. */
color = NO_COLOR; /* no need to check iflags.use_color */
else
-#endif
mon_color(offset);
special |= MG_RIDDEN;
} else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) { /* a corpse */
idx = objects[CORPSE].oc_class + SYM_OFF_O;
-#ifdef ROGUE_COLOR
if (has_rogue_color && iflags.use_color)
color = CLR_RED;
else
-#endif
mon_color(offset);
special |= MG_CORPSE;
} else if ((offset = (glyph - GLYPH_DETECT_OFF)) >= 0) { /* mon detect */
idx = mons[offset].mlet + SYM_OFF_M;
-#ifdef ROGUE_COLOR
if (has_rogue_color)
color = NO_COLOR; /* no need to check iflags.use_color */
else
-#endif
mon_color(offset);
/* Disabled for now; anyone want to get reverse video to work? */
/* is_reverse = TRUE; */
special |= MG_DETECT;
} else if ((offset = (glyph - GLYPH_INVIS_OFF)) >= 0) { /* invisible */
idx = SYM_INVISIBLE + SYM_OFF_X;
-#ifdef ROGUE_COLOR
if (has_rogue_color)
color = NO_COLOR; /* no need to check iflags.use_color */
else
-#endif
invis_color(offset);
special |= MG_INVIS;
} else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) { /* a pet */
idx = mons[offset].mlet + SYM_OFF_M;
-#ifdef ROGUE_COLOR
if (has_rogue_color)
color = NO_COLOR; /* no need to check iflags.use_color */
else
-#endif
pet_color(offset);
special |= MG_PET;
} else { /* a monster */
idx = mons[glyph].mlet + SYM_OFF_M;
-#ifdef ROGUE_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;
else
color = NO_COLOR;
- } else
-#endif
- {
+ } else {
mon_color(glyph);
/* special case the hero for `showrace' option */
#ifdef TEXTCOLOR
ch = showsyms[idx];
#ifdef TEXTCOLOR
/* Turn off color if no color defined, or rogue level w/o PC graphics. */
-# ifdef ROGUE_COLOR
if (!has_color(color) || (Is_rogue_level(&u.uz) && !has_rogue_color))
-# else
- if (!has_color(color) || Is_rogue_level(&u.uz))
-# endif
color = NO_COLOR;
#endif
{ "soundcard", "type of sound card to use", 20, SET_IN_FILE },
#endif
{ "symset", "load a set of display symbols from the symbols file", 70,
-#ifdef LOADSYMSETS
SET_IN_GAME },
-#else
- DISP_IN_GAME},
-#endif
{ "roguesymset", "load a set of rogue display symbols from the symbols file", 70,
-#ifdef LOADSYMSETS
SET_IN_GAME },
-#else
- DISP_IN_GAME},
-#endif
{ "suppress_alert", "suppress alerts about version-specific features",
8, SET_IN_GAME },
{ "tile_width", "width of tiles", 20, DISP_IN_GAME}, /*WC*/
*/
/* this detects the IBM-compatible console on most 386 boxes */
if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) {
-#ifdef LOADSYMSETS
if (!symset[PRIMARY].name) load_symset("IBMGraphics", PRIMARY);
if (!symset[ROGUESET].name) load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
-#endif
# ifdef TEXTCOLOR
iflags.use_color = TRUE;
# endif
if ((opts = nh_getenv("TERM")) &&
!strncmpi(opts, "vt", 2) && AS && AE &&
index(AS, '\016') && index(AE, '\017')) {
-# ifdef LOADSYMSETS
if (!symset[PRIMARY].name) load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
-# endif /*LOADSYMSETS*/
}
# endif
#endif /* UNIX || VMS */
fullname = "symset";
if (match_optname(opts, fullname, 6, TRUE)) {
-#ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) {
need_redraw = TRUE;
}
}
-#endif
return;
}
fullname = "DECgraphics";
if (match_optname(opts, fullname, 10, TRUE)) {
boolean badflag = FALSE;
-# ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1);
if (!negated) {
/* There is no rogue level DECgraphics-specific set */
wait_synch();
}
}
-# endif /*LOADSYMSETS*/
return;
}
fullname = "IBMgraphics";
if (match_optname(opts, fullname, 10, TRUE)) {
const char *sym_name = fullname;
boolean badflag = FALSE;
-# ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1);
if (!negated) {
for (i = PRIMARY; i <= ROGUESET; ++i) {
assign_graphics(ROGUESET);
}
}
-# endif /*LOADSYMSETS*/
return;
}
#endif
fullname = "MACgraphics";
if (match_optname(opts, fullname, 11, TRUE)) {
boolean badflag = FALSE;
-# ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1);
if (!negated) {
if (symset[PRIMARY]).name badflag = TRUE;
assign_graphics(ROGUESET);
}
}
-# endif /*LOADSYMSETS*/
return;
}
#endif
return 0;
}
-#ifdef LOADSYMSETS
struct symsetentry *symset_list = 0; /* files.c will populate this with
list of available sets */
-#endif
STATIC_OVL boolean
special_handling(optname, setinitial, setfromfile)
rogueflag = (*optname == 'r'),
ready_to_switch = FALSE,
nothing_to_do = FALSE;
-#ifdef LOADSYMSETS
int res;
char *symset_name, fmtstr[20];
struct symsetentry *sl;
int setcount = 0;
-#endif
int chosen = -2, which_set;
if (rogueflag) which_set = ROGUESET;
else
which_set = PRIMARY;
-#ifdef LOADSYMSETS
/* 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;
assign_graphics(ROGUESET);
} else if (!rogueflag) assign_graphics(PRIMARY);
need_redraw = TRUE;
-#endif /*LOADSYMSETS*/
return TRUE;
} else {
Sprintf(buf, "%s", rolestring(flags.initrace, races, noun));
else if (!strcmp(optname, "roguesymset")) {
Sprintf(buf, "%s",
-#ifdef LOADSYMSETS
symset[ROGUESET].name ?
symset[ROGUESET].name :
-#endif
"default");
if (currentgraphics == ROGUESET && symset[ROGUESET].name)
Strcat(buf, ", active");
}
else if (!strcmp(optname, "symset")) {
Sprintf(buf, "%s",
-#ifdef LOADSYMSETS
symset[PRIMARY].name ?
symset[PRIMARY].name :
-#endif
"default");
if (currentgraphics == PRIMARY && symset[PRIMARY].name)
Strcat(buf, ", active");
}
}
-#ifdef LOADSYMSETS
/* bundle some common usage into one easy-to-use routine */
int
load_symset(s, which_set)
}
return (struct symparse *)0;
}
-#endif /*LOADSYMSETS*/
/* data for option_help() */
static const char *opt_intro[] = {
process_options(argc, argv);
#endif
-#ifdef LOADSYMSETS
-# if defined(MSDOS) || defined(WIN32)
+#if defined(MSDOS) || defined(WIN32)
/* Player didn't specify any symbol set so use IBM defaults */
if (!symset[PRIMARY].name) {
load_symset("IBMGraphics_2", PRIMARY);
if (!symset[ROGUESET].name) {
load_symset("RogueEpyx", ROGUESET);
}
-# endif
-#endif /*LOADSYMSETS*/
+#endif
#ifdef MSDOS
init_nhwindows(&argc,argv);
case 'I':
case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) {
-# ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
-# endif
}
break;
/* case 'D': */
case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) {
-# ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
-# endif
}
break;
#endif
if (!strcmp(windowprocs.name, "tty") && sco_flag_console) {
atexit(sco_mapon);
sco_mapoff();
-# ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
-# endif
# ifdef TEXTCOLOR
if (has_colors())
iflags.use_color = TRUE;
case 'I':
case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) {
-#ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
-#endif
}
break;
/* case 'D': */
case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) {
-#ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
-#endif
}
break;
case 'p': /* profession (role) */
case 'I':
case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) {
-#ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
-#endif
}
break;
/* case 'D': */
case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) {
-#ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
-#endif
}
break;
case 'p': /* profession (role) */