| 951 | |
| 952 | |
| 953 | static void |
| 954 | paintGlyph(PNHMapWindow data, int i, int j, RECT * rect) |
| 955 | { |
| 956 | if (data->map[i][j].glyph >= 0) { |
| 957 | |
| 958 | glyph_info *glyphinfo; |
| 959 | uint32 ch; |
| 960 | WCHAR wch[3]; |
| 961 | int color; |
| 962 | uint32 rgbcolor; |
| 963 | // unsigned special; |
| 964 | // int mgch; |
| 965 | HBRUSH back_brush; |
| 966 | COLORREF OldFg; |
| 967 | |
| 968 | SetBkMode(data->backBufferDC, TRANSPARENT); |
| 969 | |
| 970 | HBRUSH blackBrush = CreateSolidBrush(RGB(0, 0, 0)); |
| 971 | FillRect(data->backBufferDC, rect, blackBrush); |
| 972 | DeleteObject(blackBrush); |
| 973 | |
| 974 | glyphinfo = &data->map[i][j]; |
| 975 | ch = glyphinfo->ttychar; |
| 976 | color = (int) glyphinfo->gm.sym.color; |
| 977 | rgbcolor = nhcolor_to_RGB(color); |
| 978 | #ifdef ENHANCED_SYMBOLS |
| 979 | if (SYMHANDLING(H_UTF8) |
| 980 | && glyphinfo->gm.u |
| 981 | && glyphinfo->gm.u->utf8str) { |
| 982 | ch = glyphinfo->gm.u->utf32ch; |
| 983 | } |
| 984 | #endif |
| 985 | if (glyphinfo->gm.customcolor != 0 |
| 986 | && (mswin_procs.wincap2 & WC2_EXTRACOLORS) != 0) { |
| 987 | if ((glyphinfo->gm.customcolor & NH_BASIC_COLOR) != 0) { |
| 988 | color = (int) COLORVAL(glyphinfo->gm.customcolor); |
| 989 | rgbcolor = nhcolor_to_RGB(color); |
| 990 | } |
| 991 | } |
| 992 | if (((data->map[i][j].gm.glyphflags & MG_PET) && iflags.hilite_pet) |
| 993 | || ((data->map[i][j].gm.glyphflags & (MG_DETECT | MG_BW_LAVA |
| 994 | | MG_BW_ICE | MG_BW_SINK |
| 995 | | MG_BW_ENGR)) != 0)) { |
| 996 | back_brush = |
| 997 | CreateSolidBrush(nhcolor_to_RGB(CLR_GRAY)); |
| 998 | FillRect(data->backBufferDC, rect, back_brush); |
| 999 | DeleteObject(back_brush); |
| 1000 | switch (color) { |
| 1001 | case CLR_GRAY: |
| 1002 | case CLR_WHITE: |
| 1003 | OldFg = SetTextColor( |
| 1004 | data->backBufferDC, nhcolor_to_RGB(CLR_BLACK)); |
| 1005 | break; |
| 1006 | default: |
| 1007 | OldFg = |
| 1008 | SetTextColor(data->backBufferDC, rgbcolor); |
| 1009 | } |
| 1010 | } else { |
no test coverage detected