ENHANCED_SYMBOLS: store all CLR_ colors specially

The 0x1000000 bit (NH_BASIC_COLOR bit) was used to mark
CLR_BLACK when storing it in u->ucolor. Now, all of the basic CLR_*
colors are stored that way.

The NH_BASIC_COLOR bit indicates that the value in u->ucolor is
not an rgb value, rather it is one of the 0-15 basic NetHack colors.
The window-ports need to strip the NH_BASIC_COLOR bit off before using
it for color changes.
This commit is contained in:
nhmall
2024-03-03 18:31:11 -05:00
parent 3fb35e390b
commit 6619d10d90
10 changed files with 103 additions and 69 deletions

View File

@@ -49,10 +49,11 @@ static int glyph_find_core(const char *id, struct find_struct *findwhat);
static char *fix_glyphname(char *str);
static int32_t rgbstr_to_int32(const char *rgbstr);
boolean closest_color(uint32_t lcolor, uint32_t *closecolor, int *clridx);
static const long nonzero_black = 0x1000000;
static int color_distance(uint32_t, uint32_t);
static boolean onlyhexdigits(const char *buf);
static const long nonzero_black = CLR_BLACK | NH_BASIC_COLOR;
static void
to_custom_symset_entry_callback(int glyph, struct find_struct *findwhat)
{