Remove TEXTCOLOR build option

This commit is contained in:
nhmall
2023-11-22 16:01:58 -05:00
parent 6272e18d7b
commit 04082a2033
60 changed files with 105 additions and 483 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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. */

View File

@@ -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.

View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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)

View File

@@ -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 */
}
}

View File

@@ -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

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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 {