reinstate 256 color
This commit is contained in:
@@ -853,14 +853,20 @@ rgbstr_to_int32(const char *rgbstr)
|
||||
}
|
||||
|
||||
int
|
||||
set_map_nhcolor(glyph_map *gmap, uint32 nhcolor)
|
||||
set_map_customcolor(glyph_map *gmap, uint32 nhcolor)
|
||||
{
|
||||
glyph_map *tmpgm = gmap;
|
||||
uint32 closecolor = 0;
|
||||
uint16 clridx = 0;
|
||||
|
||||
if (!tmpgm)
|
||||
return 0;
|
||||
|
||||
gmap->customcolor = nhcolor;
|
||||
if (closest_color(nhcolor, &closecolor, &clridx))
|
||||
gmap->color256idx = clridx;
|
||||
else
|
||||
gmap->color256idx = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -976,7 +982,7 @@ color_distance(uint32_t rgb1, uint32_t rgb2)
|
||||
}
|
||||
|
||||
boolean
|
||||
closest_color(uint32 lcolor, uint32 *closecolor, int *clridx)
|
||||
closest_color(uint32 lcolor, uint32 *closecolor, uint16 *clridx)
|
||||
{
|
||||
int i, color_index = -1, similar = INT_MAX, current;
|
||||
boolean retbool = FALSE;
|
||||
|
||||
@@ -1566,12 +1566,12 @@ see_traps(void)
|
||||
}
|
||||
|
||||
/* glyph, ttychar, framecolor,
|
||||
{ glyphflags, { NO_COLOR, sym.symidx }, nhcolor, tileidx, u } */
|
||||
{ glyphflags, { NO_COLOR, sym.symidx }, customcolor, color256idx, tileidx, u } */
|
||||
static glyph_info no_ginfo = {
|
||||
NO_GLYPH, ' ', NO_COLOR,
|
||||
{ MG_BADXY, { NO_COLOR, 0 },
|
||||
0,
|
||||
0
|
||||
0U, 0U
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
, 0
|
||||
#endif
|
||||
@@ -1602,7 +1602,7 @@ const glyph_info nul_glyphinfo = {
|
||||
MG_UNEXPL,
|
||||
{ NO_COLOR, SYM_UNEXPLORED + SYM_OFF_X },
|
||||
0,
|
||||
0
|
||||
0U, 0U
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
, 0
|
||||
#endif
|
||||
@@ -1616,7 +1616,7 @@ extern glyph_map glyphmap[MAX_GLYPH]; /* from tile.c */
|
||||
glyph_map glyphmap[MAX_GLYPH] = {
|
||||
{ 0U, { NO_COLOR, 0 },
|
||||
0,
|
||||
0
|
||||
0U, 0U
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
, 0
|
||||
#endif
|
||||
@@ -2029,7 +2029,7 @@ static gbuf_entry nul_gbuf = {
|
||||
/* glyphinfo.gm */
|
||||
{ MG_UNEXPL, { NO_COLOR, 0 },
|
||||
0,
|
||||
0
|
||||
0U, 0U
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
, 0
|
||||
#endif
|
||||
|
||||
@@ -483,7 +483,7 @@ apply_customizations(
|
||||
if (iflags.customcolors && do_colors) {
|
||||
if (sc->custtype == custom_nhcolor) {
|
||||
gmap = &glyphmap[details->content.ccolor.glyphidx];
|
||||
(void) set_map_nhcolor(gmap,
|
||||
(void) set_map_customcolor(gmap,
|
||||
details->content.ccolor.nhcolor);
|
||||
}
|
||||
}
|
||||
@@ -1051,6 +1051,7 @@ clear_all_glyphmap_colors(void)
|
||||
for (glyph = 0; glyph < MAX_GLYPH; ++glyph) {
|
||||
if (glyphmap[glyph].customcolor)
|
||||
glyphmap[glyph].customcolor = 0;
|
||||
glyphmap[glyph].color256idx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user