symbol preprocessing (trunk only)

Clean up the preprocessing associated with the
loadable symbol stuff.

Base it on new LOADSYMSETS, rather than on the
previously existing ASCIIGRAPH preprocessor define.
This commit is contained in:
nethack.allison
2006-10-02 13:15:50 +00:00
parent 58a1828f18
commit 084dce82d0
14 changed files with 119 additions and 83 deletions

View File

@@ -355,6 +355,8 @@ typedef unsigned char uchar;
* complexity of the game but also to the size of the load module. * 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 */ /* dungeon features */
#define SINKS /* Kitchen sinks - Janet Walz */ #define SINKS /* Kitchen sinks - Janet Walz */
/* dungeon levels */ /* dungeon levels */

View File

@@ -499,8 +499,8 @@ E void NDECL(init_r_symbols);
E void NDECL(init_symbols); E void NDECL(init_symbols);
E void NDECL(init_showsyms); E void NDECL(init_showsyms);
E void NDECL(init_l_symbols); E void NDECL(init_l_symbols);
#ifdef LOADSYMSETS
E void FDECL(clear_symsetentry, (int,BOOLEAN_P)); E void FDECL(clear_symsetentry, (int,BOOLEAN_P));
#ifdef ASCIIGRAPH
E void FDECL(update_l_symset, (struct symparse *,int)); E void FDECL(update_l_symset, (struct symparse *,int));
E void FDECL(update_r_symset, (struct symparse *,int)); E void FDECL(update_r_symset, (struct symparse *,int));
#endif #endif
@@ -718,7 +718,7 @@ E void FDECL(check_recordfile, (const char *));
#if defined(WIZARD) #if defined(WIZARD)
E void NDECL(read_wizkit); E void NDECL(read_wizkit);
#endif #endif
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
E int FDECL(read_sym_file, (int)); E int FDECL(read_sym_file, (int));
E int FDECL(parse_sym_line, (char *,int)); E int FDECL(parse_sym_line, (char *,int));
#endif #endif
@@ -1536,7 +1536,7 @@ E void FDECL(set_option_mod_status, (const char *,int));
E int FDECL(add_autopickup_exception, (const char *)); E int FDECL(add_autopickup_exception, (const char *));
E void NDECL(free_autopickup_exceptions); E void NDECL(free_autopickup_exceptions);
#endif /* AUTOPICKUP_EXCEPTIONS */ #endif /* AUTOPICKUP_EXCEPTIONS */
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
E int FDECL(load_symset, (const char *,int)); E int FDECL(load_symset, (const char *,int));
E void FDECL(parsesymbols, (char *)); E void FDECL(parsesymbols, (char *));
E struct symparse *FDECL(match_sym, (char *)); E struct symparse *FDECL(match_sym, (char *));

View File

@@ -273,7 +273,11 @@ extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */
extern int currentgraphics; /* from drawing.c */ extern int currentgraphics; /* from drawing.c */
extern uchar showsyms[]; extern uchar showsyms[];
#ifdef LOADSYMSETS
#define SYMHANDLING(ht) (symset[currentgraphics].handling == (ht)) #define SYMHANDLING(ht) (symset[currentgraphics].handling == (ht))
#else
#define SYMHANDLING(ht) ((ht) == H_UNK)
#endif
/* /*
* The 5 possible states of doors * The 5 possible states of doors

View File

@@ -12,7 +12,7 @@
#endif #endif
/* might display need graphics code? */ /* 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) # if defined(TERMLIB) || defined(OS2) || defined(MSDOS)
# define ASCIIGRAPH # define ASCIIGRAPH
# endif # endif

View File

@@ -56,7 +56,6 @@
#define TEXTCOLOR /* Use System V r3.2 terminfo color support */ #define TEXTCOLOR /* Use System V r3.2 terminfo color support */
/* and/or ANSI color support on termcap systems */ /* and/or ANSI color support on termcap systems */
/* and/or X11 color */ /* and/or X11 color */
#define ASCIIGRAPH /* ASCII graphics support on terminals */
#define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control */ #define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control */
/* (e.g., VSUSP) */ /* (e.g., VSUSP) */
#define POSIX_TYPES /* use POSIX types for system calls and termios */ #define POSIX_TYPES /* use POSIX types for system calls and termios */

View File

