* complexity of the game but also to the size of the load module.
*/
+/* display features */
+#define LOADSYMSETS /* loadable symbol sets; only default symbols w/o this */
/* dungeon features */
#define SINKS /* Kitchen sinks - Janet Walz */
/* dungeon levels */
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));
-#ifdef ASCIIGRAPH
E void FDECL(update_l_symset, (struct symparse *,int));
E void FDECL(update_r_symset, (struct symparse *,int));
#endif
#if defined(WIZARD)
E void NDECL(read_wizkit);
#endif
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
E int FDECL(read_sym_file, (int));
E int FDECL(parse_sym_line, (char *,int));
#endif
E int FDECL(add_autopickup_exception, (const char *));
E void NDECL(free_autopickup_exceptions);
#endif /* AUTOPICKUP_EXCEPTIONS */
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
E int FDECL(load_symset, (const char *,int));
E void FDECL(parsesymbols, (char *));
E struct symparse *FDECL(match_sym, (char *));
extern int currentgraphics; /* from drawing.c */
extern uchar showsyms[];
+#ifdef LOADSYMSETS
#define SYMHANDLING(ht) (symset[currentgraphics].handling == (ht))
+#else
+#define SYMHANDLING(ht) ((ht) == H_UNK)
+#endif
/*
* The 5 possible states of doors
#endif
/* might display need graphics code? */
-#if !defined(AMIGA) && !defined(TOS) && !defined(MAC) && !defined(ASCIIGRAPH)
+#if !defined(AMIGA) && !defined(TOS) && !defined(MAC)
# if defined(TERMLIB) || defined(OS2) || defined(MSDOS)
# define ASCIIGRAPH
# endif
#define TEXTCOLOR /* Use System V r3.2 terminfo color support */
/* and/or ANSI color support on termcap systems */
/* and/or X11 color */
-#define ASCIIGRAPH /* ASCII graphics support on terminals */
#define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control */
/* (e.g., VSUSP) */
#define POSIX_TYPES /* use POSIX types for system calls and termios */
*/
#define DLB /* use data librarian code */
-/*
- * Needed to support DECgraphics and/or IBMgraphics display styles.
- */
-#define ASCIIGRAPH /* ASCII graphics support on terminals */
-
/*
* You may define TEXTCOLOR if your system has any terminals that recognize
* ANSI color sequences of the form ``<ESCAPE>[#;#m'', where the first # is
#define C(n)
#endif
+#ifdef LOADSYMSETS
struct symsetentry symset[NUM_GRAPHICS];
+#endif
+
int currentgraphics = 0;
uchar showsyms[SYM_MAX] = DUMMY; /* symbols to be displayed */
*
*/
-void
-switch_symbols(nondefault)
-int nondefault;
-{
-#ifdef ASCIIGRAPH
- register int i;
-
- if (nondefault) {
- for (i = 0; i < SYM_MAX; i++)
- showsyms[i] = l_syms[i];
-# ifdef PC9800
- if (SYMHANDLING(H_IBM)
- && ibmgraphics_mode_callback)
- (*ibmgraphics_mode_callback)();
- else if (!symset[currentgraphics].name && ascgraphics_mode_callback)
- (*ascgraphics_mode_callback)();
-# endif
-# ifdef TERMLIB
- if (SYMHANDLING(H_DEC)
- && decgraphics_mode_callback)
- (*decgraphics_mode_callback)();
-# endif
- } else
-#endif
- init_symbols();
-}
-
void
init_symbols()
{
l_syms[i + SYM_OFF_X] = DEF_INVISIBLE;
}
+#ifdef LOADSYMSETS
clear_symsetentry(PRIMARY, FALSE);
+#endif
}
#ifdef REINCARNATION
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
}
#endif /*REINCARNATION*/
}
}
-#ifdef ASCIIGRAPH
+void
+switch_symbols(nondefault)
+int nondefault;
+{
+ register int i;
+
+ if (nondefault) {
+ for (i = 0; i < SYM_MAX; i++)
+ showsyms[i] = l_syms[i];
+# ifdef PC9800
+ if (SYMHANDLING(H_IBM)
+ && ibmgraphics_mode_callback)
+ (*ibmgraphics_mode_callback)();
+ else if (!symset[currentgraphics].name && ascgraphics_mode_callback)
+ (*ascgraphics_mode_callback)();
+# endif
+# ifdef TERMLIB
+ if (SYMHANDLING(H_DEC)
+ && decgraphics_mode_callback)
+ (*decgraphics_mode_callback)();
+# endif
+ } else
+ 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 /*ASCIIGRAPH*/
+#endif /*LOADSYMSETS*/
/*drawing.c*/
STATIC_DCL FILE *FDECL(fopen_config_file, (const char *));
STATIC_DCL int FDECL(get_uchars, (FILE *,char *,char *,uchar *,BOOLEAN_P,int,const char *));
int FDECL(parse_config_line, (FILE *,char *,char *,char *));
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
STATIC_DCL FILE *NDECL(fopen_sym_file);
STATIC_DCL void FDECL(set_symhandling, (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 ASCIIGRAPH
+#ifdef LOADSYMSETS
/* parse here */
parsesymbols(bufp);
-#endif /*ASCIIGRAPH*/
+#endif
if (morelines)
do {
*symbuf = '\0';
bufp = symbuf;
} while (*bufp == '#');
} while (morelines);
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
switch_symbols(TRUE);
-#endif /*ASCIIGRAPH*/
+#endif
#ifdef WIZARD
} else if (match_varname(buf, "WIZKIT", 6)) {
(void) strncpy(wizkit, bufp, WIZKIT_MAX-1);
#endif /*WIZARD*/
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
extern struct symsetentry *symset_list; /* options.c */
extern struct symparse loadsyms[]; /* drawing.c */
extern const char *known_handling[]; /* drawing.c */
if (!strcmpi(bufp, symset[which_set].name)) {
/* matches desired one */
chosen_symset_start = TRUE;
-#ifdef REINCARNATION
+# ifdef REINCARNATION
if (which_set == ROGUESET) init_r_symbols();
-#endif
+# endif
if (which_set == PRIMARY) init_l_symbols();
}
break;
} else { /* !SYM_CONTROL */
val = sym_val(bufp);
if (chosen_symset_start) {
-#ifdef REINCARNATION
+# ifdef REINCARNATION
if (which_set == ROGUESET)
update_r_symset(symp, val);
else
-#endif
+# endif
update_l_symset(symp, val);
}
}
i++;
}
}
-#endif /*ASCIIGRAPH*/
+#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
-# if defined(REINCARNATION) && defined(ASCIIGRAPH)
+# if defined(REINCARNATION) && defined(LOADSYMSETS)
# define ROGUE_COLOR
# endif
#ifdef MSDOS
{ "soundcard", "type of sound card to use", 20, SET_IN_FILE },
#endif
- { "symset", "load a set of display symbols from the symbols file", 70, SET_IN_GAME },
+ { "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 REINCARNATION
+# ifdef LOADSYMSETS
SET_IN_GAME },
+# else
+ DISP_IN_GAME},
+# endif
#else
SET_IN_FILE },
#endif
*/
/* this detects the IBM-compatible console on most 386 boxes */
if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) {
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
if (!symset[PRIMARY].name) load_symset("IBMGraphics", PRIMARY);
if (!symset[ROGUESET].name) load_symset("RogueIBM", ROGUESET);
if ((opts = nh_getenv("TERM")) &&
!strncmpi(opts, "vt", 2) && AS && AE &&
index(AS, '\016') && index(AE, '\017')) {
-# ifdef ASCIIGRAPH
+# ifdef LOADSYMSETS
if (!symset[PRIMARY].name) load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
-# endif /*ASCIIGRAPH*/
+# endif /*LOADSYMSETS*/
}
# endif
#endif /* UNIX || VMS */
fullname = "roguesymset";
if (match_optname(opts, fullname, 7, TRUE)) {
-#if defined(REINCARNATION) && defined(ASCIIGRAPH)
+#if defined(REINCARNATION) && defined(LOADSYMSETS)
if (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) {
fullname = "symset";
if (match_optname(opts, fullname, 6, TRUE)) {
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) {
) {
int color_number, color_incr;
-#ifndef WIN32CON
+# ifndef WIN32CON
if (duplicate) complain_about_duplicate(opts,1);
-#endif
+# endif
# ifdef MAC
if (match_optname(opts, "hicolor", 3, TRUE)) {
if (negated) {
else warning_opts(opts, fullname);
return;
}
+
#ifdef BACKWARD_COMPAT
/* boulder:symbol */
fullname = "boulder";
}
#endif
-#ifdef ASCIIGRAPH
-# if defined(BACKWARD_COMPAT)
+#if defined(BACKWARD_COMPAT)
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 = 0; i < NUM_GRAPHICS; ++i) {
# endif
}
}
+# endif /*LOADSYMSETS*/
return;
}
-# ifdef MAC_GRAPHICS_ENV
+#endif
+#ifdef MAC_GRAPHICS_ENV
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
-# endif
#endif
/* OK, if we still haven't recognized the option, check the boolean
* options list
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)
!strcmp("roguesymset", optname)) {
menu_item *symset_pick = (menu_item *)0;
boolean rogueflag = (*optname == 'r');
- struct symsetentry *sl;
+#ifdef LOADSYMSETS
+ int res;
char *symset_name, fmtstr[20];
- int chosen = -2, res, which_set =
+ struct symsetentry *sl;
+#endif
+ int chosen = -2, which_set =
#ifdef REINCARNATION
rogueflag ? ROGUESET :
#endif
#ifndef REINCARNATION
if (rogueflag) return TRUE;
#endif
-#ifdef ASCIIGRAPH
+#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;
# endif
assign_graphics(PRIMARY);
need_redraw = TRUE;
-#endif /*ASCIIGRAPH*/
+#endif /*LOADSYMSETS*/
} else {
/* didn't match any of the special options */
return FALSE;
#ifdef REINCARNATION
else if (!strcmp(optname, "roguesymset"))
Sprintf(buf, "%s",
+# ifdef LOADSYMSETS
symset[ROGUESET].name ?
- symset[ROGUESET].name : "default");
+ symset[ROGUESET].name :
+# endif
+ "default");
#endif
else if (!strcmp(optname, "role"))
Sprintf(buf, "%s", rolestring(flags.initrole, roles, name.m));
}
else if (!strcmp(optname, "symset"))
Sprintf(buf, "%s",
+#ifdef LOADSYMSETS
symset[PRIMARY].name ?
- symset[PRIMARY].name : "default");
+ symset[PRIMARY].name :
+#endif
+ "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")) {
}
}
#endif /* AUTOPICKUP_EXCEPTIONS */
-#ifdef ASCIIGRAPH
+
+#ifdef LOADSYMSETS
/* bundle some common usage into one easy-to-use routine */
int
load_symset(s, which_set)
escapes(strval, buf);
return (int)*buf;
}
-#endif
+#endif /*LOADSYMSETS*/
/* data for option_help() */
static const char *opt_intro[] = {
process_options(argc, argv);
#endif
-#if defined(MSDOS) || defined(WIN32)
+#ifdef LOADSYMSETS
+# 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);
}
-# ifdef REINCARNATION
+# ifdef REINCARNATION
if (!symset[ROGUESET].name) {
load_symset("RogueEpyx", ROGUESET);
}
+# endif
# endif
-#endif
+#endif /*LOADSYMSETS*/
#ifdef MSDOS
init_nhwindows(&argc,argv);
case 'I':
case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) {
-# ifdef ASCIIGRAPH
+# ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
/* case 'D': */
case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) {
-# ifdef ASCIIGRAPH
+# ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
# endif
if (!strcmp(windowprocs.name, "tty") && sco_flag_console) {
atexit(sco_mapon);
sco_mapoff();
-# ifdef ASCIIGRAPH
+# ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
case 'I':
case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) {
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
/* case 'D': */
case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) {
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
#endif
case 'I':
case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) {
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE);
/* case 'D': */
case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) {
-#ifdef ASCIIGRAPH
+#ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE);
#endif