for(i=paint_rt.left; i<paint_rt.right; i++)
for(j=paint_rt.top; j<paint_rt.bottom; j++)
if(data->map[i][j]>=0) {
- uchar ch;
+ char ch;
TCHAR wch;
RECT glyph_rect;
int color;
- unsigned special, mgch;
+ unsigned special;
+ int mgch;
HBRUSH back_brush;
nhcoord2display(data, i, j, &glyph_rect);
/* rely on NetHack core helper routine */
mapglyph(data->map[i][j], &mgch, &color,
&special, i, j);
- ch = (uchar)mgch;
+ ch = (char)mgch;
if (((special & MG_PET) && iflags.hilite_pet) ||
((special & MG_DETECT) && iflags.use_inverse)) {
back_brush = CreateSolidBrush(RGB(192, 192, 192));
COLORREF nhcolor_to_RGB(int c)
{
switch(c) {
- case CLR_BLACK: return RGB( 85, 85, 85);
- case CLR_RED: return RGB(255, 0, 0);
- case CLR_GREEN: return RGB( 0, 128, 0);
- case CLR_BROWN: return RGB(165, 42, 42);
- case CLR_BLUE: return RGB( 0, 0, 255);
- case CLR_MAGENTA: return RGB(255, 0, 255);
- case CLR_CYAN: return RGB( 0, 255, 255);
- case CLR_GRAY: return RGB(192, 192, 192);
- case NO_COLOR: return RGB(255, 255, 255);
- case CLR_ORANGE: return RGB(255, 165, 0);
- case CLR_BRIGHT_GREEN: return RGB( 0, 255, 0);
- case CLR_YELLOW: return RGB(255, 255, 0);
- case CLR_BRIGHT_BLUE: return RGB(0, 191, 255);
- case CLR_BRIGHT_MAGENTA: return RGB(255, 127, 255);
- case CLR_BRIGHT_CYAN: return RGB(127, 255, 255); /* something close to aquamarine */
- case CLR_WHITE: return RGB(255, 255, 255);
- default: return RGB( 0, 0, 0); /* black */
+ case CLR_BLACK: return RGB(0x55, 0x55, 0x55);
+ case CLR_RED: return RGB(0xFF, 0x00, 0x00);
+ case CLR_GREEN: return RGB(0x00, 0x80, 0x00);
+ case CLR_BROWN: return RGB(0xA5, 0x2A, 0x2A);
+ case CLR_BLUE: return RGB(0x00, 0x00, 0xFF);
+ case CLR_MAGENTA: return RGB(0xFF, 0x00, 0xFF);
+ case CLR_CYAN: return RGB(0x00, 0xFF, 0xFF);
+ case CLR_GRAY: return RGB(0xC0, 0xC0, 0xC0);
+ case NO_COLOR: return RGB(0xFF, 0xFF, 0xFF);
+ case CLR_ORANGE: return RGB(0xFF, 0xA5, 0x00);
+ case CLR_BRIGHT_GREEN: return RGB(0x00, 0xFF, 0x00);
+ case CLR_YELLOW: return RGB(0xFF, 0xFF, 0x00);
+ case CLR_BRIGHT_BLUE: return RGB(0x00, 0xC0, 0xFF);
+ case CLR_BRIGHT_MAGENTA: return RGB(0xFF, 0x80, 0xFF);
+ case CLR_BRIGHT_CYAN: return RGB(0x80, 0xFF, 0xFF); /* something close to aquamarine */
+ case CLR_WHITE: return RGB(0xFF, 0xFF, 0xFF);
+ default: return RGB(0x00, 0x00, 0x00); /* black */
}
}
COLORREF colorvalue;
} color_table_value;
+/*
+ * The color list here is a combination of:
+ * NetHack colors. (See mhmap.c)
+ * HTML colors. (See http://www.w3.org/TR/REC-html40/types.html#h-6.5 )
+ */
+
static color_table_value color_table[] = {
- { "black", RGB(0x00, 0x00, 0x00)},
- { "red", RGB(0xFF, 0x00, 0x00)},
- { "green", RGB(0x00, 0x80, 0x00)},
- { "brown", RGB(200,160,0)},
- { "blue", RGB(0,0,170)},
- { "magenta", RGB(160,0,160)},
- { "cyan", RGB(0,160,160,)},
- { "gray", RGB(0x80, 0x80, 0x80)},
- { "orange", RGB(255,140,0)},
- { "yellow", RGB(0xFF, 0xFF, 0x00)},
- { "white", RGB(0xFF, 0xFF, 0xFF)},
- { "purple", RGB(0x80, 0x00, 0x80)},
- { "silver", RGB(0xC0, 0xC0, 0xC0)},
- { "grey", RGB(0x80, 0x80, 0x80)},
- { "maroon", RGB(0x80, 0x00, 0x00)},
- { "fuchsia", RGB(0xFF, 0x00, 0xFF)},
- { "lime", RGB(0x00, 0xFF, 0x00)},
- { "olive", RGB(0x80, 0x80, 0x00)},
- { "navy", RGB(0x00, 0x00, 0x80)},
- { "teal", RGB(0x00, 0x80, 0x80)},
- { "aqua", RGB(0x00, 0xFF, 0xFF)},
- { "", RGB(0x00, 0x00, 0x00)},
+/* NetHack colors */
+ { "black", RGB(0x55, 0x55, 0x55)},
+ { "red", RGB(0xFF, 0x00, 0x00)},
+ { "green", RGB(0x00, 0x80, 0x00)},
+ { "brown", RGB(0xA5, 0x2A, 0x2A)},
+ { "blue", RGB(0x00, 0x00, 0xFF)},
+ { "magenta", RGB(0xFF, 0x00, 0xFF)},
+ { "cyan", RGB(0x00, 0xFF, 0xFF)},
+ { "orange", RGB(0xFF, 0xA5, 0x00)},
+ { "brightgreen", RGB(0x00, 0xFF, 0x00)},
+ { "yellow", RGB(0xFF, 0xFF, 0x00)},
+ { "brightblue", RGB(0x00, 0xC0, 0xFF)},
+ { "brightmagenta", RGB(0xFF, 0x80, 0xFF)},
+ { "brightcyan", RGB(0x80, 0xFF, 0xFF)},
+ { "white", RGB(0xFF, 0xFF, 0xFF)},
+/* Remaining HTML colors */
+ { "trueblack", RGB(0x00, 0x00, 0x00)},
+ { "gray", RGB(0x80, 0x80, 0x80)},
+ { "grey", RGB(0x80, 0x80, 0x80)},
+ { "purple", RGB(0x80, 0x00, 0x80)},
+ { "silver", RGB(0xC0, 0xC0, 0xC0)},
+ { "maroon", RGB(0x80, 0x00, 0x00)},
+ { "fuchsia", RGB(0xFF, 0x00, 0xFF)}, /* = NetHack magenta */
+ { "lime", RGB(0x00, 0xFF, 0x00)}, /* = NetHack bright green */
+ { "olive", RGB(0x80, 0x80, 0x00)},
+ { "navy", RGB(0x00, 0x00, 0x80)},
+ { "teal", RGB(0x00, 0x80, 0x80)},
+ { "aqua", RGB(0x00, 0xFF, 0xFF)}, /* = NetHack cyan */
+ { "", RGB(0x00, 0x00, 0x00)},
};
typedef struct ctbv