Change mhmap to use mapglyph()
This commit is contained in:
+16
-1
@@ -7,6 +7,10 @@
|
|||||||
#include "mhmsg.h"
|
#include "mhmsg.h"
|
||||||
#include "mhinput.h"
|
#include "mhinput.h"
|
||||||
|
|
||||||
|
#if (VERSION_MAJOR < 3) && (VERSION_MINOR < 3) && (PATCHLEVEL < 2)
|
||||||
|
#include "patchlevel.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NHMAP_FONT_NAME TEXT("Terminal")
|
#define NHMAP_FONT_NAME TEXT("Terminal")
|
||||||
#define MAXWINDOWTEXT 255
|
#define MAXWINDOWTEXT 255
|
||||||
#define CLIPAROUND_MARGIN 5
|
#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 onPaint(HWND hWnd);
|
||||||
static void onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
static void onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam);
|
||||||
static void nhcoord2display(PNHMapWindow data, int x, int y, LPRECT lpOut);
|
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);
|
static void nhglyph2charcolor(short glyph, uchar* ch, int* color);
|
||||||
|
#endif
|
||||||
static COLORREF nhcolor_to_RGB(int c);
|
static COLORREF nhcolor_to_RGB(int c);
|
||||||
|
|
||||||
HWND mswin_init_map_window () {
|
HWND mswin_init_map_window () {
|
||||||
@@ -525,9 +531,16 @@ void onPaint(HWND hWnd)
|
|||||||
TCHAR wch;
|
TCHAR wch;
|
||||||
RECT glyph_rect;
|
RECT glyph_rect;
|
||||||
int color;
|
int color;
|
||||||
|
unsigned special, mgch;
|
||||||
|
|
||||||
|
#if (VERSION_MAJOR < 3) && (VERSION_MINOR < 3) && (PATCHLEVEL < 2)
|
||||||
nhglyph2charcolor(data->map[i][j], &ch, &color);
|
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) );
|
SetTextColor( hDC, nhcolor_to_RGB(color) );
|
||||||
|
|
||||||
nhcoord2display(data, i, j, &glyph_rect);
|
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;
|
lpOut->bottom = lpOut->top + data->yScrTile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (VERSION_MAJOR < 3) && (VERSION_MINOR < 3) && (PATCHLEVEL < 2)
|
||||||
/* map glyph to character/color combination */
|
/* map glyph to character/color combination */
|
||||||
void nhglyph2charcolor(short g, uchar* ch, int* color)
|
void nhglyph2charcolor(short g, uchar* ch, int* color)
|
||||||
{
|
{
|
||||||
@@ -797,6 +811,7 @@ void nhglyph2charcolor(short g, uchar* ch, int* color)
|
|||||||
}
|
}
|
||||||
// end of wintty code
|
// end of wintty code
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* map nethack color to RGB */
|
/* map nethack color to RGB */
|
||||||
COLORREF nhcolor_to_RGB(int c)
|
COLORREF nhcolor_to_RGB(int c)
|
||||||
|
|||||||
@@ -266,6 +266,10 @@ SOURCE=..\src\makemon.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\src\mapglyph.c
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\src\mcastu.c
|
SOURCE=..\src\mcastu.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
Reference in New Issue
Block a user