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:
@@ -2780,7 +2780,7 @@ parse_status_hl2(char (*s)[QBUFSZ], boolean from_configfile)
|
||||
else if (a == ATR_NONE)
|
||||
disp_attrib = HL_NONE;
|
||||
else {
|
||||
int c = match_str2clr(subfields[i]);
|
||||
int c = match_str2clr(subfields[i], FALSE);
|
||||
|
||||
if (c >= CLR_MAX || coloridx != -1) {
|
||||
config_error_add("bad color '%d %d'", c, coloridx);
|
||||
@@ -3052,7 +3052,7 @@ parse_condition(char (*s)[QBUFSZ], int sidx)
|
||||
gc.cond_hilites[HL_ATTCLR_BLINK] &= ~conditions_bitmask;
|
||||
gc.cond_hilites[HL_ATTCLR_INVERSE] &= ~conditions_bitmask;
|
||||
} else {
|
||||
int k = match_str2clr(subfields[i]);
|
||||
int k = match_str2clr(subfields[i], FALSE);
|
||||
|
||||
if (k >= CLR_MAX) {
|
||||
config_error_add("bad color %d", k);
|
||||
|
||||
Reference in New Issue
Block a user