Change mhmap to use mapglyph()
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
#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
|
||||
@@ -37,7 +41,9 @@ static void onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
||||
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 () {
|
||||
@@ -525,9 +531,16 @@ void onPaint(HWND hWnd)
|
||||
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);
|
||||
@@ -744,6 +757,7 @@ void nhcoord2display(PNHMapWindow data, int x, int y, LPRECT lpOut)
|
||||
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)
|
||||
{
|
||||
@@ -797,6 +811,7 @@ void nhglyph2charcolor(short g, uchar* ch, int* color)
|
||||
}
|
||||
// end of wintty code
|
||||
}
|
||||
#endif
|
||||
|
||||
/* map nethack color to RGB */
|
||||
COLORREF nhcolor_to_RGB(int c)
|
||||
@@ -904,4 +919,4 @@ void nhapply_image_transparent(
|
||||
DeleteDC(hdcBack);
|
||||
DeleteDC(hdcObject);
|
||||
DeleteDC(hdcSave);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,6 +266,10 @@ SOURCE=..\src\makemon.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\mapglyph.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\mcastu.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
Reference in New Issue
Block a user