Remove TEXTCOLOR build option
This commit is contained in:
@@ -213,7 +213,6 @@ steps:
|
||||
sed -i '/^#define MAIL/d' include/unixconf.h
|
||||
sed -i '/^#define SHELL/d' include/unixconf.h
|
||||
sed -i '/^#define SUSPEND/d' include/unixconf.h
|
||||
sed -i 's/^#define TEXTCOLOR//' include/unixconf.h
|
||||
make fetch-lua
|
||||
make WANT_WIN_ALL=1 all
|
||||
condition: and(eq( variables['Agent.OS'], 'Linux' ), eq( variables.buildTarget, 'minimal'))
|
||||
|
||||
@@ -14,6 +14,7 @@ blind your character is permanently blind [False]
|
||||
bones allow loading bones files [True]
|
||||
clicklook look at map by clicking right mouse button [False]
|
||||
cmdassist give help for errors on direction & other commands [True]
|
||||
color use different colors for objects on screen [True for micros]
|
||||
confirm ask before hitting tame or peaceful monsters [True]
|
||||
dark_room show floor not in sight in different color [True]
|
||||
eight_bit_tty send 8-bit characters straight to terminal [False]
|
||||
@@ -27,6 +28,8 @@ goldX when filtering objects by bless/curse state, [False]
|
||||
help print all available info when using the / command [True]
|
||||
herecmd_menu show menu of some possible commands when clicking
|
||||
on yourself or next to you with mouse [False]
|
||||
hilite_pet display pets in a highlighted manner [False]
|
||||
hilite_pile display item piles in a highlighted manner [False]
|
||||
ignintr ignore interrupt signal, including breaks [False]
|
||||
implicit_uncursed omit "uncursed" from inventory, if possible [True]
|
||||
legacy print introductory message [True]
|
||||
@@ -91,11 +94,6 @@ news print any news from game administrator on startup [True]
|
||||
Boolean option if SCORE_ON_BOTL was set at compile time:
|
||||
showscore display your approximate accumulated score [False]
|
||||
|
||||
Boolean options if TEXTCOLOR was set at compile time:
|
||||
color use different colors for objects on screen [True for micros]
|
||||
hilite_pet display pets in a highlighted manner [False]
|
||||
hilite_pile display item piles in a highlighted manner [False]
|
||||
|
||||
Boolean option if TIMED_DELAY was set at compile time (tty or curses only):
|
||||
timed_delay on unix and VMS, use a timer instead of sending [True]
|
||||
extra screen output when attempting to pause for
|
||||
|
||||
37
dat/options2
Normal file
37
dat/options2
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
NetHack version 3.7.0 [work-in-progress]
|
||||
|
||||
Options compiled into this edition:
|
||||
|
||||
color, data file compression, data librarian, end-of-game dumplogs,
|
||||
deferred handling of hangup signal, insurance files for recovering from
|
||||
crashes, log file, extended log file, errors and warnings log file, mail
|
||||
daemon, news file, internal pager used for viewing help files, pattern
|
||||
matching via :PATMATCH:, pseudo random numbers generated by ISAAC64,
|
||||
strong PRNG seed from /dev/urandom, restore saved games via menu, screen
|
||||
clipping, shell command, traditional status display, status via
|
||||
windowport with highlighting, suspend command, terminal info library,
|
||||
tiles file in XPM format, graphical RIP screen, timed wait for display
|
||||
effects, system configuration at run-time, save and bones files accepted
|
||||
from version 3.7.0 only, and basic NetHack features.
|
||||
|
||||
Supported windowing systems:
|
||||
|
||||
"tty" (traditional text with optional line-drawing), "curses"
|
||||
(terminal-based graphics), and "X11", with a default of "tty".
|
||||
|
||||
NetHack 3.7.* uses the 'Lua' interpreter to process some data:
|
||||
|
||||
:LUACOPYRIGHT:
|
||||
|
||||
"Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software."
|
||||
nodlb
|
||||
nodlb
|
||||
@@ -34,11 +34,7 @@
|
||||
#undef CLR
|
||||
#endif
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#define CLR(n) n
|
||||
#else
|
||||
#define CLR(n)
|
||||
#endif
|
||||
|
||||
#if defined(PCHAR_S_ENUM) || defined(PCHAR_PARSE) \
|
||||
|| defined(PCHAR_DRAWING) || defined(PCHAR_TILES)
|
||||
|
||||
@@ -1046,12 +1046,10 @@ typedef struct {
|
||||
glyph_info glyphinfo;
|
||||
} gbuf_entry;
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
extern const int altarcolors[];
|
||||
extern const int zapcolors[];
|
||||
extern const int explodecolors[];
|
||||
extern int wallcolors[];
|
||||
#endif
|
||||
|
||||
/* If TILES_IN_GLYPHMAP is defined during build, this is defined
|
||||
* in the generated tile.c, complete with appropriate tile references in
|
||||
|
||||
@@ -246,7 +246,6 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef MSDOS
|
||||
#define TEXTCOLOR /* */
|
||||
#define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */
|
||||
#endif
|
||||
|
||||
@@ -288,9 +287,7 @@
|
||||
#endif
|
||||
#endif
|
||||
#define ASCIIGRAPH
|
||||
#ifdef TEXTCOLOR
|
||||
#define VIDEOSHADES
|
||||
#endif
|
||||
/* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead
|
||||
*/
|
||||
#if defined(SCREEN_8514)
|
||||
|
||||
@@ -60,9 +60,7 @@ struct permonst {
|
||||
mflags2; /* more boolean bitflags */
|
||||
unsigned short mflags3; /* yet more boolean bitflags */
|
||||
uchar difficulty; /* toughness (formerly from makedefs -m) */
|
||||
#ifdef TEXTCOLOR
|
||||
uchar mcolor; /* color to use */
|
||||
#endif
|
||||
};
|
||||
|
||||
extern NEARDATA struct permonst mons[]; /* the master list of monster types */
|
||||
|
||||
@@ -52,9 +52,7 @@ enum symset_handling_types {
|
||||
struct symdef {
|
||||
uchar sym;
|
||||
const char *explanation;
|
||||
#ifdef TEXTCOLOR
|
||||
uchar color;
|
||||
#endif
|
||||
};
|
||||
|
||||
enum symparse_range {
|
||||
|
||||
@@ -47,12 +47,10 @@ extern struct tc_lcl_data { /* defined and set up in termcap.c */
|
||||
|
||||
extern short ospeed; /* set up in termcap.c */
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#ifdef TOS
|
||||
extern const char *hilites[CLR_MAX];
|
||||
#else
|
||||
extern NEARDATA char *hilites[CLR_MAX];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* TCAP_H */
|
||||
|
||||
@@ -55,11 +55,6 @@
|
||||
* particular, it should NOT be defined for the UNIXPC
|
||||
* unless you remove the use of the shared library in
|
||||
* the Makefile */
|
||||
#define TEXTCOLOR /* Use System V r3.2 terminfo color support
|
||||
* and/or ANSI color support on termcap systems
|
||||
* and/or X11 color. Note: if you get compiler
|
||||
* warnings about 'has_colors()' being implicitly
|
||||
* declared, uncomment NEED_HAS_COLORS_DECL below. */
|
||||
#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 */
|
||||
@@ -365,7 +360,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Relevant for some systems which enable TEXTCOLOR: some older versions
|
||||
/* Relevant for some systems: some older versions
|
||||
of curses (the run-time library optionally used by nethack's tty
|
||||
interface in addition to its curses interface) supply 'has_colors()'
|
||||
but corresponding <curses.h> doesn't declare it. has_colors() is used
|
||||
|
||||
@@ -92,17 +92,6 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then
|
||||
*/
|
||||
#define SELECTSAVED
|
||||
|
||||
/*
|
||||
* You may define TEXTCOLOR if your system has any terminals that recognize
|
||||
* ANSI color sequences of the form ``<ESCAPE>[#;#m'', where the first # is
|
||||
* a number between 40 and 47 represented background color, and the second
|
||||
* # is a number between 30 and 37 representing the foreground color.
|
||||
* GIGI terminals and DECterm windows on color VAXstations support these
|
||||
* color escape sequences, as do some 3rd party terminals and many micro
|
||||
* computers.
|
||||
*/
|
||||
/* #define TEXTCOLOR */
|
||||
|
||||
/*
|
||||
* If you define USE_QIO_INPUT, then you'll get raw characters from the
|
||||
* keyboard, not unlike those of the unix version of Nethack. This will
|
||||
|
||||
@@ -49,7 +49,6 @@ typedef unsigned char X11_color;
|
||||
#endif
|
||||
struct text_map_info_t {
|
||||
X11_map_symbol text[ROWNO][COLNO]; /* Actual displayed screen. */
|
||||
#ifdef TEXTCOLOR
|
||||
X11_color colors[ROWNO][COLNO]; /* Color of each character. */
|
||||
X11_color framecolors[ROWNO][COLNO]; /* Color of background
|
||||
behind text */
|
||||
@@ -57,7 +56,8 @@ struct text_map_info_t {
|
||||
inv_color_gcs[CLR_MAX]; /* GC for each inverse color */
|
||||
#define copy_gc color_gcs[NO_COLOR]
|
||||
#define inv_copy_gc inv_color_gcs[NO_COLOR]
|
||||
#else
|
||||
#if 0
|
||||
/* was else from old textcolor days */
|
||||
GC copy_gc, /* Drawing GC */
|
||||
inv_copy_gc; /* Inverse drawing GC */
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,6 @@ extern WINDOW *mapwin, *statuswin, *messagewin; /* Main windows */
|
||||
extern WINDOW *activemenu; /* curses window for menu requesting a
|
||||
* count; affects count_window refresh */
|
||||
|
||||
#define TEXTCOLOR /* Allow color */
|
||||
#define NHW_END 19
|
||||
#define OFF 0
|
||||
#define ON 1
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
/* #define SHELL */ /* nt use of pcsys routines caused a hang */
|
||||
|
||||
#define TEXTCOLOR /* Color text */
|
||||
|
||||
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
|
||||
#define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */
|
||||
|
||||
|
||||
@@ -90,10 +90,8 @@ struct WinDesc {
|
||||
struct DisplayDesc {
|
||||
short rows, cols; /* width and height of tty display */
|
||||
short curx, cury; /* current cursor position on the screen */
|
||||
#ifdef TEXTCOLOR
|
||||
int color; /* current color */
|
||||
uint32 framecolor; /* current background color */
|
||||
#endif
|
||||
int attrs; /* attributes in effect */
|
||||
int toplin; /* flag for topl stuff */
|
||||
int rawprint; /* number of raw_printed lines since synch */
|
||||
@@ -187,11 +185,9 @@ extern void term_end_attr(int attr);
|
||||
extern void term_start_raw_bold(void);
|
||||
extern void term_end_raw_bold(void);
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
extern void term_end_color(void);
|
||||
extern void term_start_color(int color);
|
||||
extern void term_start_bgcolor(int color);
|
||||
#endif /* TEXTCOLOR */
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
extern void term_start_24bitcolor(struct unicode_representation *);
|
||||
extern void term_end_24bitcolor(void); /* termcap.c, consoletty.c */
|
||||
|
||||
@@ -113,7 +113,6 @@ matrix:
|
||||
sed -i '/^#define MAIL/d' include/unixconf.h
|
||||
sed -i '/^#define SHELL/d' include/unixconf.h
|
||||
sed -i '/^#define SUSPEND/d' include/unixconf.h
|
||||
sed -i 's/^#define TEXTCOLOR//' include/unixconf.h
|
||||
make fetch-lua LUA_VERSION=$LUA_VERSION
|
||||
test -d "lib/lua-$LUA_VERSION/src" || exit 0
|
||||
make LUA_VERSION=$LUA_VERSION WANT_WIN_ALL=1 install
|
||||
|
||||
@@ -147,7 +147,6 @@ extern char *gets(char *);
|
||||
* (Possibly) configurable Amiga options:
|
||||
*/
|
||||
|
||||
#define TEXTCOLOR /* Use colored monsters and objects */
|
||||
#define HACKFONT /* Use special hack.font */
|
||||
#ifndef CROSS_TO_AMIGA /* issues with prototype and spawnl */
|
||||
#define SHELL /* Have a shell escape command (!) */
|
||||
@@ -164,13 +163,7 @@ extern char *gets(char *);
|
||||
#endif
|
||||
|
||||
#define CHANGE_COLOR 1
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#define DEPTH 6 /* Maximum depth of the screen allowed */
|
||||
#else
|
||||
#define DEPTH 2 /* Four colors...sigh... */
|
||||
#endif
|
||||
|
||||
#define AMII_MAXCOLORS (1L << DEPTH)
|
||||
typedef unsigned short AMII_COLOR_TYPE;
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#define tgetch getchar
|
||||
#define FCMASK 0666
|
||||
#define PORT_ID "BeOS"
|
||||
#define TEXTCOLOR
|
||||
#define POSIX_TYPES
|
||||
#define SIG_RET_TYPE __signal_func_ptr
|
||||
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
#define NO_SIGNAL /* You wouldn't believe our signals ... */
|
||||
#define FILENAME 256
|
||||
#define NO_TERMS /* For tty port (see wintty.h) */
|
||||
|
||||
#define TEXTCOLOR /* For Mac TTY interface */
|
||||
#define CHANGE_COLOR
|
||||
|
||||
/* Use these two includes instead of system.h. */
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#define SHELL /* shell escape */
|
||||
/* #define TERMLIB /* use termcap file */
|
||||
#define ANSI_DEFAULT /* allows NetHack to run without termcap file */
|
||||
#define TEXTCOLOR /* allow color */
|
||||
|
||||
/*
|
||||
* The remaining code shouldn't need modification.
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#define RANDOM /* improved random numbers */
|
||||
#define SHELL /* allow spawning of shell */
|
||||
#define TERMLIB /* use termcap */
|
||||
#define TEXTCOLOR /* allow color */
|
||||
#define MAIL /* enable the fake maildemon */
|
||||
#ifdef MINT
|
||||
#define SUSPEND /* allow suspending the game */
|
||||
@@ -75,9 +74,7 @@ extern int strncmpi(const char *, const char *, size_t);
|
||||
#include "pcconf.h" /* remainder of stuff is same as the PC */
|
||||
#endif
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
extern boolean colors_changed; /* in tos.c */
|
||||
#endif
|
||||
|
||||
#endif /* TOSCONF_H */
|
||||
#endif /* TOS */
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
/* #define SHELL /* nt use of pcsys routines caused a hang */
|
||||
|
||||
#define RANDOM /* have Berkeley random(3) */
|
||||
#define TEXTCOLOR /* Color text */
|
||||
|
||||
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
|
||||
#define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */
|
||||
|
||||
@@ -932,7 +932,6 @@ struct amii_glyph_node {
|
||||
static struct amii_glyph_node amii_g_nodes[NUMBER_GLYPH_NODES];
|
||||
static char amii_glyph_buffer[GLYPH_BUFFER_SIZE];
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/*
|
||||
* Map our amiga-specific colormap into the colormap specified in color.h.
|
||||
* See winami.c for the amiga specific colormap.
|
||||
@@ -963,7 +962,6 @@ int backg[AMII_MAXCOLORS] = {
|
||||
#define CLR_WHITE 15
|
||||
#define CLR_MAX 16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TESTING
|
||||
/*
|
||||
@@ -1062,13 +1060,8 @@ int color_index, glyph;
|
||||
curx = cw->curx;
|
||||
cury = cw->cury;
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
fg_color = foreg[color_index];
|
||||
bg_color = backg[color_index];
|
||||
#else
|
||||
fg_color = 1;
|
||||
bg_color = 0;
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
/* See if we have enough character buffer space... */
|
||||
if (glyph_buffer_index >= GLYPH_BUFFER_SIZE)
|
||||
|
||||
@@ -68,11 +68,7 @@ int dir;
|
||||
return;
|
||||
|
||||
if (!WINVERS_AMIV) {
|
||||
#ifdef TEXTCOLOR
|
||||
amii_numcolors = 8;
|
||||
#else
|
||||
amii_numcolors = 4;
|
||||
#endif
|
||||
amii_defpens[0] = C_BLACK; /* DETAILPEN */
|
||||
amii_defpens[1] = C_BLUE; /* BLOCKPEN */
|
||||
amii_defpens[2] = C_BROWN; /* TEXTPEN */
|
||||
@@ -1225,11 +1221,7 @@ char **argv;
|
||||
/* While openscreen fails try fewer colors to see if that is the problem.
|
||||
*/
|
||||
while ((HackScreen = OpenScreen((void *) &NewHackScreen)) == NULL) {
|
||||
#ifdef TEXTCOLOR
|
||||
if (--NewHackScreen.Depth < 3)
|
||||
#else
|
||||
if (--NewHackScreen.Depth < 2)
|
||||
#endif
|
||||
Abort(AN_OpenScreen & ~AT_DeadEnd);
|
||||
}
|
||||
amii_numcolors = 1L << NewHackScreen.Depth;
|
||||
@@ -2017,15 +2009,11 @@ if(u.uz.dlevel != x){
|
||||
/* Move the cursor. */
|
||||
amii_curs(win, x, y + 2);
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/* Turn off color if rogue level. */
|
||||
if (Is_rogue_level(&u.uz))
|
||||
color = NO_COLOR;
|
||||
|
||||
amiga_print_glyph(win, color, ch);
|
||||
#else
|
||||
g_putch(ch); /* print the character */
|
||||
#endif
|
||||
cw->curx++; /* one character over */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,7 @@ static char DOSgetch(void);
|
||||
static char BIOSgetch(void);
|
||||
static void init_aline(void);
|
||||
char *_a_line; /* for Line A variables */
|
||||
#ifdef TEXTCOLOR
|
||||
boolean colors_changed = FALSE;
|
||||
#endif
|
||||
|
||||
int
|
||||
tgetch()
|
||||
@@ -312,7 +310,6 @@ init_aline()
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/* used in termcap.c to decide how to set up the hilites */
|
||||
unsigned long tos_numcolors = 2;
|
||||
|
||||
@@ -343,7 +340,6 @@ restore_colors()
|
||||
nh_HE = plainHE;
|
||||
colors_changed = FALSE;
|
||||
}
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
#ifdef SUSPEND
|
||||
|
||||
|
||||
@@ -861,8 +861,6 @@ void
|
||||
nhglyph2charcolor(short g, uchar *ch, int *color)
|
||||
{
|
||||
int offset;
|
||||
#ifdef TEXTCOLOR
|
||||
|
||||
#define zap_color(n) *color = iflags.use_color ? zapcolors[n] : NO_COLOR
|
||||
#define cmap_color(n) *color = iflags.use_color ? defsyms[n].color : NO_COLOR
|
||||
#define obj_color(n) \
|
||||
@@ -872,17 +870,6 @@ nhglyph2charcolor(short g, uchar *ch, int *color)
|
||||
#define warn_color(n) \
|
||||
*color = iflags.use_color ? def_warnsyms[n].color : NO_COLOR
|
||||
|
||||
#else /* no text color */
|
||||
|
||||
#define zap_color(n)
|
||||
#define cmap_color(n)
|
||||
#define obj_color(n)
|
||||
#define mon_color(n)
|
||||
#define pet_color(c)
|
||||
#define warn_color(c)
|
||||
*color = CLR_WHITE;
|
||||
#endif
|
||||
|
||||
if ((offset = (g - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */
|
||||
*ch = showsyms[offset + SYM_OFF_W];
|
||||
warn_color(offset);
|
||||
|
||||
@@ -1623,7 +1623,6 @@ void NetHackQtMapWindow::mousePressEvent(QMouseEvent* event)
|
||||
qApp->exit_loop();
|
||||
}
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
static
|
||||
const QPen& nhcolor_to_pen(int c)
|
||||
{
|
||||
@@ -1651,7 +1650,6 @@ const QPen& nhcolor_to_pen(int c)
|
||||
|
||||
return pen[c];
|
||||
}
|
||||
#endif
|
||||
|
||||
void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
@@ -1710,9 +1708,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
/* map glyph to character and color */
|
||||
(void)mapglyph(g, &och, &color, &special, i, j, 0);
|
||||
ch = (uchar)och;
|
||||
#ifdef TEXTCOLOR
|
||||
painter.setPen( nhcolor_to_pen(color) );
|
||||
#endif
|
||||
painter.drawText(
|
||||
i*qt_settings->glyphs().width(),
|
||||
j*qt_settings->glyphs().height(),
|
||||
@@ -1722,10 +1718,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
(const char*)&ch, 1
|
||||
);
|
||||
if (glyph_is_pet(g)
|
||||
#ifdef TEXTCOLOR
|
||||
&& ::iflags.hilite_pet
|
||||
#endif
|
||||
) {
|
||||
&& ::iflags.hilite_pet) {
|
||||
painter.drawPixmap(QPoint(i*qt_settings->glyphs().width(),
|
||||
j*qt_settings->glyphs().height()),
|
||||
pet_annotation);
|
||||
@@ -1740,10 +1733,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
unsigned short g=Glyph(i,j);
|
||||
qt_settings->glyphs().drawCell(painter, g, i, j);
|
||||
if (glyph_is_pet(g)
|
||||
#ifdef TEXTCOLOR
|
||||
&& ::iflags.hilite_pet
|
||||
#endif
|
||||
) {
|
||||
&& ::iflags.hilite_pet) {
|
||||
painter.drawPixmap(QPoint(i*qt_settings->glyphs().width(),
|
||||
j*qt_settings->glyphs().height()),
|
||||
pet_annotation);
|
||||
@@ -1754,11 +1744,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
|
||||
if (garea.contains(cursor)) {
|
||||
if (Is_rogue_level(&u.uz)) {
|
||||
#ifdef TEXTCOLOR
|
||||
painter.setPen( white );
|
||||
#else
|
||||
painter.setPen( green ); // REALLY primitive
|
||||
#endif
|
||||
} else
|
||||
{
|
||||
int hp100;
|
||||
|
||||
@@ -912,9 +912,7 @@ int glyph, bkglyph;
|
||||
if (mar_set_tile_mode(-1)) {
|
||||
mar_print_glyph(window, x, y, glyph2tile[glyph], glyph2tile[bkglyph]);
|
||||
if (
|
||||
#ifdef TEXTCOLOR
|
||||
iflags.hilite_pet &&
|
||||
#endif
|
||||
glyph_is_pet(glyph))
|
||||
mar_add_pet_sign(window, x, y);
|
||||
} else
|
||||
@@ -936,11 +934,9 @@ int glyph;
|
||||
/* map glyph to character and color */
|
||||
(void) mapglyph(glyph, &ch, &color, &special, x, y, 0);
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/* Turn off color if rogue level. */
|
||||
if (Is_rogue_level(&u.uz))
|
||||
color = NO_COLOR;
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
mar_print_char(window, x, y, ch, color);
|
||||
}
|
||||
|
||||
@@ -358,11 +358,7 @@ ghack_map_print_glyph(GtkObject *win, guint x, guint y, GdkImlibImage *im,
|
||||
if (x == u.ux && y == u.uy)
|
||||
ghack_map_cliparound(NULL, x, y, NULL);
|
||||
|
||||
if (glyph_is_pet(glyph)
|
||||
#ifdef TEXTCOLOR
|
||||
&& iflags.hilite_pet
|
||||
#endif
|
||||
) {
|
||||
if (glyph_is_pet(glyph) && iflags.hilite_pet) {
|
||||
gnome_canvas_item_raise_to_top(GNOME_CANVAS_ITEM(canvas_image));
|
||||
gnome_canvas_item_show(GNOME_CANVAS_ITEM(canvas_image));
|
||||
} else {
|
||||
|
||||
@@ -2457,7 +2457,6 @@ map_glyphinfo(
|
||||
* as well as to regular display.)
|
||||
*/
|
||||
if (is_you) {
|
||||
#ifdef TEXTCOLOR
|
||||
if (!iflags.use_color || Upolyd || glyph != hero_glyph) {
|
||||
; /* color tweak not needed (!use_color) or not wanted (poly'd
|
||||
or riding--which uses steed's color, not hero's) */
|
||||
@@ -2471,7 +2470,6 @@ map_glyphinfo(
|
||||
by newsym()); we change the color to same as human hero */
|
||||
glyphinfo->gm.sym.color = HI_DOMESTIC;
|
||||
}
|
||||
#endif
|
||||
/* accessibility
|
||||
This unchanging display character for hero was requested by
|
||||
a blind player to enhance screen reader use.
|
||||
@@ -2495,7 +2493,6 @@ map_glyphinfo(
|
||||
glyphinfo->glyph = glyph;
|
||||
}
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/*
|
||||
* This must be the same order as used for buzz() in zap.c.
|
||||
* The zap_color_ and altar_color_ enums are in decl.h.
|
||||
@@ -2522,9 +2519,6 @@ int wallcolors[sokoban_walls + 1] = {
|
||||
/* CLR_GRAY, CLR_BROWN, CLR_RED, CLR_GRAY, CLR_BRIGHT_BLUE, */
|
||||
};
|
||||
|
||||
#endif /* text color */
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#define zap_color(n) color = iflags.use_color ? zapcolors[n] : NO_COLOR
|
||||
#define cmap_color(n) color = iflags.use_color ? defsyms[n].color : NO_COLOR
|
||||
#define obj_color(n) color = iflags.use_color ? objects[n].oc_color : NO_COLOR
|
||||
@@ -2537,19 +2531,6 @@ int wallcolors[sokoban_walls + 1] = {
|
||||
color = iflags.use_color ? explodecolors[n] : NO_COLOR
|
||||
#define wall_color(n) color = iflags.use_color ? wallcolors[n] : NO_COLOR
|
||||
#define altar_color(n) color = iflags.use_color ? altarcolors[n] : NO_COLOR
|
||||
#else /* no text color */
|
||||
|
||||
#define zap_color(n)
|
||||
#define cmap_color(n)
|
||||
#define obj_color(n)
|
||||
#define mon_color(n)
|
||||
#define invis_color(n)
|
||||
#define pet_color(c)
|
||||
#define warn_color(n)
|
||||
#define explode_color(n)
|
||||
#define wall_color(n)
|
||||
#define altar_color(n)
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define is_objpile(x, y) \
|
||||
@@ -2797,13 +2778,11 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
|
||||
*/
|
||||
if (has_rogue_color) {
|
||||
color = cmap_to_roguecolor(cmap);
|
||||
#ifdef TEXTCOLOR
|
||||
/* provide a visible difference if normal and lit corridor
|
||||
use the same symbol */
|
||||
} else if (cmap == S_litcorr
|
||||
&& sym == gs.showsyms[S_corr + SYM_OFF_P]) {
|
||||
color = CLR_WHITE;
|
||||
#endif
|
||||
/* likewise for corridor and engraving-in-corridor */
|
||||
} else if (cmap == S_engrcorr
|
||||
&& (sym == gs.showsyms[S_corr + SYM_OFF_P]
|
||||
@@ -2940,13 +2919,11 @@ reset_glyphmap(enum glyphmap_change_triggers trigger)
|
||||
if (gs.showsyms[pet_override] != ' ')
|
||||
gmap->sym.symidx = SYM_PET_OVERRIDE + SYM_OFF_X;
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
/* Turn off color if no color defined, or rogue level w/o PC graphics.
|
||||
*/
|
||||
if ((!has_color(color)
|
||||
|| ((gg.glyphmap_perlevel_flags & GMAP_ROGUELEVEL)
|
||||
&& !has_rogue_color)) || !iflags.use_color)
|
||||
#endif
|
||||
color = NO_COLOR;
|
||||
gmap->sym.color = color;
|
||||
}
|
||||
|
||||
@@ -14,12 +14,7 @@
|
||||
#ifdef C
|
||||
#undef C
|
||||
#endif
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#define C(n) n
|
||||
#else
|
||||
#define C(n)
|
||||
#endif
|
||||
|
||||
/* Default object class symbols. See objclass.h.
|
||||
* {symbol, name, explain}
|
||||
@@ -70,11 +65,7 @@ const struct symdef defsyms[MAXPCHARS + 1] = {
|
||||
#define PCHAR_DRAWING
|
||||
#include "defsym.h"
|
||||
#undef PCHAR_DRAWING
|
||||
{ 0, NULL
|
||||
#ifdef TEXTCOLOR
|
||||
, NO_COLOR
|
||||
#endif
|
||||
}
|
||||
{ 0, NULL, NO_COLOR }
|
||||
};
|
||||
|
||||
/* default rogue level symbols */
|
||||
|
||||
@@ -279,9 +279,7 @@ make_version(void)
|
||||
#endif
|
||||
/* objects (10..14) */
|
||||
/* flag bits and/or other global variables (15..26) */
|
||||
#ifdef TEXTCOLOR
|
||||
| (1L << 17)
|
||||
#endif
|
||||
/* color support always*/ | (1L << 17)
|
||||
#ifdef INSURANCE
|
||||
| (1L << 18)
|
||||
#endif
|
||||
@@ -501,9 +499,7 @@ static const char *const build_opts[] = {
|
||||
#ifdef ANSI_DEFAULT
|
||||
"ANSI default terminal",
|
||||
#endif
|
||||
#ifdef TEXTCOLOR
|
||||
"color",
|
||||
#endif
|
||||
#ifdef TTY_GRAPHICS
|
||||
#ifdef TTY_TILES_ESCCODES
|
||||
"console escape codes for tile hinting",
|
||||
|
||||
@@ -11,12 +11,8 @@
|
||||
#ifdef C
|
||||
#undef C
|
||||
#endif
|
||||
#ifdef TEXTCOLOR
|
||||
#include "color.h"
|
||||
#define C(color) color
|
||||
#else
|
||||
#define C(color)
|
||||
#endif
|
||||
|
||||
#define NO_ATTK \
|
||||
{ \
|
||||
|
||||
57
src/muse.c
57
src/muse.c
@@ -3053,9 +3053,11 @@ cures_sliming(struct monst *mon, struct obj *obj)
|
||||
&& obj->spe > 0);
|
||||
}
|
||||
|
||||
/* TRUE if monster appears to be green; for active TEXTCOLOR, we go by
|
||||
the display color, otherwise we just pick things that seem plausibly
|
||||
green (which doesn't necessarily match the TEXTCOLOR categorization) */
|
||||
/* TRUE if monster appears to be green; we go by the display color.
|
||||
The alternative was to just pick things that
|
||||
seem plausibly green (which didn't necessarily match the categorization
|
||||
by the color of the text).
|
||||
iflags.use_color is not meant for game behavior decisions */
|
||||
static boolean
|
||||
green_mon(struct monst *mon)
|
||||
{
|
||||
@@ -3063,34 +3065,37 @@ green_mon(struct monst *mon)
|
||||
|
||||
if (Hallucination)
|
||||
return FALSE;
|
||||
#ifdef TEXTCOLOR
|
||||
return (ptr->mcolor == CLR_GREEN || ptr->mcolor == CLR_BRIGHT_GREEN);
|
||||
#if 0
|
||||
if (iflags.use_color)
|
||||
return (ptr->mcolor == CLR_GREEN || ptr->mcolor == CLR_BRIGHT_GREEN);
|
||||
#endif
|
||||
/* approximation */
|
||||
if (strstri(ptr->pmnames[NEUTRAL], "green")
|
||||
|| (ptr->pmnames[MALE] && strstri(ptr->pmnames[MALE], "green"))
|
||||
|| (ptr->pmnames[FEMALE] && strstri(ptr->pmnames[FEMALE], "green")))
|
||||
return TRUE;
|
||||
switch (monsndx(ptr)) {
|
||||
case PM_FOREST_CENTAUR:
|
||||
case PM_GARTER_SNAKE:
|
||||
case PM_GECKO:
|
||||
case PM_GREMLIN:
|
||||
case PM_HOMUNCULUS:
|
||||
case PM_JUIBLEX:
|
||||
case PM_LEPRECHAUN:
|
||||
case PM_LICHEN:
|
||||
case PM_LIZARD:
|
||||
case PM_WOOD_NYMPH:
|
||||
return TRUE;
|
||||
default:
|
||||
if (is_elf(ptr) && !is_prince(ptr) && !is_lord(ptr)
|
||||
&& ptr != &mons[PM_GREY_ELF])
|
||||
else {
|
||||
/* approximation */
|
||||
if (strstri(ptr->pmnames[NEUTRAL], "green")
|
||||
|| (ptr->pmnames[MALE] && strstri(ptr->pmnames[MALE], "green"))
|
||||
|| (ptr->pmnames[FEMALE] && strstri(ptr->pmnames[FEMALE], "green")))
|
||||
return TRUE;
|
||||
break;
|
||||
switch (monsndx(ptr)) {
|
||||
case PM_FOREST_CENTAUR:
|
||||
case PM_GARTER_SNAKE:
|
||||
case PM_GECKO:
|
||||
case PM_GREMLIN:
|
||||
case PM_HOMUNCULUS:
|
||||
case PM_JUIBLEX:
|
||||
case PM_LEPRECHAUN:
|
||||
case PM_LICHEN:
|
||||
case PM_LIZARD:
|
||||
case PM_WOOD_NYMPH:
|
||||
return TRUE;
|
||||
default:
|
||||
if (is_elf(ptr) && !is_prince(ptr) && !is_lord(ptr)
|
||||
&& ptr != &mons[PM_GREY_ELF])
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*muse.c*/
|
||||
|
||||
@@ -120,12 +120,8 @@ init_objects(void)
|
||||
{
|
||||
int i, first, last, prevoclass;
|
||||
char oclass;
|
||||
#ifdef TEXTCOLOR
|
||||
#define COPY_OBJ_DESCR(o_dst, o_src) \
|
||||
o_dst.oc_descr_idx = o_src.oc_descr_idx, o_dst.oc_color = o_src.oc_color
|
||||
#else
|
||||
#define COPY_OBJ_DESCR(o_dst, o_src) o_dst.oc_descr_idx = o_src.oc_descr_idx
|
||||
#endif
|
||||
|
||||
for (i = 0; i <= MAXOCLASSES; i++) {
|
||||
gb.bases[i] = 0;
|
||||
|
||||
@@ -110,7 +110,7 @@ static struct allopt_t allopt[SIZE(allopt_init)];
|
||||
|
||||
extern char configfile[]; /* for messages */
|
||||
extern const struct symparse loadsyms[];
|
||||
#if defined(TOS) && defined(TEXTCOLOR)
|
||||
#if defined(TOS)
|
||||
extern boolean colors_changed; /* in tos.c */
|
||||
#endif
|
||||
#ifdef VIDEOSHADES
|
||||
@@ -6755,9 +6755,7 @@ initoptions_init(void)
|
||||
if (!gs.symset[ROGUESET].explicitly)
|
||||
load_symset("RogueIBM", ROGUESET);
|
||||
switch_symbols(TRUE);
|
||||
#ifdef TEXTCOLOR
|
||||
iflags.use_color = TRUE;
|
||||
#endif
|
||||
}
|
||||
#endif /* UNIX && TTY_GRAPHICS */
|
||||
#if defined(UNIX) || defined(VMS)
|
||||
|
||||
@@ -1361,14 +1361,12 @@ dump_redirect(boolean onoff_flag)
|
||||
}
|
||||
|
||||
#ifdef TTY_GRAPHICS
|
||||
#ifdef TEXTCOLOR
|
||||
#ifdef TOS
|
||||
extern const char *hilites[CLR_MAX];
|
||||
#else
|
||||
extern NEARDATA char *hilites[CLR_MAX];
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int
|
||||
has_color(int color)
|
||||
@@ -1376,7 +1374,7 @@ has_color(int color)
|
||||
return (iflags.use_color && windowprocs.name
|
||||
&& (windowprocs.wincap & WC_COLOR) && windowprocs.has_color[color]
|
||||
#ifdef TTY_GRAPHICS
|
||||
#if defined(TEXTCOLOR) && defined(TERMLIB) && !defined(NO_TERMS)
|
||||
#if defined(TERMLIB) && !defined(NO_TERMS)
|
||||
&& (hilites[color] != 0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2223,9 +2223,7 @@ bhito(struct obj *obj, struct obj *otmp)
|
||||
case WAN_CANCELLATION:
|
||||
case SPE_CANCELLATION:
|
||||
cancel_item(obj);
|
||||
#ifdef TEXTCOLOR
|
||||
newsym(obj->ox, obj->oy); /* might change color */
|
||||
#endif
|
||||
break;
|
||||
case SPE_DRAIN_LIFE:
|
||||
(void) drain_item(obj, TRUE);
|
||||
|
||||
@@ -136,9 +136,7 @@ int attrib_gr_intense; /* graphics mode intense attribute */
|
||||
uint32 curframecolor = NO_COLOR; /* current background text color */
|
||||
boolean traditional = FALSE; /* traditonal TTY character mode */
|
||||
boolean inmap = FALSE; /* in the map window */
|
||||
#ifdef TEXTCOLOR
|
||||
char ttycolors[CLR_MAX]; /* also used/set in options.c */
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
void
|
||||
backsp(void)
|
||||
@@ -233,11 +231,7 @@ int
|
||||
has_color(int color)
|
||||
{
|
||||
++color; /* prevents compiler warning (unref. param) */
|
||||
#ifdef TEXTCOLOR
|
||||
return (monoflag) ? 0 : 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -357,7 +351,6 @@ term_start_attr(int attr)
|
||||
void
|
||||
term_start_color(int color)
|
||||
{
|
||||
#ifdef TEXTCOLOR
|
||||
if (monoflag) {
|
||||
g_attribute = attrib_text_normal;
|
||||
} else {
|
||||
@@ -368,19 +361,16 @@ term_start_color(int color)
|
||||
g_attribute = ttycolors[color];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
term_start_bgcolor(int bgcolor)
|
||||
{
|
||||
// pline("before bgcolor = %d, curframecolor = %d", bgcolor, curframecolor);
|
||||
#ifdef TEXTCOLOR
|
||||
if (!monoflag) {
|
||||
if (bgcolor >= 0 && bgcolor < CLR_MAX)
|
||||
curframecolor = bgcolor;
|
||||
}
|
||||
#endif
|
||||
// pline("after bgcolor = %d, curframecolor = %d", bgcolor, curframecolor);
|
||||
}
|
||||
|
||||
@@ -466,9 +456,7 @@ tty_startup(int *wid, int *hgt)
|
||||
setclipped();
|
||||
#endif
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
init_ttycolor();
|
||||
#endif
|
||||
|
||||
#ifdef MONO_CHECK
|
||||
monoflag = txt_monoadapt_check();
|
||||
@@ -704,7 +692,6 @@ HideCursor(void)
|
||||
|
||||
#endif /* SIMULATE_CURSOR */
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/*
|
||||
* CLR_BLACK 0
|
||||
* CLR_RED 1
|
||||
@@ -928,7 +915,6 @@ convert_uchars(char *bufp, /* current pointer */
|
||||
}
|
||||
|
||||
#endif /* VIDEOSHADES */
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
/*
|
||||
* Process defaults.nh OPTIONS=video:xxxx
|
||||
|
||||
@@ -279,7 +279,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(TOS) && defined(TEXTCOLOR)
|
||||
#if defined(TOS)
|
||||
if (iflags.BIOS && iflags.use_color)
|
||||
set_colors();
|
||||
#endif
|
||||
|
||||
@@ -273,10 +273,8 @@ msexit(void)
|
||||
#ifdef TOS
|
||||
if (run_from_desktop)
|
||||
getreturn("to continue"); /* so the user can read the score list */
|
||||
#ifdef TEXTCOLOR
|
||||
if (colors_changed)
|
||||
restore_colors();
|
||||
#endif
|
||||
#endif
|
||||
wait_synch();
|
||||
return;
|
||||
|
||||
@@ -393,10 +393,8 @@ init_sco_cons(void)
|
||||
load_symset("IBMGraphics", PRIMARYSET);
|
||||
load_symset("RogueIBM", ROGUESET);
|
||||
switch_symbols(TRUE);
|
||||
#ifdef TEXTCOLOR
|
||||
if (has_colors())
|
||||
iflags.use_color = TRUE;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -450,10 +448,8 @@ init_linux_cons(void)
|
||||
if (WINDOWPORT(tty) && linux_flag_console) {
|
||||
atexit(linux_mapon);
|
||||
linux_mapoff();
|
||||
#ifdef TEXTCOLOR
|
||||
if (has_colors())
|
||||
iflags.use_color = TRUE;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -229,10 +229,11 @@ Notes:
|
||||
config.h: UNIX, TTY_GRAPHICS
|
||||
unixconf.h: SYSV, SVR4, TERMINFO, POSIX_JOB_CONTROL, POSIX_TYPES
|
||||
|
||||
X11_GRAPHICS does work. You may safely define
|
||||
NETWORK, TEXTCOLOR if desired. Other #defines in these files may be
|
||||
defined too, as needed. Just make sure that the set mentioned here are
|
||||
not misdefined, or your compile will fail (do _not_ define BSD or SUNOS4).
|
||||
X11_GRAPHICS does work. You may safely define NETWORK if desired.
|
||||
Other #defines in these files may be defined too, as needed. Just make
|
||||
sure that the set mentioned here are not misdefined, or your compile
|
||||
will fail (do _not_ define BSD or SUNOS4).
|
||||
|
||||
Unless you are using gzip you will probably want to define COMPRESS to
|
||||
be "/usr/bin/compress".
|
||||
|
||||
|
||||
@@ -61,10 +61,7 @@
|
||||
|
||||
3. Prior to beginning compilation, go to the [.include] subdirectory and
|
||||
edit vmsconf.h according to its comments. You should set Local_WIZARD
|
||||
and Local_HACKDIR to appropriate values, and you might want to define
|
||||
TEXTCOLOR if you have any color VAXstations or color terminals which
|
||||
handle ANSI-format escape sequences to set foreground and background
|
||||
color for text characters. (VT241/VT340 color graphics won't work.)
|
||||
and Local_HACKDIR to appropriate values.
|
||||
Other things which may be of interest are SECURE if you intend to
|
||||
set up NetHack as an installed image which is granted privileges, and
|
||||
SHELL which should be disabled if you intend to allow captive accounts
|
||||
|
||||
@@ -975,18 +975,10 @@ void buffer_write(cell_t * buffer, cell_t * cell, COORD pos)
|
||||
void
|
||||
gettty(void)
|
||||
{
|
||||
#ifndef TEXTCOLOR
|
||||
int k;
|
||||
#endif
|
||||
erase_char = '\b';
|
||||
kill_char = 21; /* cntl-U */
|
||||
iflags.cbreak = TRUE;
|
||||
#ifdef TEXTCOLOR
|
||||
init_ttycolor();
|
||||
#else
|
||||
for (k = 0; k < CLR_MAX; ++k)
|
||||
ttycolors[k] = NO_COLOR;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* reset terminal to original state */
|
||||
@@ -1636,7 +1628,6 @@ tty_delay_output(void)
|
||||
static void
|
||||
init_ttycolor(void)
|
||||
{
|
||||
#ifdef TEXTCOLOR
|
||||
ttycolors[CLR_BLACK] = FOREGROUND_INTENSITY; /* fix by Quietust */
|
||||
ttycolors[CLR_RED] = FOREGROUND_RED;
|
||||
ttycolors[CLR_GREEN] = FOREGROUND_GREEN;
|
||||
@@ -1673,15 +1664,6 @@ init_ttycolor(void)
|
||||
ttycolors_inv[CLR_BRIGHT_CYAN] = BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY;
|
||||
ttycolors_inv[CLR_WHITE] = BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_RED
|
||||
| BACKGROUND_INTENSITY;
|
||||
#else
|
||||
int k;
|
||||
ttycolors[0] = FOREGROUND_INTENSITY;
|
||||
ttycolors_inv[0] = BACKGROUND_INTENSITY;
|
||||
for (k = 1; k < SIZE(ttycolors); ++k) {
|
||||
ttycolors[k] = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED;
|
||||
ttycolors_inv[k] = BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_RED;
|
||||
}
|
||||
#endif
|
||||
init_ttycolor_completed = TRUE;
|
||||
}
|
||||
|
||||
@@ -1765,31 +1747,27 @@ term_start_raw_bold(void)
|
||||
void
|
||||
term_start_color(int color)
|
||||
{
|
||||
#ifdef TEXTCOLOR
|
||||
if (color >= 0 && color < CLR_MAX) {
|
||||
console.current_nhcolor = color;
|
||||
} else
|
||||
#endif
|
||||
console.current_nhcolor = NO_COLOR;
|
||||
} else {
|
||||
console.current_nhcolor = NO_COLOR;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
term_start_bgcolor(int color)
|
||||
{
|
||||
#ifdef TEXTCOLOR
|
||||
if (color >= 0 && color < CLR_MAX) {
|
||||
console.current_nhbkcolor = color;
|
||||
} else
|
||||
#endif
|
||||
console.current_nhbkcolor = NO_COLOR;
|
||||
} else {
|
||||
console.current_nhbkcolor = NO_COLOR;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
term_end_color(void)
|
||||
{
|
||||
#ifdef TEXTCOLOR
|
||||
console.foreground = DEFTEXTCOLOR;
|
||||
#endif
|
||||
#ifndef VIRTUAL_TERMINAL_SEQUENCES
|
||||
console.attr = (console.foreground | console.background);
|
||||
#endif /* ! VIRTUAL_TERMINAL_SEQUENCES */
|
||||
|
||||
@@ -160,11 +160,6 @@ static struct grep_var grep_vars[]={
|
||||
#else
|
||||
{"SUSPEND", 0},
|
||||
#endif
|
||||
#if defined(TEXTCOLOR)
|
||||
{"TEXTCOLOR", 1},
|
||||
#else
|
||||
{"TEXTCOLOR", 0},
|
||||
#endif
|
||||
#if defined(TILES_IN_GLYPHMAP)
|
||||
{"TILES_IN_GLYPHMAP", 1},
|
||||
#else
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
QT_GRAPHICS GNOME_GRAPHICS GEM_GRAPHICS/;
|
||||
|
||||
# Game Features:
|
||||
@feature = qw/ZEROCOMP TILES_IN_GLYPHMAP ASCIIGRAPH CLIPPING TEXTCOLOR
|
||||
@feature = qw/ZEROCOMP TILES_IN_GLYPHMAP ASCIIGRAPH CLIPPING
|
||||
COMPRESS ZLIB_COMP RANDOM SECURE USER_SOUNDS
|
||||
SAFERHANGUP MFLOPPY NOCWD_ASSUMPTIONS
|
||||
VAR_PLAYGROUND DLB SHELL SUSPEND NOSAVEONHANGUP HANGUPHANDLING
|
||||
|
||||
@@ -156,7 +156,6 @@ NetHackQtGlyphs::drawBorderedCell(
|
||||
|
||||
drawGlyph(painter, glyph, tileidx, lox + 1, loy + 1, reversed);
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
if (border != NO_BORDER) {
|
||||
// gray would be a better mid-point between red and cyan but it
|
||||
// doesn't show up well enough against the wall tile background
|
||||
@@ -199,9 +198,6 @@ NetHackQtGlyphs::drawBorderedCell(
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
nhUse(border);
|
||||
#endif
|
||||
}
|
||||
|
||||
// mis-named routine to get the pixmap for a particular glyph
|
||||
|
||||
@@ -77,7 +77,6 @@ extern int qt_compact_mode;
|
||||
|
||||
namespace nethack_qt_ {
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
static const QPen nhcolor_to_pen(uint32_t c)
|
||||
{
|
||||
static QPen *pen = (QPen *) 0;
|
||||
@@ -119,7 +118,6 @@ static const QPen nhcolor_to_pen(uint32_t c)
|
||||
return pen[c];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NetHackQtMapViewport::NetHackQtMapViewport(NetHackQtClickBuffer& click_sink) :
|
||||
QWidget(NULL),
|
||||
@@ -182,10 +180,9 @@ void NetHackQtMapViewport::paintEvent(QPaintEvent* event)
|
||||
painter.begin(this);
|
||||
|
||||
unsigned special, tileidx;
|
||||
#ifdef TEXTCOLOR
|
||||
uint32 color;
|
||||
uint32 framecolor;
|
||||
#endif
|
||||
|
||||
if (Is_rogue_level(&u.uz) || iflags.wc_ascii_map) {
|
||||
// You enter a VERY primitive world!
|
||||
|
||||
@@ -204,12 +201,8 @@ void NetHackQtMapViewport::paintEvent(QPaintEvent* event)
|
||||
if (SYMHANDLING(H_IBM)) {
|
||||
ch = cp437(ch);
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
color = Glyphcolor(i, j);
|
||||
painter.setPen(nhcolor_to_pen(color));
|
||||
#else
|
||||
painter.setPen(Qt::green);
|
||||
#endif
|
||||
if (!DrawWalls(painter, i * gW, j * gH, gW, gH, ch)) {
|
||||
ushort utf16[3];
|
||||
if (ch < 0x10000) {
|
||||
@@ -231,7 +224,6 @@ void NetHackQtMapViewport::paintEvent(QPaintEvent* event)
|
||||
painter.drawPixmap(QPoint(i * gW, j * gH),
|
||||
pile_annotation);
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
framecolor = GlyphFramecolor(i, j);
|
||||
if (framecolor != NO_COLOR) {
|
||||
painter.setPen(nhcolor_to_pen(framecolor));
|
||||
@@ -240,7 +232,6 @@ void NetHackQtMapViewport::paintEvent(QPaintEvent* event)
|
||||
qt_settings->glyphs().width() - 1,
|
||||
qt_settings->glyphs().height() - 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +253,6 @@ void NetHackQtMapViewport::paintEvent(QPaintEvent* event)
|
||||
painter.drawPixmap(QPoint(i * gW, j * gH),
|
||||
pile_annotation);
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
framecolor = GlyphFramecolor(i, j);
|
||||
if (framecolor != NO_COLOR) {
|
||||
painter.setPen(nhcolor_to_pen(framecolor));
|
||||
@@ -271,18 +261,13 @@ void NetHackQtMapViewport::paintEvent(QPaintEvent* event)
|
||||
qt_settings->glyphs().width() - 1,
|
||||
qt_settings->glyphs().height() - 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (garea.contains(cursor)) {
|
||||
if (Is_rogue_level(&u.uz)) {
|
||||
#ifdef TEXTCOLOR
|
||||
painter.setPen( Qt::white );
|
||||
#else
|
||||
painter.setPen( Qt::green ); // REALLY primitive
|
||||
#endif
|
||||
} else {
|
||||
int hp = !Upolyd ? u.uhp : u.mh,
|
||||
hpmax = !Upolyd ? u.uhpmax : u.mhmax,
|
||||
@@ -935,9 +920,7 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
nhcolor_to_pen(framecolor).color());
|
||||
}
|
||||
painter.setPen( Qt::green );
|
||||
#ifdef TEXTCOLOR
|
||||
painter.setPen( nhcolor_to_pen(color) );
|
||||
#endif
|
||||
painter.drawText(
|
||||
i*qt_settings->glyphs().width(),
|
||||
j*qt_settings->glyphs().height(),
|
||||
@@ -946,7 +929,6 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
Qt::AlignCenter,
|
||||
QString(QChar(ch)).left(1)
|
||||
);
|
||||
#ifdef TEXTCOLOR
|
||||
if ((special & MG_PET) != 0 && ::iflags.hilite_pet) {
|
||||
painter.drawPixmap(QPoint(i*qt_settings->glyphs().width(),
|
||||
j*qt_settings->glyphs().height()),
|
||||
@@ -957,7 +939,6 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
j*qt_settings->glyphs().height()),
|
||||
pile_annotation);
|
||||
}
|
||||
#endif
|
||||
if (framecolor != NO_COLOR) {
|
||||
painter.setPen( nhcolor_to_pen(framecolor) );
|
||||
painter.drawRect(i*qt_settings->glyphs().width(),
|
||||
@@ -978,7 +959,6 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
uint32 framecolor = GlyphFramecolor(i,j);
|
||||
|
||||
qt_settings->glyphs().drawCell(painter, g, tileidx, i, j);
|
||||
#ifdef TEXTCOLOR
|
||||
if ((special & MG_PET) != 0 && ::iflags.hilite_pet) {
|
||||
painter.drawPixmap(QPoint(i*qt_settings->glyphs().width(),
|
||||
j*qt_settings->glyphs().height()),
|
||||
@@ -989,7 +969,6 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
j*qt_settings->glyphs().height()),
|
||||
pile_annotation);
|
||||
}
|
||||
#endif
|
||||
if (framecolor != NO_COLOR) {
|
||||
painter.setPen( nhcolor_to_pen(framecolor) );
|
||||
painter.drawRect(i*qt_settings->glyphs().width(),
|
||||
@@ -1003,13 +982,8 @@ void NetHackQtMapWindow::paintEvent(QPaintEvent* event)
|
||||
|
||||
if (garea.contains(cursor)) {
|
||||
if (Is_rogue_level(&u.uz)) {
|
||||
#ifdef TEXTCOLOR
|
||||
painter.setPen( Qt::white );
|
||||
#else
|
||||
painter.setPen( Qt::green ); // REALLY primitive
|
||||
#endif
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
int hp100;
|
||||
if (Upolyd) {
|
||||
hp100=u.mhmax ? u.mh*100/u.mhmax : 100;
|
||||
|
||||
@@ -165,10 +165,8 @@ struct window_procs X11_procs = {
|
||||
* Local functions.
|
||||
*/
|
||||
static winid find_free_window(void);
|
||||
#ifdef TEXTCOLOR
|
||||
static void nhFreePixel(XtAppContext, XrmValuePtr, XtPointer, XrmValuePtr,
|
||||
Cardinal *);
|
||||
#endif
|
||||
static boolean new_resource_macro(String, unsigned);
|
||||
static void load_default_resources(void);
|
||||
static void release_default_resources(void);
|
||||
@@ -708,7 +706,6 @@ load_boldfont(struct xwindow *wp, Widget w)
|
||||
wp->boldfs = XLoadQueryFont(dpy, fontname);
|
||||
}
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
nhFreePixel(
|
||||
@@ -736,7 +733,6 @@ nhFreePixel(
|
||||
(unsigned long *) toVal->addr, 1, (unsigned long) 0);
|
||||
}
|
||||
}
|
||||
#endif /*TEXTCOLOR*/
|
||||
|
||||
/* [ALI] Utility function to ask Xaw for font height, since the previous
|
||||
* assumption of ascent + descent is not always valid.
|
||||
@@ -1622,13 +1618,11 @@ X11_init_nhwindows(int *argcp, char **argv)
|
||||
|
||||
old_error_handler = XSetErrorHandler(panic_on_error);
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/* add new color converter to deal with overused colormaps */
|
||||
XtSetTypeConverter(XtRString, XtRPixel, nhCvtStringToPixel,
|
||||
(XtConvertArgList) nhcolorConvertArgs,
|
||||
XtNumber(nhcolorConvertArgs), XtCacheByDisplay,
|
||||
nhFreePixel);
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
/* Register the actions mentioned in "actions". */
|
||||
XtAppAddActions(app_context, actions, XtNumber(actions));
|
||||
|
||||
@@ -57,13 +57,11 @@ extern int total_tiles_used, Tile_corr;
|
||||
#define COL0_OFFSET 1 /* change to 0 to revert to displaying unused column 0 */
|
||||
|
||||
static X11_map_symbol glyph_char(const glyph_info *glyphinfo);
|
||||
#ifdef TEXTCOLOR
|
||||
static GC X11_make_gc(struct xwindow *wp, struct text_map_info_t *text_map,
|
||||
X11_color color, boolean inverted);
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
static void X11_free_gc(struct xwindow *wp, GC gc, X11_color color);
|
||||
#endif
|
||||
#endif /* TEXTCOLOR */
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
static void X11_set_map_font(struct xwindow *wp);
|
||||
#endif
|
||||
@@ -129,10 +127,8 @@ X11_print_glyph(
|
||||
register X11_map_symbol *ch_ptr;
|
||||
X11_color color;
|
||||
unsigned special;
|
||||
#ifdef TEXTCOLOR
|
||||
int colordif;
|
||||
register X11_color *co_ptr;
|
||||
#endif
|
||||
|
||||
color = glyphinfo->gm.sym.color;
|
||||
special = glyphinfo->gm.glyphflags;
|
||||
@@ -150,7 +146,6 @@ X11_print_glyph(
|
||||
if (!map_info->is_tile)
|
||||
update_bbox = TRUE;
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
co_ptr = &map_info->text_map.colors[y][x];
|
||||
colordif = (((special & MG_PET) != 0 && iflags.hilite_pet)
|
||||
|| ((special & MG_OBJPILE) != 0 && iflags.hilite_pile)
|
||||
@@ -177,7 +172,6 @@ X11_print_glyph(
|
||||
map_info->text_map.framecolors[y][x] = bkglyphinfo->framecolor;
|
||||
update_bbox = TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (update_bbox) { /* update row bbox */
|
||||
@@ -945,7 +939,6 @@ get_text_gc(struct xwindow *wp, Font font)
|
||||
XtSetArg(arg[0], XtNbackground, &bgpixel);
|
||||
XtGetValues(wp->w, arg, ONE);
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#define set_color_gc(nh_color, resource_name) \
|
||||
set_gc(wp->w, font, resource_name, bgpixel, \
|
||||
&map_info->text_map.color_gcs[nh_color], \
|
||||
@@ -967,11 +960,6 @@ get_text_gc(struct xwindow *wp, Font font)
|
||||
set_color_gc(CLR_BRIGHT_MAGENTA, XtNbright_magenta);
|
||||
set_color_gc(CLR_BRIGHT_CYAN, XtNbright_cyan);
|
||||
set_color_gc(CLR_WHITE, XtNwhite);
|
||||
#else
|
||||
set_gc(wp->w, font, XtNforeground, bgpixel,
|
||||
&map_info->text_map.copy_gc,
|
||||
&map_info->text_map.inv_copy_gc);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1071,10 +1059,8 @@ map_all_unexplored(struct map_info_t *map_info) /* [was map_all_stone()] */
|
||||
tile_map->glyphs[y][x].framecolor = NO_COLOR;
|
||||
|
||||
text_map->text[y][x] = (uchar) (!x ? mgnothg : mgunexp);
|
||||
#ifdef TEXTCOLOR
|
||||
text_map->colors[y][x] = NO_COLOR;
|
||||
text_map->framecolors[y][x] = NO_COLOR;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1446,7 +1432,6 @@ map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int s
|
||||
XSetForeground(dpy, tile_map->black_gc,
|
||||
BlackPixelOfScreen(screen));
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
{
|
||||
uint32_t fc = tile_map->glyphs[row][cur_col].framecolor;
|
||||
|
||||
@@ -1457,7 +1442,6 @@ map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int s
|
||||
tile_map->square_width - 1 ,
|
||||
tile_map->square_height - 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1480,7 +1464,6 @@ map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int s
|
||||
} else {
|
||||
struct text_map_info_t *text_map = &map_info->text_map;
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
{
|
||||
register X11_color *c_ptr;
|
||||
X11_map_symbol *t_ptr;
|
||||
@@ -1520,38 +1503,9 @@ map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int s
|
||||
} /* col loop */
|
||||
} /* row loop */
|
||||
}
|
||||
#else /* !TEXTCOLOR */
|
||||
{
|
||||
int win_row, win_xstart;
|
||||
int win_start_row, win_start_col;
|
||||
|
||||
win_start_row = start_row;
|
||||
win_start_col = start_col;
|
||||
|
||||
/* We always start at the same x window position and have
|
||||
the same character count. */
|
||||
win_xstart = text_map->square_lbearing
|
||||
+ ((win_start_col - COL0_OFFSET)
|
||||
* text_map->square_width);
|
||||
count = stop_col - start_col + 1;
|
||||
|
||||
for (row = start_row, win_row = win_start_row; row <= stop_row;
|
||||
row++, win_row++) {
|
||||
X11_draw_image_string(XtDisplay(wp->w), XtWindow(wp->w),
|
||||
inverted ? text_map->inv_copy_gc
|
||||
: text_map->copy_gc,
|
||||
win_xstart,
|
||||
text_map->square_ascent
|
||||
+ (win_row * text_map->square_height),
|
||||
&(text_map->text[row][start_col]),
|
||||
count);
|
||||
}
|
||||
}
|
||||
#endif /* ?TEXTCOLOR */
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
static GC
|
||||
X11_make_gc(
|
||||
struct xwindow *wp UNUSED,
|
||||
@@ -1621,7 +1575,6 @@ X11_free_gc(struct xwindow *wp, GC ggc, X11_color color)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
static void
|
||||
X11_draw_image_string(
|
||||
@@ -1924,17 +1877,12 @@ destroy_map_window(struct xwindow *wp)
|
||||
struct text_map_info_t *text_map = &map_info->text_map;
|
||||
|
||||
/* Free allocated GCs. */
|
||||
#ifdef TEXTCOLOR
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CLR_MAX; i++) {
|
||||
XtReleaseGC(wp->w, text_map->color_gcs[i]);
|
||||
XtReleaseGC(wp->w, text_map->inv_color_gcs[i]);
|
||||
}
|
||||
#else
|
||||
XtReleaseGC(wp->w, text_map->copy_gc);
|
||||
XtReleaseGC(wp->w, text_map->inv_copy_gc);
|
||||
#endif
|
||||
|
||||
/* Free the font structure if we allocated one */
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
|
||||
@@ -300,15 +300,11 @@ HiliteField(Widget label,
|
||||
struct xwindow *xw = xw_status_win;
|
||||
int colr, attr;
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
if ((colrattr & 0x00ff) >= CLR_MAX)
|
||||
/* for !TEXTCOLOR, the following line is unconditional */
|
||||
#endif
|
||||
colrattr = (colrattr & ~0x00ff) | NO_COLOR;
|
||||
colr = colrattr & 0x00ff; /* guaranteed to be >= 0 and < CLR_MAX */
|
||||
attr = (colrattr >> 8) & 0x00ff;
|
||||
|
||||
/* potentially used even for !TEXTCOLOR configuration */
|
||||
if (!grayPxl) {/* one-time init */
|
||||
grayPxl = get_nhcolor(xw, CLR_GRAY).pixel;
|
||||
blackPxl = get_nhcolor(xw, CLR_BLACK).pixel;
|
||||
@@ -524,9 +520,7 @@ tt_reset_color(int fld, int cond, unsigned long *colormasks)
|
||||
if (iflags.hilite_delta != 0L && (X11_condition_bits & bm) != 0) {
|
||||
/* BL_RESET before first BL_CONDITION will have colormasks==Null
|
||||
but condcolor() and condattr() can cope with that */
|
||||
#ifdef TEXTCOLOR
|
||||
colrattr = condcolor(bm, colormasks);
|
||||
#endif
|
||||
colrattr |= (condattr(bm, colormasks) << 8);
|
||||
}
|
||||
label = X11_cond_labels[cond];
|
||||
@@ -724,10 +718,6 @@ X11_status_update_tty(int fld, genericptr_t ptr, int chg UNUSED, int percent,
|
||||
for a field which isn't active */
|
||||
*status_vals[fld] = '\0';
|
||||
}
|
||||
#ifndef TEXTCOLOR
|
||||
/* even without color, attribute(s) bits still apply */
|
||||
color = (color & ~0x00ff) | NO_COLOR;
|
||||
#endif
|
||||
#ifdef STATUS_HILITES
|
||||
if (!iflags.hilite_delta)
|
||||
color = NO_COLOR;
|
||||
@@ -895,10 +885,7 @@ X11_status_update_fancy(int fld, genericptr_t ptr, int chg UNUSED,
|
||||
} else {
|
||||
int colr, attr;
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
if ((colrattr & 0x00ff) >= CLR_MAX)
|
||||
/* for !TEXTCOLOR, the following line is unconditional */
|
||||
#endif
|
||||
colrattr = (colrattr & ~0x00ff) | NO_COLOR;
|
||||
colr = colrattr & 0x00ff; /* guaranteed to be >= 0 and < CLR_MAX */
|
||||
attr = (colrattr >> 8) & 0x00ff;
|
||||
|
||||
@@ -301,7 +301,6 @@ curses_create_main_windows(void)
|
||||
void
|
||||
curses_init_nhcolors(void)
|
||||
{
|
||||
#ifdef TEXTCOLOR
|
||||
if (has_colors()) {
|
||||
use_default_colors();
|
||||
init_pair(1, COLOR_BLACK, -1);
|
||||
@@ -362,7 +361,6 @@ curses_init_nhcolors(void)
|
||||
init_pair(16, COLOR_WHITE + 8, -1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0 /* curses_choose_character + curses_character_dialog no longer used */
|
||||
|
||||
@@ -211,7 +211,6 @@ curses_init_nhwindows(
|
||||
#else
|
||||
base_term = initscr();
|
||||
#endif
|
||||
#ifdef TEXTCOLOR
|
||||
if (has_colors()) {
|
||||
start_color();
|
||||
curses_init_nhcolors();
|
||||
@@ -221,12 +220,6 @@ curses_init_nhwindows(
|
||||
iflags.wc2_guicolor = FALSE;
|
||||
set_wc2_option_mod_status(WC2_GUICOLOR, set_in_config);
|
||||
}
|
||||
#else
|
||||
iflags.use_color = FALSE;
|
||||
set_option_mod_status("color", set_in_config);
|
||||
iflags.wc2_guicolor = FALSE;
|
||||
set_wc2_option_mod_status(WC2_GUICOLOR, set_in_config);
|
||||
#endif
|
||||
noecho();
|
||||
raw();
|
||||
nonl(); /* don't force ^M into newline (^J); input accepts them both
|
||||
|
||||
@@ -81,7 +81,6 @@ curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff)
|
||||
if (color == NO_COLOR)
|
||||
color = NONE;
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
int curses_color;
|
||||
|
||||
/* if color is disabled, just show attribute */
|
||||
@@ -89,7 +88,6 @@ curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff)
|
||||
/* statuswin is for #if STATUS_HILITES
|
||||
but doesn't need to be conditional */
|
||||
: !(iflags.wc2_guicolor || win == statuswin)) {
|
||||
#endif
|
||||
if (attr != NONE) {
|
||||
if (onoff == ON)
|
||||
wattron(win, attr);
|
||||
@@ -97,7 +95,6 @@ curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff)
|
||||
wattroff(win, attr);
|
||||
}
|
||||
return;
|
||||
#ifdef TEXTCOLOR
|
||||
}
|
||||
|
||||
if (color == 0) { /* make black fg visible */
|
||||
@@ -153,9 +150,6 @@ curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff)
|
||||
wattroff(win, attr);
|
||||
}
|
||||
}
|
||||
#else
|
||||
nhUse(color);
|
||||
#endif /* TEXTCOLOR */
|
||||
}
|
||||
|
||||
/* call curses_toggle_color_attr() with 'menucolors' instead of 'guicolor'
|
||||
|
||||
@@ -37,9 +37,7 @@ static void curs_HPbar(char *, int);
|
||||
static void curs_stat_conds(int, int, int *, int *, char *, boolean *);
|
||||
static void curs_vert_status_vals(int);
|
||||
#ifdef STATUS_HILITES
|
||||
#ifdef TEXTCOLOR
|
||||
static int condcolor(long, unsigned long *);
|
||||
#endif
|
||||
static int condattr(long, unsigned long *);
|
||||
static int nhattr2curses(int);
|
||||
#endif /* STATUS_HILITES */
|
||||
@@ -163,9 +161,7 @@ curses_status_update(
|
||||
curses_condition_bits = *condptr;
|
||||
curses_colormasks = colormasks;
|
||||
} else {
|
||||
#ifndef TEXTCOLOR
|
||||
color_and_attr = (color_and_attr & ~0x00FF) | NO_COLOR;
|
||||
#endif
|
||||
/*
|
||||
* status_vals[] are used for horizontal orientation
|
||||
* (wide lines of multiple short values).
|
||||
@@ -591,11 +587,9 @@ draw_horizontal(boolean border)
|
||||
attrmask = nhattr2curses(attrmask);
|
||||
wattron(win, attrmask);
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
coloridx &= 0x00FF;
|
||||
if (coloridx != NO_COLOR && coloridx != CLR_MAX)
|
||||
curses_toggle_color_attr(win, coloridx, NONE, ON);
|
||||
#endif
|
||||
}
|
||||
#endif /* STATUS_HILITES */
|
||||
|
||||
@@ -603,10 +597,8 @@ draw_horizontal(boolean border)
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
if (iflags.hilite_delta) {
|
||||
#ifdef TEXTCOLOR
|
||||
if (coloridx != NO_COLOR)
|
||||
curses_toggle_color_attr(win, coloridx, NONE, OFF);
|
||||
#endif
|
||||
if (attrmask)
|
||||
wattroff(win, attrmask);
|
||||
}
|
||||
@@ -888,11 +880,9 @@ draw_vertical(boolean border)
|
||||
attrmask = nhattr2curses(attrmask);
|
||||
wattron(win, attrmask);
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
coloridx &= 0x00FF;
|
||||
if (coloridx != NO_COLOR && coloridx != CLR_MAX)
|
||||
curses_toggle_color_attr(win, coloridx, NONE, ON);
|
||||
#endif
|
||||
} /* highlighting active */
|
||||
#endif /* STATUS_HILITES */
|
||||
|
||||
@@ -900,10 +890,8 @@ draw_vertical(boolean border)
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
if (iflags.hilite_delta) {
|
||||
#ifdef TEXTCOLOR
|
||||
if (coloridx != NO_COLOR)
|
||||
curses_toggle_color_attr(win, coloridx, NONE, OFF);
|
||||
#endif
|
||||
if (attrmask)
|
||||
wattroff(win, attrmask);
|
||||
} /* resume normal rendition */
|
||||
@@ -933,9 +921,7 @@ curs_HPbar(char *text, /* pre-padded with trailing spaces if short */
|
||||
int bar_len) /* width of space within the brackets */
|
||||
{
|
||||
#ifdef STATUS_HILITES
|
||||
#ifdef TEXTCOLOR
|
||||
int coloridx = 0;
|
||||
#endif
|
||||
#endif /* STATUS_HILITES */
|
||||
int k, bar_pos;
|
||||
char bar[STATVAL_WIDTH], *bar2 = (char *) 0, savedch = '\0';
|
||||
@@ -965,25 +951,21 @@ curs_HPbar(char *text, /* pre-padded with trailing spaces if short */
|
||||
/* fixed attribute, not nhattr2curses((hpbar_color >> 8) & 0x00FF) */
|
||||
wattron(win, A_REVERSE); /* do this even if hilite_delta is 0 */
|
||||
#ifdef STATUS_HILITES
|
||||
#ifdef TEXTCOLOR
|
||||
if (iflags.hilite_delta) {
|
||||
coloridx = hpbar_color & 0x00FF;
|
||||
if (coloridx != NO_COLOR)
|
||||
curses_toggle_color_attr(win, coloridx, NONE, ON);
|
||||
}
|
||||
#endif
|
||||
#endif /* STATUS_HILITES */
|
||||
|
||||
/* portion of title corresponding to current hit points */
|
||||
waddstr(win, bar);
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
#ifdef TEXTCOLOR
|
||||
if (iflags.hilite_delta) {
|
||||
if (coloridx != NO_COLOR)
|
||||
curses_toggle_color_attr(win, coloridx, NONE, OFF);
|
||||
}
|
||||
#endif
|
||||
#endif /* STATUS_HILITES */
|
||||
wattroff(win, A_REVERSE); /* do this even if hilite_delta is 0 */
|
||||
} /* *bar (current HP > 0) */
|
||||
@@ -1088,11 +1070,9 @@ curs_stat_conds(
|
||||
attrmask = nhattr2curses(attrmask);
|
||||
wattron(win, attrmask);
|
||||
}
|
||||
#ifdef TEXTCOLOR
|
||||
if ((color = condcolor(bitmsk, curses_colormasks))
|
||||
!= NO_COLOR)
|
||||
curses_toggle_color_attr(win, color, NONE, ON);
|
||||
#endif
|
||||
}
|
||||
#endif /* STATUS_HILITES */
|
||||
|
||||
@@ -1101,10 +1081,8 @@ curs_stat_conds(
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
if (iflags.hilite_delta) {
|
||||
#ifdef TEXTCOLOR
|
||||
if (color != NO_COLOR)
|
||||
curses_toggle_color_attr(win, color, NONE, OFF);
|
||||
#endif
|
||||
if (attrmask)
|
||||
wattroff(win, attrmask);
|
||||
}
|
||||
@@ -1271,7 +1249,6 @@ curs_vert_status_vals(int win_width)
|
||||
}
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
#ifdef TEXTCOLOR
|
||||
/*
|
||||
* Return what color this condition should
|
||||
* be displayed in based on user settings.
|
||||
@@ -1288,7 +1265,6 @@ condcolor(long bm, unsigned long *bmarray)
|
||||
}
|
||||
return NO_COLOR;
|
||||
}
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
static int
|
||||
condattr(long bm, unsigned long *bmarray)
|
||||
|
||||
@@ -213,11 +213,7 @@ struct window_procs shim_procs = {
|
||||
| WC2_RESET_STATUS
|
||||
#endif
|
||||
| WC2_DARKGRAY | WC2_SUPPRESS_HIST | WC2_STATUSLINES),
|
||||
#ifdef TEXTCOLOR
|
||||
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
|
||||
#else
|
||||
{1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1},
|
||||
#endif
|
||||
shim_init_nhwindows, shim_player_selection, shim_askname, shim_get_nh_event,
|
||||
shim_exit_nhwindows, shim_suspend_nhwindows, shim_resume_nhwindows,
|
||||
shim_create_nhwindow, shim_clear_nhwindow, shim_display_nhwindow,
|
||||
|
||||
@@ -20,12 +20,12 @@ void nocmov(int, int);
|
||||
void term_start_24bitcolor(struct unicode_representation *);
|
||||
void term_end_24bitcolor(void);
|
||||
|
||||
#if defined(TEXTCOLOR) && defined(TERMLIB)
|
||||
#if defined(TERMLIB)
|
||||
#if (!defined(UNIX) || !defined(TERMINFO)) && !defined(TOS)
|
||||
static void analyze_seq(char *, int *, int *);
|
||||
#endif
|
||||
#endif
|
||||
#if defined(TEXTCOLOR) && (defined(TERMLIB) || defined(ANSI_DEFAULT))
|
||||
#if (defined(TERMLIB) || defined(ANSI_DEFAULT))
|
||||
static void init_hilite(void);
|
||||
static void kill_hilite(void);
|
||||
#endif
|
||||
@@ -45,13 +45,11 @@ static char PC = '\0';
|
||||
static char tbuf[512];
|
||||
#endif /*TERMLIB*/
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#ifdef TOS
|
||||
const char *hilites[CLR_MAX]; /* terminal escapes for the various colors */
|
||||
#else
|
||||
char NEARDATA *hilites[CLR_MAX]; /* terminal escapes for the various colors */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static char *KS = (char *) 0, *KE = (char *) 0; /* keypad sequences */
|
||||
static char nullstr[] = "";
|
||||
@@ -160,9 +158,7 @@ tty_startup(int *wid, int *hgt)
|
||||
AE = nhStr("\017");
|
||||
#endif
|
||||
TE = VS = VE = nullstr;
|
||||
#ifdef TEXTCOLOR
|
||||
init_hilite();
|
||||
#endif /* TEXTCOLOR */
|
||||
*wid = CO;
|
||||
*hgt = LI;
|
||||
CL = nhStr("\033[2J"); /* last thing set */
|
||||
@@ -297,7 +293,6 @@ tty_startup(int *wid, int *hgt)
|
||||
AS = Tgetstr(nhStr("as")); /* alt charset start */
|
||||
AE = Tgetstr(nhStr("ae")); /* alt charset end */
|
||||
nh_CD = Tgetstr(nhStr("cd")); /* clear lines from cursor and down */
|
||||
#ifdef TEXTCOLOR
|
||||
#if defined(TOS) && defined(__GNUC__)
|
||||
if (!strcmp(term, "builtin") || !strcmp(term, "tw52")
|
||||
|| !strcmp(term, "st52")) {
|
||||
@@ -305,7 +300,6 @@ tty_startup(int *wid, int *hgt)
|
||||
}
|
||||
#else
|
||||
init_hilite();
|
||||
#endif
|
||||
#endif
|
||||
*wid = CO;
|
||||
*hgt = LI;
|
||||
@@ -332,7 +326,7 @@ void
|
||||
tty_shutdown(void)
|
||||
{
|
||||
/* we only attempt to clean up a few individual termcap variables */
|
||||
#if defined(TEXTCOLOR) && (defined(TERMLIB) || defined(ANSI_DEFAULT))
|
||||
#if defined(TERMLIB) || defined(ANSI_DEFAULT)
|
||||
kill_hilite();
|
||||
#endif
|
||||
#ifdef TERMLIB
|
||||
@@ -809,7 +803,7 @@ cl_eos(void) /* free after Robert Viduya */
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(TEXTCOLOR) && defined(TERMLIB)
|
||||
#if defined(TERMLIB)
|
||||
#if defined(UNIX) && defined(TERMINFO)
|
||||
/*
|
||||
* Sets up color highlighting, using terminfo(4) escape sequences.
|
||||
@@ -1218,9 +1212,9 @@ kill_hilite(void)
|
||||
return;
|
||||
}
|
||||
#endif /* UNIX && TERMINFO */
|
||||
#endif /* TEXTCOLOR && TERMLIB */
|
||||
#endif /* TERMLIB */
|
||||
|
||||
#if defined(TEXTCOLOR) && !defined(TERMLIB) && defined(ANSI_DEFAULT)
|
||||
#if !defined(TERMLIB) && defined(ANSI_DEFAULT)
|
||||
static char adef_nilstring[] = "";
|
||||
|
||||
static void
|
||||
@@ -1256,7 +1250,7 @@ init_hilite(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* See TEXTCOLOR && TERMLIB && UNIX && TERMINFO code above. */
|
||||
/* See TERMLIB && UNIX && TERMINFO code above. */
|
||||
if (iflags.wc2_darkgray) {
|
||||
/* Bright black is dark gray. */
|
||||
hilites[CLR_BLACK] = (char *) alloc(sizeof "\033[1;30m");
|
||||
@@ -1293,7 +1287,7 @@ kill_hilite(void)
|
||||
hilites[CLR_BLACK] = 0;
|
||||
}
|
||||
}
|
||||
#endif /* TEXTCOLOR && !TERMLIB && ANSI_DEFAULT */
|
||||
#endif /* !TERMLIB && ANSI_DEFAULT */
|
||||
|
||||
static char nulstr[] = "";
|
||||
|
||||
@@ -1426,8 +1420,6 @@ term_end_raw_bold(void)
|
||||
xputs(soOff);
|
||||
}
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
|
||||
void
|
||||
term_end_color(void)
|
||||
{
|
||||
@@ -1448,7 +1440,6 @@ term_start_bgcolor(int color)
|
||||
Sprintf(tmp, "\033[%dm", ((color % 8) + 40));
|
||||
xputs(tmp);
|
||||
}
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
|
||||
|
||||
@@ -125,11 +125,7 @@ struct window_procs tty_procs = {
|
||||
| WC2_U_24BITCOLOR
|
||||
#endif
|
||||
),
|
||||
#ifdef TEXTCOLOR
|
||||
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
|
||||
#else
|
||||
{1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1},
|
||||
#endif
|
||||
tty_init_nhwindows, tty_player_selection, tty_askname, tty_get_nh_event,
|
||||
tty_exit_nhwindows, tty_suspend_nhwindows, tty_resume_nhwindows,
|
||||
tty_create_nhwindow, tty_clear_nhwindow, tty_display_nhwindow,
|
||||
@@ -548,9 +544,7 @@ tty_init_nhwindows(int *argcp UNUSED, char **argv UNUSED)
|
||||
ttyDisplay->curx = ttyDisplay->cury = 0;
|
||||
ttyDisplay->inmore = ttyDisplay->inread = ttyDisplay->intr = 0;
|
||||
ttyDisplay->dismiss_more = 0;
|
||||
#ifdef TEXTCOLOR
|
||||
ttyDisplay->color = NO_COLOR;
|
||||
#endif
|
||||
ttyDisplay->attrs = 0;
|
||||
ttyDisplay->topl_utf8 = 0;
|
||||
ttyDisplay->mixed = 0;
|
||||
@@ -1170,16 +1164,12 @@ set_item_state(
|
||||
HUPSKIP();
|
||||
tty_curs(window, 4, lineno);
|
||||
term_start_attr(item->attr);
|
||||
#ifdef TEXTCOLOR
|
||||
if (item->color != NO_COLOR)
|
||||
term_start_color(item->color);
|
||||
#endif
|
||||
(void) putchar(ch);
|
||||
ttyDisplay->curx++;
|
||||
#ifdef TEXTCOLOR
|
||||
if (item->color != NO_COLOR)
|
||||
term_end_color();
|
||||
#endif
|
||||
term_end_attr(item->attr);
|
||||
}
|
||||
|
||||
@@ -1306,21 +1296,13 @@ toggle_menu_attr(boolean on, int color, int attr)
|
||||
{
|
||||
if (on) {
|
||||
term_start_attr(attr);
|
||||
#ifdef TEXTCOLOR
|
||||
if (color != NO_COLOR)
|
||||
term_start_color(color);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef TEXTCOLOR
|
||||
if (color != NO_COLOR)
|
||||
term_end_color();
|
||||
#endif
|
||||
term_end_attr(attr);
|
||||
}
|
||||
|
||||
#ifndef TEXTCOLOR
|
||||
nhUse(color);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3549,12 +3531,10 @@ end_glyphout(void)
|
||||
graph_off();
|
||||
}
|
||||
#endif
|
||||
#ifdef TEXTCOLOR
|
||||
if (ttyDisplay->color != NO_COLOR) {
|
||||
term_end_color();
|
||||
ttyDisplay->color = NO_COLOR;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef WIN32CON
|
||||
@@ -3701,12 +3681,10 @@ tty_print_glyph(
|
||||
}
|
||||
#endif
|
||||
if (iflags.use_color) {
|
||||
#ifdef TEXTCOLOR
|
||||
if (color != ttyDisplay->color) {
|
||||
if (ttyDisplay->color != NO_COLOR)
|
||||
term_end_color();
|
||||
}
|
||||
#endif
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
/* we don't link with termcap.o if NO_TERMS is defined */
|
||||
if ((tty_procs.wincap2 & WC2_U_24BITCOLOR) && SYMHANDLING(H_UTF8)
|
||||
@@ -3720,13 +3698,11 @@ tty_print_glyph(
|
||||
colordone = TRUE;
|
||||
}
|
||||
#endif
|
||||
#ifdef TEXTCOLOR
|
||||
if (!colordone) {
|
||||
ttyDisplay->color = color;
|
||||
if (color != NO_COLOR)
|
||||
term_start_color(color);
|
||||
}
|
||||
#endif /* TEXTCOLOR */
|
||||
} /* iflags.use_color aka iflags.wc_color */
|
||||
|
||||
/* must be after color check; term_end_color may turn off inverse too;
|
||||
@@ -3735,10 +3711,8 @@ tty_print_glyph(
|
||||
to see although the Valkyrie quest ends up being hard on the eyes) */
|
||||
if (iflags.use_color
|
||||
&& bkglyphinfo && bkglyphinfo->framecolor != NO_COLOR) {
|
||||
#ifdef TEXTCOLOR
|
||||
ttyDisplay->framecolor = bkglyphinfo->framecolor;
|
||||
term_start_bgcolor(bkglyphinfo->framecolor);
|
||||
#endif
|
||||
} else if ((((special & MG_PET) != 0 && iflags.hilite_pet)
|
||||
|| ((special & MG_OBJPILE) != 0 && iflags.hilite_pile)
|
||||
|| ((special & MG_FEMALE) != 0 && wizard && iflags.wizmgender)
|
||||
@@ -3770,7 +3744,6 @@ tty_print_glyph(
|
||||
if (inverse_on)
|
||||
term_end_attr(ATR_INVERSE);
|
||||
if (iflags.use_color) {
|
||||
#ifdef TEXTCOLOR
|
||||
/* turn off color as well, turning off ATR_INVERSE may have done
|
||||
this already and if so, we won't know the current state unless
|
||||
we do it explicitly */
|
||||
@@ -3779,7 +3752,6 @@ tty_print_glyph(
|
||||
term_end_color();
|
||||
ttyDisplay->color = ttyDisplay->framecolor = NO_COLOR;
|
||||
}
|
||||
#endif
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
if (color24bit_on)
|
||||
term_end_24bitcolor();
|
||||
@@ -4051,9 +4023,7 @@ extern boolean status_activefields[MAXBLSTATS];
|
||||
extern winid WIN_STATUS;
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
#ifdef TEXTCOLOR
|
||||
static int condcolor(long, unsigned long *);
|
||||
#endif
|
||||
static int condattr(long, unsigned long *);
|
||||
static unsigned long *tty_colormasks;
|
||||
static long tty_condition_bits;
|
||||
@@ -4290,9 +4260,6 @@ tty_status_update(
|
||||
/*FALLTHRU*/
|
||||
default:
|
||||
attrmask = (color >> 8) & 0x00FF;
|
||||
#ifndef TEXTCOLOR
|
||||
color = NO_COLOR;
|
||||
#endif
|
||||
fmt = status_fieldfmt[fldidx];
|
||||
if (!fmt)
|
||||
fmt = "%s";
|
||||
@@ -4688,7 +4655,6 @@ check_windowdata(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
/*
|
||||
* Return what color this condition should
|
||||
* be displayed in based on user settings.
|
||||
@@ -4705,13 +4671,6 @@ condcolor(long bm, unsigned long *bmarray)
|
||||
}
|
||||
return NO_COLOR;
|
||||
}
|
||||
#else
|
||||
/* might need something more elaborate if some compiler complains that
|
||||
the condition where this gets used always has the same value */
|
||||
#define condcolor(bm,bmarray) NO_COLOR
|
||||
#define term_start_color(color) /*empty*/
|
||||
#define term_end_color() /*empty*/
|
||||
#endif /* TEXTCOLOR */
|
||||
|
||||
static int
|
||||
condattr(long bm, unsigned long *bmarray)
|
||||
|
||||
@@ -1274,7 +1274,6 @@ void
|
||||
nhglyph2charcolor(short g, uchar *ch, int *color)
|
||||
{
|
||||
int offset;
|
||||
#ifdef TEXTCOLOR
|
||||
|
||||
#define zap_color(n) *color = iflags.use_color ? zapcolors[n] : NO_COLOR
|
||||
#define cmap_color(n) *color = iflags.use_color ? defsyms[n].color : NO_COLOR
|
||||
@@ -1285,17 +1284,6 @@ nhglyph2charcolor(short g, uchar *ch, int *color)
|
||||
#define warn_color(n) \
|
||||
*color = iflags.use_color ? def_warnsyms[n].color : NO_COLOR
|
||||
|
||||
#else /* no text color */
|
||||
|
||||
#define zap_color(n)
|
||||
#define cmap_color(n)
|
||||
#define obj_color(n)
|
||||
#define mon_color(n)
|
||||
#define pet_color(c)
|
||||
#define warn_color(c)
|
||||
*color = CLR_WHITE;
|
||||
#endif
|
||||
|
||||
if ((offset = (g - GLYPH_WARNING_OFF)) >= 0) { /* a warning flash */
|
||||
*ch = showsyms[offset + SYM_OFF_W];
|
||||
warn_color(offset);
|
||||
|
||||
Reference in New Issue
Block a user