reinstate 256 color

This commit is contained in:
nhmall
2024-03-24 23:47:24 -04:00
parent 4d453193cf
commit e3409fd4af
8 changed files with 25 additions and 32 deletions

View File

@@ -139,17 +139,11 @@ X11_print_glyph(
if ((glyphinfo->gm.customcolor & NH_BASIC_COLOR) != 0) {
/* NH_BASIC_COLOR */
color = COLORVAL(glyphinfo->gm.customcolor);
#if 0
} else if (iflags.colorcount == 256
&& (X11_procs.wincap2 & WC2_EXTRACOLORS) != 0
&& (glyphinfo->gm.customcolor & NH_BASIC_COLOR) == 0) {
int clr256idx;
uint32 closecolor = 0;
if (closest_color(COLORVAL(glyphinfo->gm.customcolor),
&closecolor, &clr256idx))
nhcolor = COLORVAL(closecolor);
#endif
uint32 closecolor = get_nhcolor_from_256_index(glyphinfo->gm.color256idx);
nhcolor = COLORVAL(closecolor);
} else {
/* 24-bit color, NH_BASIC_COLOR == 0 */
nhcolor = COLORVAL(glyphinfo->gm.customcolor);

View File

@@ -1362,7 +1362,7 @@ main(int argc UNUSED, char *argv[] UNUSED)
Fprintf(ofp, "%smaxothtile = %d;\n\n", indent, lastothtile);
Fprintf(ofp, "#define NO_CUSTOMCOLOR (0U)\n\n");
Fprintf(ofp, "/* glyph, ttychar, { %s%s } */\n",
"glyphflags, { NO_COLOR, symidx }, NO_CUSTOMCOLOR, ovidx, tileidx", enhanced);
"glyphflags, { NO_COLOR, symidx }, NO_CUSTOMCOLOR, NO_CUSTOMCOLOR, ovidx, tileidx", enhanced);
#ifdef ENHANCED_SYMBOLS
enhanced = ", 0"; /* replace ", utf8rep" since we're done with that */
#endif
@@ -1370,7 +1370,7 @@ main(int argc UNUSED, char *argv[] UNUSED)
Fprintf(ofp, "%sNO_GLYPH, ' ', NO_COLOR,\n", indent);
Fprintf(ofp, "%s%s/* glyph_map */\n", indent, indent);
Fprintf(ofp, "%s%s{ %s, TILE_UNEXPLORED%s }\n", indent, indent,
"MG_UNEXPL, { NO_COLOR, SYM_UNEXPLORED + SYM_OFF_X }, NO_CUSTOMCOLOR",
"MG_UNEXPL, { NO_COLOR, SYM_UNEXPLORED + SYM_OFF_X }, NO_CUSTOMCOLOR, NO_CUSTOMCOLOR",
enhanced);
Fprintf(ofp, "};\n");
Fprintf(ofp, "\nglyph_map glyphmap[MAX_GLYPH] = {\n");
@@ -1385,7 +1385,7 @@ main(int argc UNUSED, char *argv[] UNUSED)
/*NOTREACHED*/
}
Fprintf(ofp,
" { 0U, { NO_COLOR, 0 }, NO_CUSTOMCOLOR, %4d%s }, /* [%04d] %s:%03d %s */\n",
" { 0U, { NO_COLOR, 0 }, NO_CUSTOMCOLOR, NO_CUSTOMCOLOR, %4d%s }, /* [%04d] %s:%03d %s */\n",
tilenum, enhanced, i,
tilesrc_texts[tilelist[tilenum]->src],
tilelist[tilenum]->file_entry,

View File

@@ -3849,18 +3849,9 @@ tty_print_glyph(
if ((glyphinfo->gm.customcolor & NH_BASIC_COLOR) != 0) {
/* don't set colordone or nhcolor */
color = COLORVAL(glyphinfo->gm.customcolor);
#if 0
} else if (iflags.colorcount == 256) {
if (closest_color(COLORVAL(glyphinfo->gm.customcolor),
&closecolor, &clridx)) {
if (ttyDisplay->color != NO_COLOR) {
term_end_color();
}
ttyDisplay->colorflags = 0;
term_start_256color(clridx);
colordone = TRUE;
}
#endif
ttyDisplay->colorflags = 0; /* not NH_BASIC_COLOR */
term_start_256color(glyphinfo->gm.color256idx);
} else {
nhcolor = COLORVAL(glyphinfo->gm.customcolor);
ttyDisplay->colorflags = 0;