@@ -74,11 +74,6 @@
*/ */
#define DLB /* use data librarian code */ #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 * You may define TEXTCOLOR if your system has any terminals that recognize
* ANSI color sequences of the form ``<ESCAPE>[#;#m'', where the first # is * ANSI color sequences of the form ``<ESCAPE>[#;#m'', where the first # is

View File

@@ -17,7 +17,10 @@
#define C(n) #define C(n)
#endif #endif
#ifdef LOADSYMSETS
struct symsetentry symset[NUM_GRAPHICS]; struct symsetentry symset[NUM_GRAPHICS];
#endif
int currentgraphics = 0; int currentgraphics = 0;
uchar showsyms[SYM_MAX] = DUMMY; /* symbols to be displayed */ uchar showsyms[SYM_MAX] = DUMMY; /* symbols to be displayed */
@@ -344,33 +347,6 @@ def_char_to_monclass(ch)
* *
*/ */
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 void
init_symbols() init_symbols()
{ {
@@ -431,7 +407,9 @@ init_l_symbols()
l_syms[i + SYM_OFF_X] = DEF_INVISIBLE; l_syms[i + SYM_OFF_X] = DEF_INVISIBLE;
} }
#ifdef LOADSYMSETS
clear_symsetentry(PRIMARY, FALSE); clear_symsetentry(PRIMARY, FALSE);
#endif
} }
#ifdef REINCARNATION #ifdef REINCARNATION
@@ -464,11 +442,13 @@ init_r_symbols()
r_syms[i + SYM_OFF_X] = DEF_INVISIBLE; r_syms[i + SYM_OFF_X] = DEF_INVISIBLE;
} }
# ifdef LOADSYMSETS
clear_symsetentry(ROGUESET, FALSE); clear_symsetentry(ROGUESET, FALSE);
symset[ROGUESET].nocolor = 1; /* default on Rogue level is no color symset[ROGUESET].nocolor = 1; /* default on Rogue level is no color
* but some symbol sets can * but some symbol sets can
* override that * override that
*/ */
# endif
} }
#endif /*REINCARNATION*/ #endif /*REINCARNATION*/
@@ -506,7 +486,32 @@ int whichset;
} }
} }
#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 void
update_l_symset(symp, val) update_l_symset(symp, val)
struct symparse *symp; struct symparse *symp;
@@ -737,7 +742,7 @@ struct symparse loadsyms[] = {
{SYM_OTH, SYM_INVISIBLE + SYM_OFF_X, "S_invisible"}, {SYM_OTH, SYM_INVISIBLE + SYM_OFF_X, "S_invisible"},
{0,0,(const char *)0} /* fence post */ {0,0,(const char *)0} /* fence post */
}; };
#endif /*ASCIIGRAPH*/ #endif /*LOADSYMSETS*/
/*drawing.c*/ /*drawing.c*/

View File

