#include "mhmsg.h"
#include "mhinput.h"
+#if (VERSION_MAJOR < 3) && (VERSION_MINOR < 3) && (PATCHLEVEL < 2)
+#include "patchlevel.h"
+#endif
+
#define NHMAP_FONT_NAME TEXT("Terminal")
#define MAXWINDOWTEXT 255
#define CLIPAROUND_MARGIN 5
static void onPaint(HWND hWnd);
static void onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam);
static void nhcoord2display(PNHMapWindow data, int x, int y, LPRECT lpOut);
+#if (VERSION_MAJOR < 3) && (VERSION_MINOR < 3) && (PATCHLEVEL < 2)
static void nhglyph2charcolor(short glyph, uchar* ch, int* color);
+#endif
static COLORREF nhcolor_to_RGB(int c);
HWND mswin_init_map_window () {
TCHAR wch;
RECT glyph_rect;
int color;
-
+ unsigned special, mgch;
+
+#if (VERSION_MAJOR < 3) && (VERSION_MINOR < 3) && (PATCHLEVEL < 2)
nhglyph2charcolor(data->map[i][j], &ch, &color);
-
+#else
+ /* rely on NetHack core helper routine */
+ mapglyph(data->map[i][j], &mgch, &color,
+ &special, i, j);
+ ch = (uchar)mgch;
+#endif
SetTextColor( hDC, nhcolor_to_RGB(color) );
nhcoord2display(data, i, j, &glyph_rect);
lpOut->bottom = lpOut->top + data->yScrTile;
}
+#if (VERSION_MAJOR < 3) && (VERSION_MINOR < 3) && (PATCHLEVEL < 2)
/* map glyph to character/color combination */
void nhglyph2charcolor(short g, uchar* ch, int* color)
{
}
// end of wintty code
}
+#endif
/* map nethack color to RGB */
COLORREF nhcolor_to_RGB(int c)
DeleteDC(hdcBack);
DeleteDC(hdcObject);
DeleteDC(hdcSave);
-}
\ No newline at end of file
+}