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

@@ -293,13 +293,13 @@ extern const char *attr2attrname(int);
extern void basic_menu_colors(boolean);
extern boolean add_menu_coloring_parsed(const char *, int, int);
extern const char *clr2colorname(int);
extern int match_str2clr(char *) NONNULLARG1;
extern int match_str2clr(char *, boolean) NONNULLARG1;
extern int match_str2attr(const char *, boolean) NONNULLARG1;
extern boolean add_menu_coloring(char *) NONNULLARG1;
extern void free_one_menu_coloring(int);
extern void free_menu_coloring(void);
extern int count_menucolors(void);
extern int32 check_enhanced_colors(const char *) NONNULLARG1;
extern int32 check_enhanced_colors(char *) NONNULLARG1;
/* ### cmd.c ### */