@@ -185,7 +185,7 @@ STATIC_DCL char *FDECL(make_lockname, (const char *,char *));
STATIC_DCL FILE *FDECL(fopen_config_file, (const char *)); STATIC_DCL FILE *FDECL(fopen_config_file, (const char *));
STATIC_DCL int FDECL(get_uchars, (FILE *,char *,char *,uchar *,BOOLEAN_P,int,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 *)); int FDECL(parse_config_line, (FILE *,char *,char *,char *));
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
STATIC_DCL FILE *NDECL(fopen_sym_file); STATIC_DCL FILE *NDECL(fopen_sym_file);
STATIC_DCL void FDECL(set_symhandling, (char *,int)); STATIC_DCL void FDECL(set_symhandling, (char *,int));
#endif #endif
@@ -2057,6 +2057,10 @@ char *tmp_levels;
WARNCOUNT, "WARNINGS"); WARNCOUNT, "WARNINGS");
assign_warnings(translate); assign_warnings(translate);
} else if (match_varname(buf, "SYMBOLS", 4)) { } 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]; char *op, symbuf[BUFSZ];
boolean morelines; boolean morelines;
do { do {
@@ -2075,11 +2079,10 @@ char *tmp_levels;
/* strip trailing space now that '\' is gone */ /* strip trailing space now that '\' is gone */
while (--op >= bufp && isspace(*op)) *op = '\0'; while (--op >= bufp && isspace(*op)) *op = '\0';
} }
#ifdef LOADSYMSETS
#ifdef ASCIIGRAPH
/* parse here */ /* parse here */
parsesymbols(bufp); parsesymbols(bufp);
#endif /*ASCIIGRAPH*/ #endif
if (morelines) if (morelines)
do { do {
*symbuf = '\0'; *symbuf = '\0';
@@ -2090,9 +2093,9 @@ char *tmp_levels;
bufp = symbuf; bufp = symbuf;
} while (*bufp == '#'); } while (*bufp == '#');
} while (morelines); } while (morelines);
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
switch_symbols(TRUE); switch_symbols(TRUE);
#endif /*ASCIIGRAPH*/ #endif
#ifdef WIZARD #ifdef WIZARD
} else if (match_varname(buf, "WIZKIT", 6)) { } else if (match_varname(buf, "WIZKIT", 6)) {
(void) strncpy(wizkit, bufp, WIZKIT_MAX-1); (void) strncpy(wizkit, bufp, WIZKIT_MAX-1);
@@ -2422,7 +2425,7 @@ read_wizkit()
#endif /*WIZARD*/ #endif /*WIZARD*/
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
extern struct symsetentry *symset_list; /* options.c */ extern struct symsetentry *symset_list; /* options.c */
extern struct symparse loadsyms[]; /* drawing.c */ extern struct symparse loadsyms[]; /* drawing.c */
extern const char *known_handling[]; /* drawing.c */ extern const char *known_handling[]; /* drawing.c */
@@ -2570,9 +2573,9 @@ int which_set;
if (!strcmpi(bufp, symset[which_set].name)) { if (!strcmpi(bufp, symset[which_set].name)) {
/* matches desired one */ /* matches desired one */
chosen_symset_start = TRUE; chosen_symset_start = TRUE;
#ifdef REINCARNATION # ifdef REINCARNATION
if (which_set == ROGUESET) init_r_symbols(); if (which_set == ROGUESET) init_r_symbols();
#endif # endif
if (which_set == PRIMARY) init_l_symbols(); if (which_set == PRIMARY) init_l_symbols();
} }
break; break;
@@ -2606,11 +2609,11 @@ int which_set;
} else { /* !SYM_CONTROL */ } else { /* !SYM_CONTROL */
val = sym_val(bufp); val = sym_val(bufp);
if (chosen_symset_start) { if (chosen_symset_start) {
#ifdef REINCARNATION # ifdef REINCARNATION
if (which_set == ROGUESET) if (which_set == ROGUESET)
update_r_symset(symp, val); update_r_symset(symp, val);
else else
#endif # endif
update_l_symset(symp, val); update_l_symset(symp, val);
} }
} }
@@ -2634,7 +2637,7 @@ int which_set;
i++; i++;
} }
} }
#endif /*ASCIIGRAPH*/ #endif /*LOADSYMSETS*/
/* ---------- END CONFIG FILE HANDLING ----------- */ /* ---------- END CONFIG FILE HANDLING ----------- */

View File

@@ -32,7 +32,7 @@ int explcolors[] = {
#define pet_color(n) color = iflags.use_color ? mons[n].mcolor : NO_COLOR #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 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 #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 # define ROGUE_COLOR
# endif # endif

View File

@@ -333,10 +333,19 @@ static struct Comp_Opt
#ifdef MSDOS #ifdef MSDOS
{ "soundcard", "type of sound card to use", 20, SET_IN_FILE }, { "soundcard", "type of sound card to use", 20, SET_IN_FILE },
#endif #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, { "roguesymset", "load a set of rogue display symbols from the symbols file", 70,
#ifdef REINCARNATION #ifdef REINCARNATION
# ifdef LOADSYMSETS
SET_IN_GAME }, SET_IN_GAME },
# else
DISP_IN_GAME},
# endif
#else #else
SET_IN_FILE }, SET_IN_FILE },
#endif #endif
@@ -608,7 +617,7 @@ initoptions()
*/ */
/* this detects the IBM-compatible console on most 386 boxes */ /* this detects the IBM-compatible console on most 386 boxes */
if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) { if ((opts = nh_getenv("TERM")) && !strncmp(opts, "AT", 2)) {
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
if (!symset[PRIMARY].name) load_symset("IBMGraphics", PRIMARY); if (!symset[PRIMARY].name) load_symset("IBMGraphics", PRIMARY);
if (!symset[ROGUESET].name) load_symset("RogueIBM", ROGUESET); if (!symset[ROGUESET].name) load_symset("RogueIBM", ROGUESET);
@@ -626,10 +635,10 @@ initoptions()
if ((opts = nh_getenv("TERM")) && if ((opts = nh_getenv("TERM")) &&
!strncmpi(opts, "vt", 2) && AS && AE && !strncmpi(opts, "vt", 2) && AS && AE &&
index(AS, '\016') && index(AE, '\017')) { index(AS, '\016') && index(AE, '\017')) {
# ifdef ASCIIGRAPH # ifdef LOADSYMSETS
if (!symset[PRIMARY].name) load_symset("DECGraphics", PRIMARY); if (!symset[PRIMARY].name) load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE); switch_symbols(TRUE);
# endif /*ASCIIGRAPH*/ # endif /*LOADSYMSETS*/
} }
# endif # endif
#endif /* UNIX || VMS */ #endif /* UNIX || VMS */
@@ -1294,7 +1303,7 @@ boolean tinitial, tfrom_file;
fullname = "roguesymset"; fullname = "roguesymset";
if (match_optname(opts, fullname, 7, TRUE)) { 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 (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE); if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) { else if ((op = string_for_opt(opts, FALSE)) != 0) {
@@ -1317,7 +1326,7 @@ boolean tinitial, tfrom_file;
fullname = "symset"; fullname = "symset";
if (match_optname(opts, fullname, 6, TRUE)) { if (match_optname(opts, fullname, 6, TRUE)) {
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1); if (duplicate) complain_about_duplicate(opts,1);
if (negated) bad_negation(fullname, FALSE); if (negated) bad_negation(fullname, FALSE);
else if ((op = string_for_opt(opts, FALSE)) != 0) { else if ((op = string_for_opt(opts, FALSE)) != 0) {
@@ -1483,9 +1492,9 @@ boolean tinitial, tfrom_file;
) { ) {
int color_number, color_incr; int color_number, color_incr;
#ifndef WIN32CON # ifndef WIN32CON
if (duplicate) complain_about_duplicate(opts,1); if (duplicate) complain_about_duplicate(opts,1);
#endif # endif
# ifdef MAC # ifdef MAC
if (match_optname(opts, "hicolor", 3, TRUE)) { if (match_optname(opts, "hicolor", 3, TRUE)) {
if (negated) { if (negated) {
@@ -1605,6 +1614,7 @@ goodfruit:
else warning_opts(opts, fullname); else warning_opts(opts, fullname);
return; return;
} }
#ifdef BACKWARD_COMPAT #ifdef BACKWARD_COMPAT
/* boulder:symbol */ /* boulder:symbol */
fullname = "boulder"; fullname = "boulder";
@@ -2280,11 +2290,11 @@ goodfruit:
} }
#endif #endif
#ifdef ASCIIGRAPH #if defined(BACKWARD_COMPAT)
# if defined(BACKWARD_COMPAT)
fullname = "DECgraphics"; fullname = "DECgraphics";
if (match_optname(opts, fullname, 10, TRUE)) { if (match_optname(opts, fullname, 10, TRUE)) {
boolean badflag = FALSE; boolean badflag = FALSE;
# ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1); if (duplicate) complain_about_duplicate(opts,1);
if (!negated) { if (!negated) {
/* There is no rogue level DECgraphics-specific set */ /* There is no rogue level DECgraphics-specific set */
@@ -2304,12 +2314,14 @@ goodfruit:
wait_synch(); wait_synch();
} }
} }
# endif /*LOADSYMSETS*/
return; return;
} }
fullname = "IBMgraphics"; fullname = "IBMgraphics";
if (match_optname(opts, fullname, 10, TRUE)) { if (match_optname(opts, fullname, 10, TRUE)) {
const char *sym_name = fullname; const char *sym_name = fullname;
boolean badflag = FALSE; boolean badflag = FALSE;
# ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1); if (duplicate) complain_about_duplicate(opts,1);
if (!negated) { if (!negated) {
for (i = 0; i < NUM_GRAPHICS; ++i) { for (i = 0; i < NUM_GRAPHICS; ++i) {
@@ -2338,12 +2350,15 @@ goodfruit:
# endif # endif
} }
} }
# endif /*LOADSYMSETS*/
return; return;
} }
# ifdef MAC_GRAPHICS_ENV #endif
#ifdef MAC_GRAPHICS_ENV
fullname = "MACgraphics"; fullname = "MACgraphics";
if (match_optname(opts, fullname, 11, TRUE)) { if (match_optname(opts, fullname, 11, TRUE)) {
boolean badflag = FALSE; boolean badflag = FALSE;
# ifdef LOADSYMSETS
if (duplicate) complain_about_duplicate(opts,1); if (duplicate) complain_about_duplicate(opts,1);
if (!negated) { if (!negated) {
if (symset[PRIMARY]).name badflag = TRUE; if (symset[PRIMARY]).name badflag = TRUE;
@@ -2365,10 +2380,9 @@ goodfruit:
assign_graphics(ROGUESET); assign_graphics(ROGUESET);
} }
} }
# endif /*LOADSYMSETS*/
return; return;
} }
# endif
# endif
#endif #endif
/* OK, if we still haven't recognized the option, check the boolean /* OK, if we still haven't recognized the option, check the boolean
* options list * options list
@@ -2776,8 +2790,10 @@ doset()
return 0; return 0;
} }
#ifdef LOADSYMSETS
struct symsetentry *symset_list = 0; /* files.c will populate this with struct symsetentry *symset_list = 0; /* files.c will populate this with
list of available sets */ list of available sets */
#endif
STATIC_OVL boolean STATIC_OVL boolean
special_handling(optname, setinitial, setfromfile) special_handling(optname, setinitial, setfromfile)
@@ -3140,9 +3156,12 @@ boolean setinitial,setfromfile;
!strcmp("roguesymset", optname)) { !strcmp("roguesymset", optname)) {
menu_item *symset_pick = (menu_item *)0; menu_item *symset_pick = (menu_item *)0;
boolean rogueflag = (*optname == 'r'); boolean rogueflag = (*optname == 'r');
struct symsetentry *sl; #ifdef LOADSYMSETS
int res;
char *symset_name, fmtstr[20]; char *symset_name, fmtstr[20];
int chosen = -2, res, which_set = struct symsetentry *sl;
#endif
int chosen = -2, which_set =
#ifdef REINCARNATION #ifdef REINCARNATION
rogueflag ? ROGUESET : rogueflag ? ROGUESET :
#endif #endif
@@ -3150,7 +3169,7 @@ boolean setinitial,setfromfile;
#ifndef REINCARNATION #ifndef REINCARNATION
if (rogueflag) return TRUE; if (rogueflag) return TRUE;
#endif #endif
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
/* clear symset[].name as a flag to read_sym_file() to build list */ /* clear symset[].name as a flag to read_sym_file() to build list */
symset_name = symset[which_set].name; symset_name = symset[which_set].name;
symset[which_set].name = (char *)0; symset[which_set].name = (char *)0;
@@ -3275,7 +3294,7 @@ boolean setinitial,setfromfile;
# endif # endif
assign_graphics(PRIMARY); assign_graphics(PRIMARY);
need_redraw = TRUE; need_redraw = TRUE;
#endif /*ASCIIGRAPH*/ #endif /*LOADSYMSETS*/
} else { } else {
/* didn't match any of the special options */ /* didn't match any of the special options */
return FALSE; return FALSE;
@@ -3477,8 +3496,11 @@ char *buf;
#ifdef REINCARNATION #ifdef REINCARNATION
else if (!strcmp(optname, "roguesymset")) else if (!strcmp(optname, "roguesymset"))
Sprintf(buf, "%s", Sprintf(buf, "%s",
# ifdef LOADSYMSETS
symset[ROGUESET].name ? symset[ROGUESET].name ?
symset[ROGUESET].name : "default"); symset[ROGUESET].name :
# endif
"default");
#endif #endif
else if (!strcmp(optname, "role")) else if (!strcmp(optname, "role"))
Sprintf(buf, "%s", rolestring(flags.initrole, roles, name.m)); Sprintf(buf, "%s", rolestring(flags.initrole, roles, name.m));
@@ -3513,8 +3535,11 @@ char *buf;
} }
else if (!strcmp(optname, "symset")) else if (!strcmp(optname, "symset"))
Sprintf(buf, "%s", Sprintf(buf, "%s",
#ifdef LOADSYMSETS
symset[PRIMARY].name ? symset[PRIMARY].name ?
symset[PRIMARY].name : "default"); symset[PRIMARY].name :
#endif
"default");
else if (!strcmp(optname, "tile_file")) else if (!strcmp(optname, "tile_file"))
Sprintf(buf, "%s", iflags.wc_tile_file ? iflags.wc_tile_file : defopt); Sprintf(buf, "%s", iflags.wc_tile_file ? iflags.wc_tile_file : defopt);
else if (!strcmp(optname, "tile_height")) { else if (!strcmp(optname, "tile_height")) {
@@ -3689,7 +3714,8 @@ free_autopickup_exceptions()
} }
} }
#endif /* AUTOPICKUP_EXCEPTIONS */ #endif /* AUTOPICKUP_EXCEPTIONS */
#ifdef ASCIIGRAPH
#ifdef LOADSYMSETS
/* bundle some common usage into one easy-to-use routine */ /* bundle some common usage into one easy-to-use routine */
int int
load_symset(s, which_set) load_symset(s, which_set)
@@ -3776,7 +3802,7 @@ char *strval;
escapes(strval, buf); escapes(strval, buf);
return (int)*buf; return (int)*buf;
} }
#endif #endif /*LOADSYMSETS*/
/* data for option_help() */ /* data for option_help() */
static const char *opt_intro[] = { static const char *opt_intro[] = {

View File

@@ -305,17 +305,19 @@ char *argv[];
process_options(argc, argv); process_options(argc, argv);
#endif #endif
#if defined(MSDOS) || defined(WIN32) #ifdef LOADSYMSETS
# if defined(MSDOS) || defined(WIN32)
/* Player didn't specify any symbol set so use IBM defaults */ /* Player didn't specify any symbol set so use IBM defaults */
if (!symset[PRIMARY].name) { if (!symset[PRIMARY].name) {
load_symset("IBMGraphics_2", PRIMARY); load_symset("IBMGraphics_2", PRIMARY);
} }
# ifdef REINCARNATION # ifdef REINCARNATION
if (!symset[ROGUESET].name) { if (!symset[ROGUESET].name) {
load_symset("RogueEpyx", ROGUESET); load_symset("RogueEpyx", ROGUESET);
} }
# endif
# endif # endif
#endif #endif /*LOADSYMSETS*/
#ifdef MSDOS #ifdef MSDOS
init_nhwindows(&argc,argv); init_nhwindows(&argc,argv);
@@ -548,7 +550,7 @@ char *argv[];
case 'I': case 'I':
case 'i': case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) { if (!strncmpi(argv[0]+1, "IBM", 3)) {
# ifdef ASCIIGRAPH # ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY); load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET); load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE); switch_symbols(TRUE);
@@ -558,7 +560,7 @@ char *argv[];
/* case 'D': */ /* case 'D': */
case 'd': case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) { if (!strncmpi(argv[0]+1, "DEC", 3)) {
# ifdef ASCIIGRAPH # ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY); load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE); switch_symbols(TRUE);
# endif # endif

View File

@@ -365,7 +365,7 @@ init_sco_cons()
if (!strcmp(windowprocs.name, "tty") && sco_flag_console) { if (!strcmp(windowprocs.name, "tty") && sco_flag_console) {
atexit(sco_mapon); atexit(sco_mapon);
sco_mapoff(); sco_mapoff();
# ifdef ASCIIGRAPH # ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY); load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET); load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE); switch_symbols(TRUE);

View File

@@ -370,7 +370,7 @@ char *argv[];
case 'I': case 'I':
case 'i': case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) { if (!strncmpi(argv[0]+1, "IBM", 3)) {
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY); load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET); load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE); switch_symbols(TRUE);
@@ -380,7 +380,7 @@ char *argv[];
/* case 'D': */ /* case 'D': */
case 'd': case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) { if (!strncmpi(argv[0]+1, "DEC", 3)) {
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY); load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE); switch_symbols(TRUE);
#endif #endif

View File

@@ -269,7 +269,7 @@ char *argv[];
case 'I': case 'I':
case 'i': case 'i':
if (!strncmpi(argv[0]+1, "IBM", 3)) { if (!strncmpi(argv[0]+1, "IBM", 3)) {
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
load_symset("IBMGraphics", PRIMARY); load_symset("IBMGraphics", PRIMARY);
load_symset("RogueIBM", ROGUESET); load_symset("RogueIBM", ROGUESET);
switch_symbols(TRUE); switch_symbols(TRUE);
@@ -279,7 +279,7 @@ char *argv[];
/* case 'D': */ /* case 'D': */
case 'd': case 'd':
if (!strncmpi(argv[0]+1, "DEC", 3)) { if (!strncmpi(argv[0]+1, "DEC", 3)) {
#ifdef ASCIIGRAPH #ifdef LOADSYMSETS
load_symset("DECGraphics", PRIMARY); load_symset("DECGraphics", PRIMARY);
switch_symbols(TRUE); switch_symbols(TRUE);
#endif #endif