From 8944235282ff7f20f1e592f0c4f806fd295fee12 Mon Sep 17 00:00:00 2001 From: Bart House Date: Mon, 12 Nov 2018 01:58:56 -0800 Subject: [PATCH 1/5] Enforced the inclusion of windows headers before nethack headers. Moved the code page 437 mapping table to winnt.c so that it could be used in window and console clients. Added check that fonts support unicode values we use from code page 437. Use unicode to draw text if font supports it otherwise use ASCII. --- sys/share/pcmain.c | 8 ++-- sys/winnt/nh340key.c | 2 +- sys/winnt/nhdefkey.c | 2 +- sys/winnt/nhraykey.c | 2 +- sys/winnt/ntsound.c | 2 +- sys/winnt/nttty.c | 57 +++++++-------------------- sys/winnt/stubs.c | 4 +- sys/winnt/win32api.h | 40 +++++++++++++------ sys/winnt/winnt.c | 94 +++++++++++++++++++++++++++++++++++++++++++- sys/winnt/winos.h | 20 ++++++++++ util/recover.c | 9 +++-- win/share/tile2bmp.c | 5 ++- win/win32/mhfont.c | 14 +++++++ win/win32/mhfont.h | 1 + win/win32/mhmap.c | 88 +++++++++++++++++++++++------------------ win/win32/mhmenu.c | 2 +- win/win32/mhstatus.c | 50 +++++++++++++++++------ 17 files changed, 276 insertions(+), 124 deletions(-) create mode 100644 sys/winnt/winos.h diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index c55805b09..cc60b3b3c 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -5,6 +5,10 @@ /* main.c - MSDOS, OS/2, ST, Amiga, and Windows NetHack */ +#ifdef WIN32 +#include "win32api.h" /* for GetModuleFileName */ +#endif + #include "hack.h" #include "dlb.h" @@ -22,10 +26,6 @@ #endif #endif -#ifdef WIN32 -#include "win32api.h" /* for GetModuleFileName */ -#endif - #ifdef __DJGPP__ #include /* for getcwd() prototype */ #endif diff --git a/sys/winnt/nh340key.c b/sys/winnt/nh340key.c index 8d512142e..78600ec67 100644 --- a/sys/winnt/nh340key.c +++ b/sys/winnt/nh340key.c @@ -13,9 +13,9 @@ static char where_to_get_source[] = "http://www.nethack.org/"; static char author[] = "The NetHack Development Team"; +#include "win32api.h" #include "hack.h" #include "wintty.h" -#include "win32api.h" extern HANDLE hConIn; extern INPUT_RECORD ir; diff --git a/sys/winnt/nhdefkey.c b/sys/winnt/nhdefkey.c index 5f7390955..f6d110adb 100644 --- a/sys/winnt/nhdefkey.c +++ b/sys/winnt/nhdefkey.c @@ -19,9 +19,9 @@ static char where_to_get_source[] = "http://www.nethack.org/"; static char author[] = "The NetHack Development Team"; +#include "win32api.h" #include "hack.h" #include "wintty.h" -#include "win32api.h" extern HANDLE hConIn; extern INPUT_RECORD ir; diff --git a/sys/winnt/nhraykey.c b/sys/winnt/nhraykey.c index 3b0a6ef04..a1f7af3ca 100644 --- a/sys/winnt/nhraykey.c +++ b/sys/winnt/nhraykey.c @@ -160,9 +160,9 @@ static char where_to_get_source[] = "http://www.nethack.org/"; static char author[] = "Ray Chason"; +#include "win32api.h" #include "hack.h" #include "wintty.h" -#include "win32api.h" extern HANDLE hConIn; extern INPUT_RECORD ir; diff --git a/sys/winnt/ntsound.c b/sys/winnt/ntsound.c index 0e4efbf16..c8ec07450 100644 --- a/sys/winnt/ntsound.c +++ b/sys/winnt/ntsound.c @@ -10,8 +10,8 @@ * */ -#include "hack.h" #include "win32api.h" +#include "hack.h" #include #ifdef USER_SOUNDS diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 0409d3336..63ef24020 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -16,11 +16,12 @@ #ifdef WIN32 #define NEED_VARARGS /* Uses ... */ +#include "win32api.h" +#include "winos.h" #include "hack.h" #include "wintty.h" #include #include -#include "win32api.h" extern boolean getreturn_enabled; /* from sys/share/pcsys.c */ extern int redirect_stdout; @@ -569,6 +570,9 @@ char ch; } break; default: + + // Temporary fix. Tty putstatusfield() + inverse = (console.current_nhattr[ATR_INVERSE] && iflags.wc_inverse); console.attr = (inverse) ? ttycolors_inv[console.current_nhcolor] : @@ -601,42 +605,6 @@ char ch; * for win32. It is used for glyphs only, not text. */ -/* CP437 to Unicode mapping according to the Unicode Consortium */ -static const WCHAR cp437[] = { - 0x0020, 0x263A, 0x263B, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022, - 0x25D8, 0x25CB, 0x25D9, 0x2642, 0x2640, 0x266A, 0x266B, 0x263C, - 0x25BA, 0x25C4, 0x2195, 0x203C, 0x00B6, 0x00A7, 0x25AC, 0x21A8, - 0x2191, 0x2193, 0x2192, 0x2190, 0x221F, 0x2194, 0x25B2, 0x25BC, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2302, - 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, - 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5, - 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, - 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x0192, - 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba, - 0x00bf, 0x2310, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb, - 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, - 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, - 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f, - 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, - 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b, - 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, - 0x03b1, 0x00df, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4, - 0x03a6, 0x0398, 0x03a9, 0x03b4, 0x221e, 0x03c6, 0x03b5, 0x2229, - 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, - 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0 -}; - void g_putch(in_ch) int in_ch; @@ -1690,12 +1658,17 @@ void set_cp_map() if (console.has_unicode) { UINT codePage = GetConsoleOutputCP(); - for (int i = 0; i < 256; i++) { - char c = (char)i; - int count = MultiByteToWideChar(codePage, 0, &c, 1, - &console.cpMap[i], 1); - ntassert(count == 1); + if (codePage == 437) { + memcpy(console.cpMap, cp437, sizeof(console.cpMap)); + } else { + for (int i = 0; i < 256; i++) { + char c = (char)i; + int count = MultiByteToWideChar(codePage, 0, &c, 1, + &console.cpMap[i], 1); + ntassert(count == 1); + } } + } } diff --git a/sys/winnt/stubs.c b/sys/winnt/stubs.c index 64193ce17..bb5ad82e4 100644 --- a/sys/winnt/stubs.c +++ b/sys/winnt/stubs.c @@ -2,6 +2,7 @@ /* Copyright (c) 2015 by Michael Allison */ /* NetHack may be freely redistributed. See license for details. */ +#include "win32api.h" #include "hack.h" #ifdef GUISTUB @@ -52,9 +53,6 @@ char *argv[]; #ifdef TTYSTUB -#include "hack.h" -#include "win32api.h" - HANDLE hConIn; HANDLE hConOut; int GUILaunched; diff --git a/sys/winnt/win32api.h b/sys/winnt/win32api.h index b4dc7e4c8..28514b0ce 100644 --- a/sys/winnt/win32api.h +++ b/sys/winnt/win32api.h @@ -7,22 +7,36 @@ * header files & NetHack before including windows.h, so all NetHack * files should include "win32api.h" rather than . */ +#ifndef WIN32API +#define WIN32API + #if defined(_MSC_VER) -#undef strcmpi -#undef min -#undef max -#pragma warning(disable : 4142) /* Warning, Benign redefinition of type */ -#pragma pack(8) + +#if defined(HACK_H) +#error win32api.h must be included before hack.h #endif -#define WIN32_LEAN_AND_MEAN +#if defined(strcmpi) +#error win32api.h should be included first +#endif -#undef Protection /* We have a global name space collision. No source file - using win32api.h should be using the Protection macro - from youprop.h. - A better fix would be to ensure we include all window - header files before we start clobbering the global name - space with NetHack specific macros. */ +#if defined(min) +#error win32api.h should be included first +#endif + +#if defined(max) +#error win32api.h should be included first +#endif + +#if defined(Protection) +#error win32api.h should be included first +#endif + +#pragma warning(disable : 4142) /* Warning, Benign redefinition of type */ +#pragma pack(8) +#endif // _MSC_VER + +#define WIN32_LEAN_AND_MEAN #include #include @@ -31,4 +45,6 @@ #pragma pack() #endif +#endif // WIN32API + /*win32api.h*/ diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index 966b268e0..93f372d62 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -11,6 +11,8 @@ * */ +#include "winos.h" + #define NEED_VARARGS #include "hack.h" #include @@ -18,7 +20,6 @@ #include #endif #include -#include "win32api.h" #ifdef TTY_GRAPHICS #include "wintty.h" #endif @@ -491,6 +492,95 @@ void nethack_enter_winnt() nethack_enter_nttty(); #endif } + +/* CP437 to Unicode mapping according to the Unicode Consortium */ +const WCHAR cp437[256] = { + 0x0020, 0x263A, 0x263B, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022, + 0x25D8, 0x25CB, 0x25D9, 0x2642, 0x2640, 0x266A, 0x266B, 0x263C, + 0x25BA, 0x25C4, 0x2195, 0x203C, 0x00B6, 0x00A7, 0x25AC, 0x21A8, + 0x2191, 0x2193, 0x2192, 0x2190, 0x221F, 0x2194, 0x25B2, 0x25BC, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, + 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, + 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, + 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, + 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2302, + 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, + 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5, + 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, + 0x00ff, 0x00d6, 0x00dc, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x0192, + 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba, + 0x00bf, 0x2310, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, + 0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510, + 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f, + 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567, + 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b, + 0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580, + 0x03b1, 0x00df, 0x0393, 0x03c0, 0x03a3, 0x03c3, 0x00b5, 0x03c4, + 0x03a6, 0x0398, 0x03a9, 0x03b4, 0x221e, 0x03c6, 0x03b5, 0x2229, + 0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248, + 0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0 +}; + +WCHAR * +winos_ascii_to_wide_str(const unsigned char * src, WCHAR * dst, size_t dstLength) +{ + size_t i = 0; + while(i < dstLength - 1 && src[i] != 0) + dst[i++] = cp437[src[i]]; + dst[i] = 0; + return dst; +} + +WCHAR +winos_ascii_to_wide(const unsigned char c) +{ + return cp437[c]; +} + +BOOL winos_font_support_cp437(HFONT hFont) +{ + BOOL allFound = FALSE; + HDC hdc = GetDC(NULL); + HFONT oldFont = SelectObject(hdc, hFont); + + DWORD size = GetFontUnicodeRanges(hdc, NULL); + GLYPHSET *glyphSet = (GLYPHSET *) malloc(size); + + if (glyphSet != NULL) { + GetFontUnicodeRanges(hdc, glyphSet); + + allFound = TRUE; + for (int i = 0; i < 256 && allFound; i++) { + WCHAR wc = cp437[i]; + BOOL found = FALSE; + for (DWORD j = 0; j < glyphSet->cRanges && !found; j++) { + WCHAR first = glyphSet->ranges[j].wcLow; + WCHAR last = first + glyphSet->ranges[j].cGlyphs - 1; + + if (wc >= first && wc <= last) + found = TRUE; + } + if (!found) + allFound = FALSE; + } + + free(glyphSet); + } + + SelectObject(hdc, oldFont); + ReleaseDC(NULL, hdc); + + return allFound; +} + #endif /* WIN32 */ -/*winnt.c*/ +/*winnt.c*/ \ No newline at end of file diff --git a/sys/winnt/winos.h b/sys/winnt/winos.h new file mode 100644 index 000000000..39a4b408e --- /dev/null +++ b/sys/winnt/winos.h @@ -0,0 +1,20 @@ +/* NetHack 3.6 winos.h $NHDT-Date: 1524321419 2018/04/21 14:36:59 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.30 $ */ +/* Copyright (c) NetHack PC Development Team 2018 */ +/* NetHack may be freely redistributed. See license for details. */ + +#ifndef WINOS_H +#define WINOS_H + +#include "win32api.h" + +extern const WCHAR cp437[256]; + +WCHAR * +winos_ascii_to_wide_str(const unsigned char * src, WCHAR * dst, size_t dstLength); + +WCHAR +winos_ascii_to_wide(const unsigned char c); + +BOOL winos_font_support_cp437(HFONT hFont); + +#endif // WINOS_H diff --git a/util/recover.c b/util/recover.c index 27c58e709..415313bee 100644 --- a/util/recover.c +++ b/util/recover.c @@ -7,15 +7,16 @@ * level files. Requires that the `checkpoint' option be enabled at the * time NetHack creates those level files. */ -#include "config.h" -#if !defined(O_WRONLY) && !defined(LSC) && !defined(AZTEC_C) -#include -#endif #ifdef WIN32 #include #include "win32api.h" #endif +#include "config.h" +#if !defined(O_WRONLY) && !defined(LSC) && !defined(AZTEC_C) +#include +#endif + #ifdef VMS extern int FDECL(vms_creat, (const char *, unsigned)); extern int FDECL(vms_open, (const char *, int, unsigned)); diff --git a/win/share/tile2bmp.c b/win/share/tile2bmp.c index d0fb36333..ca2c7dd73 100644 --- a/win/share/tile2bmp.c +++ b/win/share/tile2bmp.c @@ -12,12 +12,13 @@ /* #pragma warning(4103:disable) */ -#include "hack.h" -#include "tile.h" #ifndef __GNUC__ #include "win32api.h" #endif +#include "hack.h" +#include "tile.h" + #include #if defined(UINT32_MAX) && defined(INT32_MAX) && defined(UINT16_MAX) #define UINT8 uint8_t diff --git a/win/win32/mhfont.c b/win/win32/mhfont.c index 1b802f2d0..12edec439 100644 --- a/win/win32/mhfont.c +++ b/win/win32/mhfont.c @@ -4,6 +4,7 @@ /* font management and such */ +#include "winos.h" #include "mhfont.h" #define MAXFONTS 64 @@ -12,6 +13,7 @@ static struct font_table_entry { int code; HFONT hFont; + BOOL supportsUnicode; } font_table[MAXFONTS]; static int font_table_size = 0; HFONT version_splash_font; @@ -50,6 +52,16 @@ mswin_destroy_splashfonts() DeleteObject(version_splash_font); } +BOOL +mswin_font_supports_unicode(HFONT hFont) +{ + for (int i = 0; i < font_table_size; i++) + if (font_table[i].hFont == hFont) + return font_table[i].supportsUnicode; + + return FALSE; +} + /* create font based on window type, charater attributes and window device context */ HGDIOBJ @@ -198,6 +210,8 @@ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace) font_table[font_index].code = NHFONT_CODE(win_type, attr); font_table[font_index].hFont = fnt; + font_table[font_index].supportsUnicode = winos_font_support_cp437(fnt); + return fnt; } diff --git a/win/win32/mhfont.h b/win/win32/mhfont.h index de5fdc8e5..76e651215 100644 --- a/win/win32/mhfont.h +++ b/win/win32/mhfont.h @@ -9,6 +9,7 @@ #include "winMS.h" +BOOL mswin_font_supports_unicode(HFONT hFont); HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace); void mswin_init_splashfonts(HWND hWnd); void mswin_destroy_splashfonts(void); diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index 8b301da66..347de429c 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -2,12 +2,13 @@ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ -#include "winMS.h" -#include "resource.h" +#include "winos.h" #include "mhmap.h" -#include "mhmsg.h" -#include "mhinput.h" #include "mhfont.h" +#include "mhinput.h" +#include "mhmsg.h" +#include "resource.h" +#include "winMS.h" #include "color.h" #include "patchlevel.h" @@ -17,12 +18,14 @@ extern short glyph2tile[]; -#define TILEBMP_X(ntile) ((ntile % GetNHApp()->mapTilesPerLine) * GetNHApp()->mapTile_X) -#define TILEBMP_Y(ntile) ((ntile / GetNHApp()->mapTilesPerLine) * GetNHApp()->mapTile_Y) +#define TILEBMP_X(ntile) \ + ((ntile % GetNHApp()->mapTilesPerLine) * GetNHApp()->mapTile_X) +#define TILEBMP_Y(ntile) \ + ((ntile / GetNHApp()->mapTilesPerLine) * GetNHApp()->mapTile_Y) /* map window data */ typedef struct mswin_nethack_map_window { - int map[COLNO][ROWNO]; /* glyph map */ + int map[COLNO][ROWNO]; /* glyph map */ int bkmap[COLNO][ROWNO]; /* backround glyph map */ int mapMode; /* current map mode */ @@ -35,6 +38,7 @@ typedef struct mswin_nethack_map_window { POINT map_orig; /* map origin point */ HFONT hMapFont; /* font for ASCII mode */ + boolean bUnicodeFont; /* font supports unicode page 437 */ } NHMapWindow, *PNHMapWindow; static TCHAR szNHMapWindowClass[] = TEXT("MSNethackMapWndClass"); @@ -199,6 +203,7 @@ mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw) NH_A2W(NHMAP_FONT_NAME, lgfnt.lfFaceName, LF_FACESIZE); } data->hMapFont = CreateFontIndirect(&lgfnt); + data->bUnicodeFont = winos_font_support_cp437(data->hMapFont); mswin_cliparound(data->xCur, data->yCur); @@ -460,13 +465,13 @@ onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) data->map[msg_data->x][msg_data->y] = msg_data->glyph; data->bkmap[msg_data->x][msg_data->y] = msg_data->bkglyph; - /* invalidate the update area. Erase backround if there + /* invalidate the update area. Erase backround if there is nothing to paint or we are in text mode */ nhcoord2display(data, msg_data->x, msg_data->y, &rt); - InvalidateRect(hWnd, &rt, - (((msg_data->glyph == NO_GLYPH) && (msg_data->bkglyph == NO_GLYPH)) - || data->bAsciiMode - || Is_rogue_level(&u.uz))); + InvalidateRect(hWnd, &rt, + (((msg_data->glyph == NO_GLYPH) + && (msg_data->bkglyph == NO_GLYPH)) + || data->bAsciiMode || Is_rogue_level(&u.uz))); } } break; @@ -664,7 +669,7 @@ onPaint(HWND hWnd) for (j = paint_rt.top; j < paint_rt.bottom; j++) if (data->map[i][j] >= 0) { char ch; - TCHAR wch; + WCHAR wch; RECT glyph_rect; int color; unsigned special; @@ -703,9 +708,15 @@ onPaint(HWND hWnd) OldFg = SetTextColor(hDC, nhcolor_to_RGB(color)); } #endif - - DrawText(hDC, NH_A2W(&ch, &wch, 1), 1, &glyph_rect, + if (data->bUnicodeFont) { + wch = winos_ascii_to_wide(ch); + DrawTextW(hDC, &wch, 1, &glyph_rect, + DT_CENTER | DT_VCENTER | DT_NOPREFIX); + } else { + DrawTextA(hDC, &ch, 1, &glyph_rect, DT_CENTER | DT_VCENTER | DT_NOPREFIX); + } + SetTextColor(hDC, OldFg); } SelectObject(hDC, oldFont); @@ -741,7 +752,7 @@ onPaint(HWND hWnd) data->xScrTile, data->yScrTile, tileDC, t_x, t_y, GetNHApp()->mapTile_X, GetNHApp()->mapTile_Y, SRCCOPY); - layer ++; + layer++; } if ((glyph != NO_GLYPH) && (glyph != bkglyph)) { @@ -753,8 +764,8 @@ onPaint(HWND hWnd) if (layer > 0) { (*GetNHApp()->lpfnTransparentBlt)( hDC, glyph_rect.left, glyph_rect.top, - data->xScrTile, data->yScrTile, tileDC, - t_x, t_y, GetNHApp()->mapTile_X, + data->xScrTile, data->yScrTile, tileDC, t_x, + t_y, GetNHApp()->mapTile_X, GetNHApp()->mapTile_Y, TILE_BK_COLOR); } else { StretchBlt(hDC, glyph_rect.left, glyph_rect.top, @@ -763,18 +774,18 @@ onPaint(HWND hWnd) GetNHApp()->mapTile_Y, SRCCOPY); } - layer ++; - } + layer++; + } #ifdef USE_PILEMARK - /* rely on NetHack core helper routine */ - (void) mapglyph(data->map[i][j], &mgch, &color, - &special, i, j); - if ((glyph != NO_GLYPH) && (special & MG_PET) + /* rely on NetHack core helper routine */ + (void) mapglyph(data->map[i][j], &mgch, &color, &special, + i, j); + if ((glyph != NO_GLYPH) && (special & MG_PET) #else - if ((glyph != NO_GLYPH) && glyph_is_pet(glyph) + if ((glyph != NO_GLYPH) && glyph_is_pet(glyph) #endif - && iflags.wc_hilite_pet) { + && iflags.wc_hilite_pet) { /* apply pet mark transparently over pet image */ HDC hdcPetMark; @@ -782,35 +793,35 @@ onPaint(HWND hWnd) /* this is DC for petmark bitmap */ hdcPetMark = CreateCompatibleDC(hDC); - bmPetMarkOld = SelectObject( - hdcPetMark, GetNHApp()->bmpPetMark); + bmPetMarkOld = + SelectObject(hdcPetMark, GetNHApp()->bmpPetMark); (*GetNHApp()->lpfnTransparentBlt)( hDC, glyph_rect.left, glyph_rect.top, - data->xScrTile, data->yScrTile, hdcPetMark, 0, - 0, TILE_X, TILE_Y, TILE_BK_COLOR); + data->xScrTile, data->yScrTile, hdcPetMark, 0, 0, + TILE_X, TILE_Y, TILE_BK_COLOR); SelectObject(hdcPetMark, bmPetMarkOld); DeleteDC(hdcPetMark); } #ifdef USE_PILEMARK - if ((glyph != NO_GLYPH) - && (special & MG_OBJPILE) && iflags.hilite_pile) { + if ((glyph != NO_GLYPH) && (special & MG_OBJPILE) + && iflags.hilite_pile) { /* apply pilemark transparently over other image */ HDC hdcPileMark; HBITMAP bmPileMarkOld; /* this is DC for pilemark bitmap */ hdcPileMark = CreateCompatibleDC(hDC); - bmPileMarkOld = SelectObject( - hdcPileMark, GetNHApp()->bmpPileMark); + bmPileMarkOld = SelectObject(hdcPileMark, + GetNHApp()->bmpPileMark); (*GetNHApp()->lpfnTransparentBlt)( hDC, glyph_rect.left, glyph_rect.top, - data->xScrTile, data->yScrTile, hdcPileMark, 0, - 0, TILE_X, TILE_Y, TILE_BK_COLOR); + data->xScrTile, data->yScrTile, hdcPileMark, 0, 0, + TILE_X, TILE_Y, TILE_BK_COLOR); SelectObject(hdcPileMark, bmPileMarkOld); - DeleteDC(hdcPileMark); - } + DeleteDC(hdcPileMark); + } #endif } @@ -1030,4 +1041,3 @@ nhcolor_to_RGB(int c) return GetNHApp()->regMapColors[c]; return RGB(0x00, 0x00, 0x00); } - diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index 6b0b4fda2..a298f3893 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -561,7 +561,7 @@ onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) saveFont = SelectObject(hdc, mswin_get_font(NHW_MENU, ATR_NONE, hdc, FALSE)); SetRect(&text_rt, 0, 0, 0, 0); - DrawText(hdc, msg_data->text, strlen(msg_data->text), &text_rt, + DrawTextA(hdc, msg_data->text, strlen(msg_data->text), &text_rt, DT_CALCRECT | DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE); data->text.text_box_size.cx = diff --git a/win/win32/mhstatus.c b/win/win32/mhstatus.c index 80799ad82..074762816 100644 --- a/win/win32/mhstatus.c +++ b/win/win32/mhstatus.c @@ -3,6 +3,7 @@ /* NetHack may be freely redistributed. See license for details. */ #include +#include "winos.h" #include "winMS.h" #include "mhstatus.h" #include "mhmsg.h" @@ -278,7 +279,7 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam) int **fop; SIZE sz; HGDIOBJ normalFont, boldFont; - TCHAR wbuf[BUFSZ]; + WCHAR wbuf[BUFSZ]; RECT rt; PAINTSTRUCT ps; HDC hdc; @@ -335,7 +336,8 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam) clr = data->colors[*f] & 0x00ff; atr = (data->colors[*f] & 0xff00) >> 8; vlen = strlen(data->vals[*f]); - NH_A2W(data->vals[*f], wbuf, SIZE(wbuf)); + + const char *str = data->vals[*f]; if (atr & HL_BOLD) fntatr = ATR_BOLD; @@ -347,7 +349,13 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam) fntatr = ATR_BLINK; else if (atr & HL_DIM) fntatr = ATR_DIM; + fnt = mswin_get_font(NHW_STATUS, fntatr, hdc, FALSE); + + BOOL useUnicode = mswin_font_supports_unicode(fnt); + + winos_ascii_to_wide_str(str, wbuf, SIZE(wbuf)); + nFg = (clr == NO_COLOR ? status_fg_color : ((clr >= 0 && clr < CLR_MAX) ? nhcolor_to_RGB(clr) : status_fg_color)); @@ -365,11 +373,19 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam) /* SetTextColor(hdc, nhcolor_to_RGB(hpbar_color)); */ SetTextColor(hdc, status_fg_color); - /* get bounding rectangle */ - GetTextExtentPoint32(hdc, wbuf, vlen, &sz); + if (useUnicode) { + /* get bounding rectangle */ + GetTextExtentPoint32W(hdc, wbuf, vlen, &sz); - /* first draw title normally */ - DrawText(hdc, wbuf, vlen, &rt, DT_LEFT); + /* first draw title normally */ + DrawTextW(hdc, wbuf, vlen, &rt, DT_LEFT); + } else { + /* get bounding rectangle */ + GetTextExtentPoint32A(hdc, str, vlen, &sz); + + /* first draw title normally */ + DrawTextA(hdc, str, vlen, &rt, DT_LEFT); + } if (hpbar_percent > 0) { /* calc bar length */ @@ -385,7 +401,11 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam) FillRect(hdc, &barrect, back_brush); SetBkMode(hdc, TRANSPARENT); SetTextColor(hdc, nBg); - DrawText(hdc, wbuf, vlen, &barrect, DT_LEFT); + + if (useUnicode) + DrawTextW(hdc, wbuf, vlen, &barrect, DT_LEFT); + else + DrawTextA(hdc, str, vlen, &barrect, DT_LEFT); } DeleteObject(back_brush); } else { @@ -401,11 +421,19 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam) SetBkColor(hdc, nBg); SetTextColor(hdc, nFg); - /* get bounding rectangle */ - GetTextExtentPoint32(hdc, wbuf, vlen, &sz); + if (useUnicode) { + /* get bounding rectangle */ + GetTextExtentPoint32W(hdc, wbuf, vlen, &sz); - /* draw */ - DrawText(hdc, wbuf, vlen, &rt, DT_LEFT); + /* draw */ + DrawTextW(hdc, wbuf, vlen, &rt, DT_LEFT); + } else { + /* get bounding rectangle */ + GetTextExtentPoint32A(hdc, str, vlen, &sz); + + /* draw */ + DrawTextA(hdc, str, vlen, &rt, DT_LEFT); + } } assert(sz.cy >= 0); From f3bc4af2420454b2286d57126b5fdc29221a87ab Mon Sep 17 00:00:00 2001 From: Bart House Date: Mon, 12 Nov 2018 09:13:51 -0800 Subject: [PATCH 2/5] Removing support for Visual Studio 2015 solution. --- sys/winnt/Install.nt | 21 +-- win/win32/mhmap.c | 1 + win/win32/vs2015/NetHack.sln | 197 ----------------------- win/win32/vs2015/NetHack.vcxproj | 232 ---------------------------- win/win32/vs2015/NetHackW.vcxproj | 191 ----------------------- win/win32/vs2015/afterdgncomp.proj | 12 -- win/win32/vs2015/afterdlb.proj | 17 -- win/win32/vs2015/afterlevcomp.proj | 12 -- win/win32/vs2015/aftermakedefs.proj | 21 --- win/win32/vs2015/afternethack.proj | 15 -- win/win32/vs2015/afterrecover.proj | 12 -- win/win32/vs2015/aftertile2bmp.proj | 13 -- win/win32/vs2015/aftertilemap.proj | 12 -- win/win32/vs2015/afteruudecode.proj | 20 --- win/win32/vs2015/build.bat | 44 ------ win/win32/vs2015/common.props | 41 ----- win/win32/vs2015/config.props | 21 --- win/win32/vs2015/console.props | 11 -- win/win32/vs2015/default.props | 18 --- win/win32/vs2015/default_dll.props | 17 -- win/win32/vs2015/dgncomp.vcxproj | 125 --------------- win/win32/vs2015/dirs.props | 24 --- win/win32/vs2015/dlb.vcxproj | 43 ------ win/win32/vs2015/dll.props | 11 -- win/win32/vs2015/files.props | 227 --------------------------- win/win32/vs2015/levcomp.vcxproj | 88 ----------- win/win32/vs2015/makedefs.vcxproj | 55 ------- win/win32/vs2015/nh340key.def | 8 - win/win32/vs2015/nh340key.vcxproj | 42 ----- win/win32/vs2015/nhdefkey.def | 8 - win/win32/vs2015/nhdefkey.vcxproj | 42 ----- win/win32/vs2015/nhraykey.def | 8 - win/win32/vs2015/nhraykey.vcxproj | 42 ----- win/win32/vs2015/notes.txt | 45 ------ win/win32/vs2015/recover.vcxproj | 45 ------ win/win32/vs2015/tile2bmp.vcxproj | 47 ------ win/win32/vs2015/tilemap.vcxproj | 81 ---------- win/win32/vs2015/tiles.vcxproj | 124 --------------- win/win32/vs2015/uudecode.vcxproj | 29 ---- 39 files changed, 8 insertions(+), 2014 deletions(-) delete mode 100755 win/win32/vs2015/NetHack.sln delete mode 100755 win/win32/vs2015/NetHack.vcxproj delete mode 100755 win/win32/vs2015/NetHackW.vcxproj delete mode 100644 win/win32/vs2015/afterdgncomp.proj delete mode 100644 win/win32/vs2015/afterdlb.proj delete mode 100644 win/win32/vs2015/afterlevcomp.proj delete mode 100644 win/win32/vs2015/aftermakedefs.proj delete mode 100644 win/win32/vs2015/afternethack.proj delete mode 100644 win/win32/vs2015/afterrecover.proj delete mode 100644 win/win32/vs2015/aftertile2bmp.proj delete mode 100644 win/win32/vs2015/aftertilemap.proj delete mode 100644 win/win32/vs2015/afteruudecode.proj delete mode 100644 win/win32/vs2015/build.bat delete mode 100644 win/win32/vs2015/common.props delete mode 100644 win/win32/vs2015/config.props delete mode 100644 win/win32/vs2015/console.props delete mode 100644 win/win32/vs2015/default.props delete mode 100644 win/win32/vs2015/default_dll.props delete mode 100755 win/win32/vs2015/dgncomp.vcxproj delete mode 100644 win/win32/vs2015/dirs.props delete mode 100644 win/win32/vs2015/dlb.vcxproj delete mode 100644 win/win32/vs2015/dll.props delete mode 100644 win/win32/vs2015/files.props delete mode 100755 win/win32/vs2015/levcomp.vcxproj delete mode 100755 win/win32/vs2015/makedefs.vcxproj delete mode 100644 win/win32/vs2015/nh340key.def delete mode 100644 win/win32/vs2015/nh340key.vcxproj delete mode 100644 win/win32/vs2015/nhdefkey.def delete mode 100755 win/win32/vs2015/nhdefkey.vcxproj delete mode 100644 win/win32/vs2015/nhraykey.def delete mode 100644 win/win32/vs2015/nhraykey.vcxproj delete mode 100644 win/win32/vs2015/notes.txt delete mode 100755 win/win32/vs2015/recover.vcxproj delete mode 100755 win/win32/vs2015/tile2bmp.vcxproj delete mode 100755 win/win32/vs2015/tilemap.vcxproj delete mode 100755 win/win32/vs2015/tiles.vcxproj delete mode 100755 win/win32/vs2015/uudecode.vcxproj diff --git a/sys/winnt/Install.nt b/sys/winnt/Install.nt index dd278e0a4..9d8fd01e0 100644 --- a/sys/winnt/Install.nt +++ b/sys/winnt/Install.nt @@ -22,7 +22,6 @@ You can build a TTY version of NetHack and a Windows Graphical version. You can use one of the following build environments: o A copy of Microsoft Visual Studio 2017 Community Edition - OR Microsoft Visual Studio 2015 Express OR @@ -35,20 +34,15 @@ version. You can use one of the following build environments: Graphical version. /--------------------------------------------------------\ -| Building And Running Using Visual Studio 2015 or | -| Visual Studio 2017 | +| Building And Running Using Visual Studio 2017 | \--------------------------------------------------------/ -If you are NOT using Visual Studio 2015 or Visual Studio 2017 IDE, or -you prefer to build using a Make utility and a Makefile proceed -to "Building Using Make". +If you are NOT using Visual Studio 2017 IDE, or you prefer to build +using a Make utility and a Makefile proceed to "Building Using Make". -When using either Visual Studio 2015 or Visual Studio 2017, you simply -need to load the solution file within the IDE, build the solution and -run the version of NetHack you wish to run. - -The Visual Studio 2015 NetHack solution file can be found here: - win\win32\vs2015\NetHack.sln +When using either Visual Studio 2017, you simply need to load the +solution file within the IDE, build the solution and run the version +of NetHack you wish to run. The Visual Studio 2017 NetHack solution file can be found here: win\win32\vs2017\NetHack.sln @@ -64,8 +58,7 @@ You can also build all the projects for all platforms and configurations using a "build.bat" batch file found in the same directory as the solution. Open a developer command prompt for the version of Visual Studio you are -using. Change to the appropriate directory (i.e. win\win32\vs2015 for -VS2015 builds, win\win32\vs2017 for VS2017 builds) and run "build.bat". +using. Change to the directory win\win32\vs2017 and run "build.bat". /-----------------------------------\ | Building Using Make | diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index 347de429c..de95d687d 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -13,6 +13,7 @@ #include "color.h" #include "patchlevel.h" +//#define NHMAP_FONT_NAME TEXT("Terminal") #define NHMAP_FONT_NAME TEXT("Terminal") #define MAXWINDOWTEXT 255 diff --git a/win/win32/vs2015/NetHack.sln b/win/win32/vs2015/NetHack.sln deleted file mode 100755 index 2c2e78230..000000000 --- a/win/win32/vs2015/NetHack.sln +++ /dev/null @@ -1,197 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetHackW", "NetHackW.vcxproj", "{CEC5D360-8804-454F-8591-002184C23499}" - ProjectSection(ProjectDependencies) = postProject - {93F10526-209E-41D7-BBEA-775787876895} = {93F10526-209E-41D7-BBEA-775787876895} - {63F9B82B-F589-4082-ABE5-D4F0682050AB} = {63F9B82B-F589-4082-ABE5-D4F0682050AB} - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} = {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - {642BC75D-ABAF-403E-8224-7C725FD4CB42} = {642BC75D-ABAF-403E-8224-7C725FD4CB42} - {6813477F-64B6-4B97-B230-438D0D233385} = {6813477F-64B6-4B97-B230-438D0D233385} - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC} = {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC} - {8A3F81C7-2968-49A8-86BF-2669412AD7DE} = {8A3F81C7-2968-49A8-86BF-2669412AD7DE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dgncomp", "dgncomp.vcxproj", "{8A3F81C7-2968-49A8-86BF-2669412AD7DE}" - ProjectSection(ProjectDependencies) = postProject - {642BC75D-ABAF-403E-8224-7C725FD4CB42} = {642BC75D-ABAF-403E-8224-7C725FD4CB42} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dlb", "dlb.vcxproj", "{0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}" - ProjectSection(ProjectDependencies) = postProject - {63F9B82B-F589-4082-ABE5-D4F0682050AB} = {63F9B82B-F589-4082-ABE5-D4F0682050AB} - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} = {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - {8A3F81C7-2968-49A8-86BF-2669412AD7DE} = {8A3F81C7-2968-49A8-86BF-2669412AD7DE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "levcomp", "levcomp.vcxproj", "{9DD9C52E-E8C9-4533-BD22-83C055C0AABA}" - ProjectSection(ProjectDependencies) = postProject - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "makedefs", "makedefs.vcxproj", "{BA3DD34C-04B7-40D0-B373-9329AA9E8945}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recover", "recover.vcxproj", "{2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tile2bmp", "tile2bmp.vcxproj", "{642BC75D-ABAF-403E-8224-7C725FD4CB42}" - ProjectSection(ProjectDependencies) = postProject - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} = {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tilemap", "tilemap.vcxproj", "{93F10526-209E-41D7-BBEA-775787876895}" - ProjectSection(ProjectDependencies) = postProject - {8A3F81C7-2968-49A8-86BF-2669412AD7DE} = {8A3F81C7-2968-49A8-86BF-2669412AD7DE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uudecode", "uudecode.vcxproj", "{63F9B82B-F589-4082-ABE5-D4F0682050AB}" - ProjectSection(ProjectDependencies) = postProject - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetHack", "NetHack.vcxproj", "{609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}" - ProjectSection(ProjectDependencies) = postProject - {63F9B82B-F589-4082-ABE5-D4F0682050AB} = {63F9B82B-F589-4082-ABE5-D4F0682050AB} - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} = {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - {6813477F-64B6-4B97-B230-438D0D233385} = {6813477F-64B6-4B97-B230-438D0D233385} - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC} = {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC} - {8A3F81C7-2968-49A8-86BF-2669412AD7DE} = {8A3F81C7-2968-49A8-86BF-2669412AD7DE} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nhdefkey", "nhdefkey.vcxproj", "{6813477F-64B6-4B97-B230-438D0D233385}" - ProjectSection(ProjectDependencies) = postProject - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nh340key", "nh340key.vcxproj", "{BE04E242-A1E9-4593-B95B-057F37330B76}" - ProjectSection(ProjectDependencies) = postProject - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nhraykey", "nhraykey.vcxproj", "{2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}" - ProjectSection(ProjectDependencies) = postProject - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CEC5D360-8804-454F-8591-002184C23499}.Debug|Win32.ActiveCfg = Debug|Win32 - {CEC5D360-8804-454F-8591-002184C23499}.Debug|Win32.Build.0 = Debug|Win32 - {CEC5D360-8804-454F-8591-002184C23499}.Debug|x64.ActiveCfg = Debug|x64 - {CEC5D360-8804-454F-8591-002184C23499}.Debug|x64.Build.0 = Debug|x64 - {CEC5D360-8804-454F-8591-002184C23499}.Release|Win32.ActiveCfg = Release|Win32 - {CEC5D360-8804-454F-8591-002184C23499}.Release|Win32.Build.0 = Release|Win32 - {CEC5D360-8804-454F-8591-002184C23499}.Release|x64.ActiveCfg = Release|x64 - {CEC5D360-8804-454F-8591-002184C23499}.Release|x64.Build.0 = Release|x64 - {8A3F81C7-2968-49A8-86BF-2669412AD7DE}.Debug|Win32.ActiveCfg = Debug|Win32 - {8A3F81C7-2968-49A8-86BF-2669412AD7DE}.Debug|Win32.Build.0 = Debug|Win32 - {8A3F81C7-2968-49A8-86BF-2669412AD7DE}.Debug|x64.ActiveCfg = Debug|x64 - {8A3F81C7-2968-49A8-86BF-2669412AD7DE}.Debug|x64.Build.0 = Debug|x64 - {8A3F81C7-2968-49A8-86BF-2669412AD7DE}.Release|Win32.ActiveCfg = Release|Win32 - {8A3F81C7-2968-49A8-86BF-2669412AD7DE}.Release|Win32.Build.0 = Release|Win32 - {8A3F81C7-2968-49A8-86BF-2669412AD7DE}.Release|x64.ActiveCfg = Release|x64 - {8A3F81C7-2968-49A8-86BF-2669412AD7DE}.Release|x64.Build.0 = Release|x64 - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}.Debug|Win32.ActiveCfg = Debug|Win32 - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}.Debug|Win32.Build.0 = Debug|Win32 - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}.Debug|x64.ActiveCfg = Debug|x64 - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}.Debug|x64.Build.0 = Debug|x64 - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}.Release|Win32.ActiveCfg = Release|Win32 - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}.Release|Win32.Build.0 = Release|Win32 - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}.Release|x64.ActiveCfg = Release|x64 - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC}.Release|x64.Build.0 = Release|x64 - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA}.Debug|Win32.ActiveCfg = Debug|Win32 - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA}.Debug|Win32.Build.0 = Debug|Win32 - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA}.Debug|x64.ActiveCfg = Debug|x64 - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA}.Debug|x64.Build.0 = Debug|x64 - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA}.Release|Win32.ActiveCfg = Release|Win32 - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA}.Release|Win32.Build.0 = Release|Win32 - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA}.Release|x64.ActiveCfg = Release|x64 - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA}.Release|x64.Build.0 = Release|x64 - {BA3DD34C-04B7-40D0-B373-9329AA9E8945}.Debug|Win32.ActiveCfg = Debug|Win32 - {BA3DD34C-04B7-40D0-B373-9329AA9E8945}.Debug|Win32.Build.0 = Debug|Win32 - {BA3DD34C-04B7-40D0-B373-9329AA9E8945}.Debug|x64.ActiveCfg = Debug|x64 - {BA3DD34C-04B7-40D0-B373-9329AA9E8945}.Debug|x64.Build.0 = Debug|x64 - {BA3DD34C-04B7-40D0-B373-9329AA9E8945}.Release|Win32.ActiveCfg = Release|Win32 - {BA3DD34C-04B7-40D0-B373-9329AA9E8945}.Release|Win32.Build.0 = Release|Win32 - {BA3DD34C-04B7-40D0-B373-9329AA9E8945}.Release|x64.ActiveCfg = Release|x64 - {BA3DD34C-04B7-40D0-B373-9329AA9E8945}.Release|x64.Build.0 = Release|x64 - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}.Debug|Win32.ActiveCfg = Debug|Win32 - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}.Debug|Win32.Build.0 = Debug|Win32 - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}.Debug|x64.ActiveCfg = Debug|x64 - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}.Debug|x64.Build.0 = Debug|x64 - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}.Release|Win32.ActiveCfg = Release|Win32 - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}.Release|Win32.Build.0 = Release|Win32 - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}.Release|x64.ActiveCfg = Release|x64 - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E}.Release|x64.Build.0 = Release|x64 - {642BC75D-ABAF-403E-8224-7C725FD4CB42}.Debug|Win32.ActiveCfg = Debug|Win32 - {642BC75D-ABAF-403E-8224-7C725FD4CB42}.Debug|Win32.Build.0 = Debug|Win32 - {642BC75D-ABAF-403E-8224-7C725FD4CB42}.Debug|x64.ActiveCfg = Debug|x64 - {642BC75D-ABAF-403E-8224-7C725FD4CB42}.Debug|x64.Build.0 = Debug|x64 - {642BC75D-ABAF-403E-8224-7C725FD4CB42}.Release|Win32.ActiveCfg = Release|Win32 - {642BC75D-ABAF-403E-8224-7C725FD4CB42}.Release|Win32.Build.0 = Release|Win32 - {642BC75D-ABAF-403E-8224-7C725FD4CB42}.Release|x64.ActiveCfg = Release|x64 - {642BC75D-ABAF-403E-8224-7C725FD4CB42}.Release|x64.Build.0 = Release|x64 - {93F10526-209E-41D7-BBEA-775787876895}.Debug|Win32.ActiveCfg = Debug|Win32 - {93F10526-209E-41D7-BBEA-775787876895}.Debug|Win32.Build.0 = Debug|Win32 - {93F10526-209E-41D7-BBEA-775787876895}.Debug|x64.ActiveCfg = Debug|x64 - {93F10526-209E-41D7-BBEA-775787876895}.Debug|x64.Build.0 = Debug|x64 - {93F10526-209E-41D7-BBEA-775787876895}.Release|Win32.ActiveCfg = Release|Win32 - {93F10526-209E-41D7-BBEA-775787876895}.Release|Win32.Build.0 = Release|Win32 - {93F10526-209E-41D7-BBEA-775787876895}.Release|x64.ActiveCfg = Release|x64 - {93F10526-209E-41D7-BBEA-775787876895}.Release|x64.Build.0 = Release|x64 - {63F9B82B-F589-4082-ABE5-D4F0682050AB}.Debug|Win32.ActiveCfg = Debug|Win32 - {63F9B82B-F589-4082-ABE5-D4F0682050AB}.Debug|Win32.Build.0 = Debug|Win32 - {63F9B82B-F589-4082-ABE5-D4F0682050AB}.Debug|x64.ActiveCfg = Debug|x64 - {63F9B82B-F589-4082-ABE5-D4F0682050AB}.Debug|x64.Build.0 = Debug|x64 - {63F9B82B-F589-4082-ABE5-D4F0682050AB}.Release|Win32.ActiveCfg = Release|Win32 - {63F9B82B-F589-4082-ABE5-D4F0682050AB}.Release|Win32.Build.0 = Release|Win32 - {63F9B82B-F589-4082-ABE5-D4F0682050AB}.Release|x64.ActiveCfg = Release|x64 - {63F9B82B-F589-4082-ABE5-D4F0682050AB}.Release|x64.Build.0 = Release|x64 - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}.Debug|Win32.ActiveCfg = Debug|Win32 - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}.Debug|Win32.Build.0 = Debug|Win32 - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}.Debug|x64.ActiveCfg = Debug|x64 - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}.Debug|x64.Build.0 = Debug|x64 - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}.Release|Win32.ActiveCfg = Release|Win32 - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}.Release|Win32.Build.0 = Release|Win32 - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}.Release|x64.ActiveCfg = Release|x64 - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751}.Release|x64.Build.0 = Release|x64 - {6813477F-64B6-4B97-B230-438D0D233385}.Debug|Win32.ActiveCfg = Debug|Win32 - {6813477F-64B6-4B97-B230-438D0D233385}.Debug|Win32.Build.0 = Debug|Win32 - {6813477F-64B6-4B97-B230-438D0D233385}.Debug|x64.ActiveCfg = Debug|x64 - {6813477F-64B6-4B97-B230-438D0D233385}.Debug|x64.Build.0 = Debug|x64 - {6813477F-64B6-4B97-B230-438D0D233385}.Release|Win32.ActiveCfg = Release|Win32 - {6813477F-64B6-4B97-B230-438D0D233385}.Release|Win32.Build.0 = Release|Win32 - {6813477F-64B6-4B97-B230-438D0D233385}.Release|x64.ActiveCfg = Release|x64 - {6813477F-64B6-4B97-B230-438D0D233385}.Release|x64.Build.0 = Release|x64 - {BE04E242-A1E9-4593-B95B-057F37330B76}.Debug|Win32.ActiveCfg = Debug|Win32 - {BE04E242-A1E9-4593-B95B-057F37330B76}.Debug|Win32.Build.0 = Debug|Win32 - {BE04E242-A1E9-4593-B95B-057F37330B76}.Debug|x64.ActiveCfg = Debug|x64 - {BE04E242-A1E9-4593-B95B-057F37330B76}.Debug|x64.Build.0 = Debug|x64 - {BE04E242-A1E9-4593-B95B-057F37330B76}.Release|Win32.ActiveCfg = Release|Win32 - {BE04E242-A1E9-4593-B95B-057F37330B76}.Release|Win32.Build.0 = Release|Win32 - {BE04E242-A1E9-4593-B95B-057F37330B76}.Release|x64.ActiveCfg = Release|x64 - {BE04E242-A1E9-4593-B95B-057F37330B76}.Release|x64.Build.0 = Release|x64 - {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Debug|Win32.ActiveCfg = Debug|Win32 - {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Debug|Win32.Build.0 = Debug|Win32 - {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Debug|x64.ActiveCfg = Debug|x64 - {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Debug|x64.Build.0 = Debug|x64 - {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Release|Win32.ActiveCfg = Release|Win32 - {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Release|Win32.Build.0 = Release|Win32 - {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Release|x64.ActiveCfg = Release|x64 - {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/win/win32/vs2015/NetHack.vcxproj b/win/win32/vs2015/NetHack.vcxproj deleted file mode 100755 index 8d9335f95..000000000 --- a/win/win32/vs2015/NetHack.vcxproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - {609BC774-C6F8-4B2B-AA7D-5B3D0EA95751} - Win32Proj - NetHack - - - - - - - - - - $(BinDir) - - - - /Gs /Oi- %(AdditionalOptions) - Disabled - Default - Speed - true - $(WinWin32Dir);$(IncDir);$(SysWinntDir);$(SysShareDir);$(WinShareDir);%(AdditionalIncludeDirectories) - TILES;WIN32CON;DLB;MSWIN_GRAPHICS;_LIB;%(PreprocessorDefinitions) - - - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;Winmm.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GUISTUB;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/win32/vs2015/NetHackW.vcxproj b/win/win32/vs2015/NetHackW.vcxproj deleted file mode 100755 index bd33da76f..000000000 --- a/win/win32/vs2015/NetHackW.vcxproj +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - {CEC5D360-8804-454F-8591-002184C23499} - NetHackW - - - - - - - - - - - $(BinDir) - - - - - /Gs /Oi- %(AdditionalOptions) - Disabled - true - $(WinWin32Dir);$(IncDir);$(SysWinntDir);$(SysShareDir);$(WinShareDir);%(AdditionalIncludeDirectories) - TILES;_WINDOWS;DLB;MSWIN_GRAPHICS;WIN32CONNDEBUG;%(PreprocessorDefinitions) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - - Windows - comctl32.lib;winmm.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TTYSTUB; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/win32/vs2015/afterdgncomp.proj b/win/win32/vs2015/afterdgncomp.proj deleted file mode 100644 index 7aebee743..000000000 --- a/win/win32/vs2015/afterdgncomp.proj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/afterdlb.proj b/win/win32/vs2015/afterdlb.proj deleted file mode 100644 index ed68ba33e..000000000 --- a/win/win32/vs2015/afterdlb.proj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/win/win32/vs2015/afterlevcomp.proj b/win/win32/vs2015/afterlevcomp.proj deleted file mode 100644 index 924f66cd5..000000000 --- a/win/win32/vs2015/afterlevcomp.proj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/win/win32/vs2015/aftermakedefs.proj b/win/win32/vs2015/aftermakedefs.proj deleted file mode 100644 index a48e685a7..000000000 --- a/win/win32/vs2015/aftermakedefs.proj +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/win/win32/vs2015/afternethack.proj b/win/win32/vs2015/afternethack.proj deleted file mode 100644 index 3b769323e..000000000 --- a/win/win32/vs2015/afternethack.proj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - diff --git a/win/win32/vs2015/afterrecover.proj b/win/win32/vs2015/afterrecover.proj deleted file mode 100644 index 0652e7828..000000000 --- a/win/win32/vs2015/afterrecover.proj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/win/win32/vs2015/aftertile2bmp.proj b/win/win32/vs2015/aftertile2bmp.proj deleted file mode 100644 index 28d2b2e39..000000000 --- a/win/win32/vs2015/aftertile2bmp.proj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/win/win32/vs2015/aftertilemap.proj b/win/win32/vs2015/aftertilemap.proj deleted file mode 100644 index bfdb48fe9..000000000 --- a/win/win32/vs2015/aftertilemap.proj +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/win/win32/vs2015/afteruudecode.proj b/win/win32/vs2015/afteruudecode.proj deleted file mode 100644 index b33e3c4f4..000000000 --- a/win/win32/vs2015/afteruudecode.proj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/win/win32/vs2015/build.bat b/win/win32/vs2015/build.bat deleted file mode 100644 index 78b7356ad..000000000 --- a/win/win32/vs2015/build.bat +++ /dev/null @@ -1,44 +0,0 @@ -@echo off - -if "%VisualStudioVersion%"=="" ( - echo MSBuild environment not set ... attempting to setup build environment. - call :setup_environment -) - -if "%VisualStudioVersion%"=="" ( - echo Unable to setup build environment. Exiting. - goto :EOF -) - -msbuild NetHack.sln /t:Clean;Build /p:Configuration=Debug;Platform=Win32 -msbuild NetHack.sln /t:Clean;Build /p:Configuration=Debug;Platform=x64 -msbuild NetHack.sln /t:Clean;Build /p:Configuration=Release;Platform=Win32 -msbuild NetHack.sln /t:Clean;Build /p:Configuration=Release;Platform=x64 - -goto :EOF - -:setup_environment - - -if "%VS140COMNTOOLS%"=="" ( - call :set_vs14comntools -) - -if "%VS140COMNTOOLS%"=="" ( - echo Can not find Visual Studio 2015 Common Tools path. - echo Set VS140COMNTOOLS appropriately. - goto :EOF -) - -call "%VS140COMNTOOLS%VsMSBuildCmd.bat" -cd %~dp0 - -goto :EOF - -:set_vs14comntools - -if exist "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\Tools" ( - set "VS140COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Common7\Tools\" -) - -goto :EOF diff --git a/win/win32/vs2015/common.props b/win/win32/vs2015/common.props deleted file mode 100644 index 5889dbb7d..000000000 --- a/win/win32/vs2015/common.props +++ /dev/null @@ -1,41 +0,0 @@ - - - - true - - - false - - - - Level3 - WIN32;CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - - - Console - $(SymbolsDir)$(TargetName).pdb - - - - - Disabled - _DEBUG;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - - - true - - - - - MaxSpeed - OnlyExplicitInline - NDEBUG;%(PreprocessorDefinitions) - MultiThreaded - - - UseLinkTimeCodeGeneration - - - \ No newline at end of file diff --git a/win/win32/vs2015/config.props b/win/win32/vs2015/config.props deleted file mode 100644 index 84ef04da2..000000000 --- a/win/win32/vs2015/config.props +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - \ No newline at end of file diff --git a/win/win32/vs2015/console.props b/win/win32/vs2015/console.props deleted file mode 100644 index 8fdca9d9e..000000000 --- a/win/win32/vs2015/console.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - _CONSOLE;%(PreprocessorDefinitions) - - - Console - - - \ No newline at end of file diff --git a/win/win32/vs2015/default.props b/win/win32/vs2015/default.props deleted file mode 100644 index 82619060c..000000000 --- a/win/win32/vs2015/default.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - Application - false - MultiByte - v140 - $(BinDir) - - - true - - - false - true - - - \ No newline at end of file diff --git a/win/win32/vs2015/default_dll.props b/win/win32/vs2015/default_dll.props deleted file mode 100644 index 94a07f465..000000000 --- a/win/win32/vs2015/default_dll.props +++ /dev/null @@ -1,17 +0,0 @@ - - - - DynamicLibrary - false - MultiByte - v140 - - - true - - - false - true - - - \ No newline at end of file diff --git a/win/win32/vs2015/dgncomp.vcxproj b/win/win32/vs2015/dgncomp.vcxproj deleted file mode 100755 index a44735de3..000000000 --- a/win/win32/vs2015/dgncomp.vcxproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - {8A3F81C7-2968-49A8-86BF-2669412AD7DE} - - - - - - - - - - - - - $(IncDir);$(SysWinntDir);$(SysShareDir);%(AdditionalIncludeDirectories) - WIN32CON;DLB;MSWIN_GRAPHICS;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Lex; - Yacc; - $(BuildDependsOn); - - - - - - - NoLex; - NoYacc; - $(BuildDependsOn); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/dirs.props b/win/win32/vs2015/dirs.props deleted file mode 100644 index 8cdcf60c2..000000000 --- a/win/win32/vs2015/dirs.props +++ /dev/null @@ -1,24 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\..\..\ - $(RootDir)bin\$(Configuration)\$(Platform)\ - $(ProjectDir)obj\$(Configuration)\$(Platform)\$(TargetName)\ - $(ProjectDir)symbols\$(Configuration)\$(Platform)\$(TargetName)\ - $(RootDir)tools\$(Configuration)\$(Platform)\ - $(RootDir)util\ - $(RootDir)dat\ - $(RootDir)doc\ - $(RootDir)include\ - $(RootDir)src\ - $(RootDir)sys\ - $(RootDir)util\ - $(RootDir)sys\share\ - $(RootDir)sys\winnt\ - $(RootDir)win\share\ - $(RootDir)win\tty\ - $(RootDir)win\win32\ - $(ToolsDir) - $(ObjDir) - - \ No newline at end of file diff --git a/win/win32/vs2015/dlb.vcxproj b/win/win32/vs2015/dlb.vcxproj deleted file mode 100644 index 06424d447..000000000 --- a/win/win32/vs2015/dlb.vcxproj +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - {0303A585-3F83-4BB7-AF6B-1E12C8FB54AC} - - - - - - - - - - - - - $(IncDir);$(SysWinntDir);$(SysShareDir);%(AdditionalIncludeDirectories) - WIN32CON;DLB;MSWIN_GRAPHICS;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/dll.props b/win/win32/vs2015/dll.props deleted file mode 100644 index 3b37e2ede..000000000 --- a/win/win32/vs2015/dll.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - WIN32CON;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - - - Windows - - - \ No newline at end of file diff --git a/win/win32/vs2015/files.props b/win/win32/vs2015/files.props deleted file mode 100644 index 483ec1eb1..000000000 --- a/win/win32/vs2015/files.props +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win/win32/vs2015/levcomp.vcxproj b/win/win32/vs2015/levcomp.vcxproj deleted file mode 100755 index 1d01ffa87..000000000 --- a/win/win32/vs2015/levcomp.vcxproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - {9DD9C52E-E8C9-4533-BD22-83C055C0AABA} - - - - - - - - - - - - - $(IncDir);$(SysWinntDir);$(SysShareDir);%(AdditionalIncludeDirectories) - WIN32CON;DLB;MSWIN_GRAPHICS;YY_NO_UNISTD_H;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - Lex; - Yacc; - $(BuildDependsOn); - - - - - - - NoLex; - NoYacc; - $(BuildDependsOn); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/makedefs.vcxproj b/win/win32/vs2015/makedefs.vcxproj deleted file mode 100755 index cedd41204..000000000 --- a/win/win32/vs2015/makedefs.vcxproj +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - {BA3DD34C-04B7-40D0-B373-9329AA9E8945} - - - - - - - - - - - - - $(IncDir);$(SysWinntDir);%(AdditionalIncludeDirectories) - WIN32CON;DLB;MSWIN_GRAPHICS;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/nh340key.def b/win/win32/vs2015/nh340key.def deleted file mode 100644 index f484a536f..000000000 --- a/win/win32/vs2015/nh340key.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY nh340key -EXPORTS -ProcessKeystroke -NHkbhit -CheckInput -SourceWhere -SourceAuthor -KeyHandlerName diff --git a/win/win32/vs2015/nh340key.vcxproj b/win/win32/vs2015/nh340key.vcxproj deleted file mode 100644 index 8b2068662..000000000 --- a/win/win32/vs2015/nh340key.vcxproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - {be04e242-a1e9-4593-b95b-057f37330b76} - Win32Proj - nh340key - - - - - - - - - - $(BinDir) - - - - $(IncDir);$(SysWinntDir);%(AdditionalIncludeDirectories) - - - $(ToolsDir)$(TargetName).lib - - - - - nh340key.def - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/nhdefkey.def b/win/win32/vs2015/nhdefkey.def deleted file mode 100644 index 2950904e4..000000000 --- a/win/win32/vs2015/nhdefkey.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY nhdefkey -EXPORTS -ProcessKeystroke -NHkbhit -CheckInput -SourceWhere -SourceAuthor -KeyHandlerName diff --git a/win/win32/vs2015/nhdefkey.vcxproj b/win/win32/vs2015/nhdefkey.vcxproj deleted file mode 100755 index 84fdf2fd3..000000000 --- a/win/win32/vs2015/nhdefkey.vcxproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - {6813477F-64B6-4B97-B230-438D0D233385} - Win32Proj - nhdefkey - - - - - - - - - - $(BinDir) - - - - $(IncDir);$(SysWinntDir);%(AdditionalIncludeDirectories) - - - $(ToolsDir)$(TargetName).lib - - - - - nhdefkey.def - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/nhraykey.def b/win/win32/vs2015/nhraykey.def deleted file mode 100644 index 5432a1af3..000000000 --- a/win/win32/vs2015/nhraykey.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY nhraykey -EXPORTS -ProcessKeystroke -NHkbhit -CheckInput -SourceWhere -SourceAuthor -KeyHandlerName diff --git a/win/win32/vs2015/nhraykey.vcxproj b/win/win32/vs2015/nhraykey.vcxproj deleted file mode 100644 index 0017f4a49..000000000 --- a/win/win32/vs2015/nhraykey.vcxproj +++ /dev/null @@ -1,42 +0,0 @@ - - - - - {2e1f4bb3-3bd7-43ad-8e64-d3b8a2f5d7b2} - Win32Proj - nhraykey - - - - - - - - - - $(BinDir) - - - - $(IncDir);$(SysWinntDir);%(AdditionalIncludeDirectories) - - - $(ToolsDir)$(TargetName).lib - - - - - nhraykey.def - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/notes.txt b/win/win32/vs2015/notes.txt deleted file mode 100644 index 5a7d93371..000000000 --- a/win/win32/vs2015/notes.txt +++ /dev/null @@ -1,45 +0,0 @@ -Changes made to vs2015 build - -To Do - -Questions - -1. Why is /Gs used? This initiates stack probes for every function call (not just functions that use more then 4k)? -2. Why is /Oi- used? This turns off compiler intrinsics. -3. Why is /FS used? This forces serialization of writes to PDB. This really isn't needed. -4. Why are we disabling optimizations for release builds? -5. Why are we omitting frame pointers? Makes debugging harder. Crash dumps less usefull. -6. Why are we forcing function level linking? -7. Why are we turning off intrinsics (again)? -8. Why are we enabling additional security checks? (SDLCheck) -9. Why are we using string pooling? -10. Why do we turn off multi-processor compilation? - -Nethack Compiler Settings - Release -/Gs -/Oi- -/FS -Optimizations:Disabled -WarningLevel:Level3 -InlineFunctionExpansion:Default -FavorSizeOrSpeed:Speed -OmitFramePointers:true -Optimization:MaxSpeed -FunctionLevelLinking:true -IntrinsicFunctions:false -PreprocessorDefinitions:TILES;MSWIN_GRAPHICS;WIN32;WIN32CON;DLB;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_CONSOLE;_LIB; -SDLCheck:true -AdditionalIncludeDirectories:..\win\win32;..\include;..\sys\winnt;..\sys\share;..\win\share; -StringPooling:true -RuntimeLibrary:MultiThreaded -SuppressStartupBanner:true -MultiProcessorCompilation:false - -Nethack Link Settings - Release -SubSystem:Console -GenetateDebugInformation:true -EnableCOMDATFolding:true -OptimizeReferenes:true -AdditionalDependencies:kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;Winmm.lib; -SuppressStartupBanner:true -TargetMachine:MachineX86 diff --git a/win/win32/vs2015/recover.vcxproj b/win/win32/vs2015/recover.vcxproj deleted file mode 100755 index 7abba076f..000000000 --- a/win/win32/vs2015/recover.vcxproj +++ /dev/null @@ -1,45 +0,0 @@ - - - - - {2F35F228-6733-4FE5-9B46-B3AA10D4BC2E} - - - - - - - - - - $(BinDir) - - - - $(IncDir);$(SysWinntDir);%(AdditionalIncludeDirectories) - WIN32CON;DLB;MSWIN_GRAPHICS;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/tile2bmp.vcxproj b/win/win32/vs2015/tile2bmp.vcxproj deleted file mode 100755 index 9b72b98f1..000000000 --- a/win/win32/vs2015/tile2bmp.vcxproj +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - {642BC75D-ABAF-403E-8224-7C725FD4CB42} - - - - - - - - - - - - - $(IncDir);$(SysWinntDir);$(SysShareDir);%(AdditionalIncludeDirectories) - WIN32CON;DLB;MSWIN_GRAPHICS;%(PreprocessorDefinitions) - - - - - - - - - - - - TILETEXT;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/tilemap.vcxproj b/win/win32/vs2015/tilemap.vcxproj deleted file mode 100755 index a970b2aa6..000000000 --- a/win/win32/vs2015/tilemap.vcxproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - {93F10526-209E-41D7-BBEA-775787876895} - - - - - - - - - - - - - $(IncDir);$(SysWinntDir);$(SysShareDir);%(AdditionalIncludeDirectories) - WIN32CON;DLB;MSWIN_GRAPHICS;%(PreprocessorDefinitions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/win/win32/vs2015/tiles.vcxproj b/win/win32/vs2015/tiles.vcxproj deleted file mode 100755 index f617646f0..000000000 --- a/win/win32/vs2015/tiles.vcxproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {55946465-FC65-47B3-BB48-742C7694C0D6} - MakeFileProj - - - - Makefile - false - v120 - - - Makefile - false - v120 - - - Makefile - false - v120 - - - Makefile - false - v120 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - .\..\util\ - .\..\util\ - .\Debug\ - .\Debug\ - nmake /f "tiles.mak" - nmake /f "tiles.mak" - nmake /f "tiles.mak" /a - nmake /f "tiles.mak" /a - - - ..\win\win32\tiles.bmp - ..\win\win32\tiles.bmp - $(NMakePreprocessorDefinitions) - $(NMakePreprocessorDefinitions) - $(NMakeIncludeSearchPath) - $(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - $(NMakeForcedUsingAssemblies) - .\..\util\ - .\..\util\ - .\Release\ - .\Release\ - nmake /f "tiles.mak" - nmake /f "tiles.mak" - nmake /f "tiles.mak" /a - nmake /f "tiles.mak" /a - - - ..\win\win32\tiles.bmp - ..\win\win32\tiles.bmp - $(NMakePreprocessorDefinitions) - $(NMakePreprocessorDefinitions) - $(NMakeIncludeSearchPath) - $(NMakeIncludeSearchPath) - $(NMakeForcedIncludes) - $(NMakeForcedIncludes) - $(NMakeAssemblySearchPath) - $(NMakeAssemblySearchPath) - $(NMakeForcedUsingAssemblies) - $(NMakeForcedUsingAssemblies) - - - - - - {642bc75d-abaf-403e-8224-7c725fd4cb42} - false - - - - - - diff --git a/win/win32/vs2015/uudecode.vcxproj b/win/win32/vs2015/uudecode.vcxproj deleted file mode 100755 index d37115eed..000000000 --- a/win/win32/vs2015/uudecode.vcxproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - {63F9B82B-F589-4082-ABE5-D4F0682050AB} - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 3bb759a9ab8e5c8195bf1d0523f71a80217b344a Mon Sep 17 00:00:00 2001 From: Bart House Date: Mon, 12 Nov 2018 17:45:22 -0800 Subject: [PATCH 3/5] Started work to support per monitor DPI. Using DPI to scale tiles appropriately. Renamed ntassert to nhassert. (Naming mistake caused by using ntassert at work). Re-ordered a few more includes to get window headers included before nethack headers. --- include/ntconf.h | 8 +- sys/winnt/nttty.c | 44 +++--- sys/winnt/win10.c | 12 +- sys/winnt/win10.h | 13 +- sys/winnt/winnt.c | 4 +- win/win32/mhmap.c | 202 ++++++++++++++----------- win/win32/vs2017/.gitignore | 2 +- win/win32/vs2017/NetHackW.exe.manifest | 4 +- win/win32/winhack.c | 3 +- 9 files changed, 166 insertions(+), 126 deletions(-) diff --git a/include/ntconf.h b/include/ntconf.h index 36a87e2e4..c0e2f77c0 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -249,13 +249,13 @@ extern int FDECL(alternative_palette, (char *)); #endif #ifdef NDEBUG -#define ntassert(expression) ((void)0) +#define nhassert(expression) ((void)0) #else -extern void FDECL(ntassert_failed, (const char * exp, const char * file, +extern void FDECL(nhassert_failed, (const char * exp, const char * file, int line)); -#define ntassert(expression) (void)((!!(expression)) || \ - (ntassert_failed(#expression, __FILE__, __LINE__), 0)) +#define nhassert(expression) (void)((!!(expression)) || \ + (nhassert_failed(#expression, __FILE__, __LINE__), 0)) #endif #define nethack_enter(argc, argv) nethack_enter_winnt() diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 63ef24020..31b618acc 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -242,8 +242,8 @@ static void back_buffer_flip() void buffer_fill_to_end(cell_t * buffer, cell_t * fill, int x, int y) { - ntassert(x >= 0 && x < console.width); - ntassert(y >= 0 && ((y < console.height) || (y == console.height && + nhassert(x >= 0 && x < console.width); + nhassert(y >= 0 && ((y < console.height) || (y == console.height && x == 0))); cell_t * dst = buffer + console.width * y + x; @@ -257,8 +257,8 @@ void buffer_fill_to_end(cell_t * buffer, cell_t * fill, int x, int y) static void buffer_clear_to_end_of_line(cell_t * buffer, int x, int y) { - ntassert(x >= 0 && x < console.width); - ntassert(y >= 0 && ((y < console.height) || (y == console.height && + nhassert(x >= 0 && x < console.width); + nhassert(y >= 0 && ((y < console.height) || (y == console.height && x == 0))); cell_t * dst = buffer + console.width * y + x; cell_t *sentinel = buffer + console.width * (y + 1); @@ -272,8 +272,8 @@ static void buffer_clear_to_end_of_line(cell_t * buffer, int x, int y) void buffer_write(cell_t * buffer, cell_t * cell, COORD pos) { - ntassert(pos.X >= 0 && pos.X < console.width); - ntassert(pos.Y >= 0 && pos.Y < console.height); + nhassert(pos.X >= 0 && pos.X < console.width); + nhassert(pos.Y >= 0 && pos.Y < console.height); cell_t * dst = buffer + (console.width * pos.Y) + pos.X; *dst = *cell; @@ -465,8 +465,8 @@ int *x, *y, *mod; static void set_console_cursor(int x, int y) { - ntassert(x >= 0 && x < console.width); - ntassert(y >= 0 && y < console.height); + nhassert(x >= 0 && x < console.width); + nhassert(y >= 0 && y < console.height); console.cursor.X = max(0, min(console.width - 1, x)); console.cursor.Y = max(0, min(console.height - 1, y)); @@ -547,8 +547,8 @@ void xputc_core(ch) char ch; { - ntassert(console.cursor.X >= 0 && console.cursor.X < console.width); - ntassert(console.cursor.Y >= 0 && console.cursor.Y < console.height); + nhassert(console.cursor.X >= 0 && console.cursor.X < console.width); + nhassert(console.cursor.Y >= 0 && console.cursor.Y < console.height); boolean inverse = FALSE; cell_t cell; @@ -596,8 +596,8 @@ char ch; } } - ntassert(console.cursor.X >= 0 && console.cursor.X < console.width); - ntassert(console.cursor.Y >= 0 && console.cursor.Y < console.height); + nhassert(console.cursor.X >= 0 && console.cursor.X < console.width); + nhassert(console.cursor.Y >= 0 && console.cursor.Y < console.height); } /* @@ -982,7 +982,7 @@ register char *op; void unload_keyboard_handler() { - ntassert(keyboard_handler.hLibrary != NULL); + nhassert(keyboard_handler.hLibrary != NULL); FreeLibrary(keyboard_handler.hLibrary); memset(&keyboard_handler, 0, sizeof(keyboard_handler_t)); @@ -1619,10 +1619,10 @@ set_known_good_console_font() L"Consolas"); success = SetConsoleOutputCP(437); - ntassert(success); + nhassert(success); success = SetCurrentConsoleFontEx(console.hConOut, FALSE, &console_font_info); - ntassert(success); + nhassert(success); } /* restore_original_console_font will restore the console font and code page @@ -1665,7 +1665,7 @@ void set_cp_map() char c = (char)i; int count = MultiByteToWideChar(codePage, 0, &c, 1, &console.cpMap[i], 1); - ntassert(count == 1); + nhassert(count == 1); } } @@ -1685,8 +1685,8 @@ void early_raw_print(const char *s) if (console.hConOut == NULL) return; - ntassert(console.cursor.X >= 0 && console.cursor.X < console.width); - ntassert(console.cursor.Y >= 0 && console.cursor.Y < console.height); + nhassert(console.cursor.X >= 0 && console.cursor.X < console.width); + nhassert(console.cursor.Y >= 0 && console.cursor.Y < console.height); WORD attribute = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE; DWORD unused; @@ -1725,8 +1725,8 @@ void early_raw_print(const char *s) s++; } - ntassert(console.cursor.X >= 0 && console.cursor.X < console.width); - ntassert(console.cursor.Y >= 0 && console.cursor.Y < console.height); + nhassert(console.cursor.X >= 0 && console.cursor.X < console.width); + nhassert(console.cursor.Y >= 0 && console.cursor.Y < console.height); SetConsoleCursorPosition(console.hConOut, console.cursor); @@ -1762,7 +1762,7 @@ void nethack_enter_nttty() windowprocs.win_raw_print = early_raw_print; console.hConOut = GetStdHandle(STD_OUTPUT_HANDLE); - ntassert(console.hConOut != NULL); // NOTE: this assert will not print + nhassert(console.hConOut != NULL); // NOTE: this assert will not print GetConsoleScreenBufferInfo(console.hConOut, &console.origcsbi); @@ -1803,7 +1803,7 @@ void nethack_enter_nttty() /* At this point early_raw_print will work */ console.hConIn = GetStdHandle(STD_INPUT_HANDLE); - ntassert(console.hConIn != NULL); + nhassert(console.hConIn != NULL); /* grow the size of the console buffer if it is not wide enough */ if (console.origcsbi.dwSize.X < console.width) { diff --git a/sys/winnt/win10.c b/sys/winnt/win10.c index 7eea016e9..bf2ed9d39 100644 --- a/sys/winnt/win10.c +++ b/sys/winnt/win10.c @@ -2,12 +2,12 @@ /* Copyright (C) 2018 by Bart House */ /* NetHack may be freely redistributed. See license for details. */ -#include -#include "winMS.h" -#include "hack.h" #include "win10.h" +#include #include +#include "hack.h" + Win10 gWin10 = { 0 }; void win10_init() @@ -27,6 +27,10 @@ void win10_init() if (gWin10.AreDpiAwarenessContextsEqual == NULL) panic("Unable to get address of AreDpiAwarenessContextsEqual"); + gWin10.GetDpiForWindow = (GetDpiForWindowProc) GetProcAddress(hUser32, "GetDpiForWindow"); + if (gWin10.GetDpiForWindow == NULL) + panic("Unable to get address of GetDpiForWindow"); + FreeLibrary(hUser32); gWin10.Valid = TRUE; @@ -35,7 +39,7 @@ void win10_init() if (gWin10.Valid) { if (!gWin10.AreDpiAwarenessContextsEqual( gWin10.GetThreadDpiAwarenessContext(), - DPI_AWARENESS_CONTEXT_UNAWARE)) + DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2)) panic("Unexpected DpiAwareness state"); } diff --git a/sys/winnt/win10.h b/sys/winnt/win10.h index 22065df9f..02b943b56 100644 --- a/sys/winnt/win10.h +++ b/sys/winnt/win10.h @@ -2,16 +2,25 @@ /* Copyright (C) 2018 by Bart House */ /* NetHack may be freely redistributed. See license for details. */ -typedef DPI_AWARENESS_CONTEXT(WINAPI * GetThreadDpiAwarenessContextProc)(VOID); -typedef BOOL (WINAPI *AreDpiAwarenessContextsEqualProc)(DPI_AWARENESS_CONTEXT dpiContextA, DPI_AWARENESS_CONTEXT dpiContextB); +#ifndef WIN10_H +#define WIN10_H + +#include "win32api.h" + +typedef DPI_AWARENESS_CONTEXT(WINAPI *GetThreadDpiAwarenessContextProc)(VOID); +typedef BOOL(WINAPI *AreDpiAwarenessContextsEqualProc)( + DPI_AWARENESS_CONTEXT dpiContextA, DPI_AWARENESS_CONTEXT dpiContextB); +typedef UINT(WINAPI *GetDpiForWindowProc)(HWND hwnd); typedef struct { BOOL Valid; GetThreadDpiAwarenessContextProc GetThreadDpiAwarenessContext; AreDpiAwarenessContextsEqualProc AreDpiAwarenessContextsEqual; + GetDpiForWindowProc GetDpiForWindow; } Win10; extern Win10 gWin10; void win10_init(); +#endif // WIN10_H \ No newline at end of file diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index 93f372d62..e3aaf640e 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -468,8 +468,8 @@ char *buf; } #endif /* RUNTIME_PORT_ID */ -/* ntassert_failed is called when an ntassert's condition is false */ -void ntassert_failed(const char * exp, const char * file, int line) +/* nhassert_failed is called when an nhassert's condition is false */ +void nhassert_failed(const char * exp, const char * file, int line) { char message[128]; _snprintf(message, sizeof(message), diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index de95d687d..e186ca13a 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -3,12 +3,14 @@ /* NetHack may be freely redistributed. See license for details. */ #include "winos.h" +#include "winMS.h" +#include "win10.h" + #include "mhmap.h" #include "mhfont.h" #include "mhinput.h" #include "mhmsg.h" #include "resource.h" -#include "winMS.h" #include "color.h" #include "patchlevel.h" @@ -34,12 +36,18 @@ typedef struct mswin_nethack_map_window { boolean bFitToScreenMode; /* switch Fit map to screen mode on/off */ int xPos, yPos; /* scroll position */ int xPageSize, yPageSize; /* scroll page size */ + int xMin, xMax, yMin, yMax; /* scroll range */ int xCur, yCur; /* position of the cursor */ - int xScrTile, yScrTile; /* size of display tile */ + int xScrTile, yScrTile; /* size of tile on screen in pixels */ POINT map_orig; /* map origin point */ - HFONT hMapFont; /* font for ASCII mode */ - boolean bUnicodeFont; /* font supports unicode page 437 */ + HFONT hMapFont; /* font for ASCII mode */ + boolean bUnicodeFont; /* font supports unicode page 437 */ + + int tileWidth; /* width of tile in pixels at 96 dpi */ + int tileHeight; /* height of tile in pixels at 96 dpi */ + double scale; /* scale factor */ + } NHMapWindow, *PNHMapWindow; static TCHAR szNHMapWindowClass[] = TEXT("MSNethackMapWndClass"); @@ -101,29 +109,57 @@ mswin_init_map_window() } void -mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw) +mswin_map_stretch(HWND hWnd, LPSIZE map_size, BOOL redraw) { - PNHMapWindow data; - RECT client_rt; - SCROLLINFO si; - SIZE wnd_size; - LOGFONT lgfnt; - /* check arguments */ - if (!IsWindow(hWnd) || !lpsz || lpsz->cx <= 0 || lpsz->cy <= 0) + if (!IsWindow(hWnd) || !map_size || map_size->cx <= 0 + || map_size->cy <= 0) return; + PNHMapWindow data = (PNHMapWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA); + /* calculate window size */ + RECT client_rt; GetClientRect(hWnd, &client_rt); + + SIZE wnd_size; wnd_size.cx = client_rt.right - client_rt.left; wnd_size.cy = client_rt.bottom - client_rt.top; + if (wnd_size.cx > 0 && wnd_size.cy > 0 && data->bFitToScreenMode) { + double windowAspectRatio = + (double) wnd_size.cx / (double) wnd_size.cy; + UINT mapWidth = COLNO * data->tileWidth; + UINT mapHeight = ROWNO * data->tileHeight; + + double mapAspectRatio = (double) mapWidth / (double) mapHeight; + + if (windowAspectRatio > mapAspectRatio) + data->scale = (double) wnd_size.cy / (double) mapHeight; + else + data->scale = (double) wnd_size.cx / (double) mapWidth; + + } else { + // Auto size window + + UINT windowDpi = 96; + + if (gWin10.Valid) { + windowDpi = gWin10.GetDpiForWindow(hWnd); + if (windowDpi == 0) + windowDpi = 96; + } + + windowDpi = max(96, windowDpi); + data->scale = (double) windowDpi / 96.0; + } + /* set new screen tile size */ - data = (PNHMapWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA); - data->xScrTile = - max(1, (data->bFitToScreenMode ? wnd_size.cx : lpsz->cx) / COLNO); - data->yScrTile = - max(1, (data->bFitToScreenMode ? wnd_size.cy : lpsz->cy) / ROWNO); + data->xScrTile = (int) (data->tileWidth * data->scale); + data->yScrTile = (int) (data->tileHeight * data->scale); + + data->xScrTile = max(1, data->xScrTile); + data->yScrTile = max(1, data->yScrTile); /* set map origin point */ data->map_orig.x = @@ -134,55 +170,48 @@ mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw) data->map_orig.x -= data->map_orig.x % data->xScrTile; data->map_orig.y -= data->map_orig.y % data->yScrTile; - /* adjust horizontal scroll bar */ - if (data->bFitToScreenMode) - data->xPageSize = COLNO + 1; /* disable scroll bar */ - else - data->xPageSize = wnd_size.cx / data->xScrTile; + // Set horizontal scroll - if (data->xPageSize >= COLNO) { - data->xPos = 0; - GetNHApp()->bNoHScroll = TRUE; - } else { - GetNHApp()->bNoHScroll = FALSE; - data->xPos = max( - 0, min(COLNO - data->xPageSize + 1, u.ux - data->xPageSize / 2)); - } + data->xPageSize = min(COLNO, wnd_size.cx / data->xScrTile); + + GetNHApp()->bNoHScroll = (data->xPageSize == COLNO); + + data->xMin = 0; + data->xMax = COLNO - data->xPageSize; + data->xPos = max(0, min(data->xMax, u.ux - (data->xPageSize / 2))); + + SCROLLINFO si; si.cbSize = sizeof(si); si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; - si.nMin = 0; - si.nMax = COLNO; - si.nPage = data->xPageSize; + si.nMin = data->xMin; + si.nMax = data->xMax; + si.nPage = 1; si.nPos = data->xPos; SetScrollInfo(hWnd, SB_HORZ, &si, TRUE); - /* adjust vertical scroll bar */ - if (data->bFitToScreenMode) - data->yPageSize = ROWNO + 1; /* disable scroll bar */ - else - data->yPageSize = wnd_size.cy / data->yScrTile; + data->yPageSize = min(ROWNO, wnd_size.cy / data->yScrTile); - if (data->yPageSize >= ROWNO) { - data->yPos = 0; - GetNHApp()->bNoVScroll = TRUE; - } else { - GetNHApp()->bNoVScroll = FALSE; - data->yPos = max( - 0, min(ROWNO - data->yPageSize + 1, u.uy - data->yPageSize / 2)); - } + GetNHApp()->bNoVScroll = (data->yPageSize == ROWNO); + + data->yMin = 0; + data->yMax = ROWNO - data->yPageSize; + data->yPos = max(0, min(data->yMax, u.uy - (data->yPageSize / 2))); si.cbSize = sizeof(si); si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; - si.nMin = 0; - si.nMax = ROWNO; - si.nPage = data->yPageSize; + si.nMin = data->yMin; + si.nMax = data->yMax; + si.nPage = 1; si.nPos = data->yPos; SetScrollInfo(hWnd, SB_VERT, &si, TRUE); /* create font */ if (data->hMapFont) DeleteObject(data->hMapFont); + + LOGFONT lgfnt; + ZeroMemory(&lgfnt, sizeof(lgfnt)); lgfnt.lfHeight = -data->yScrTile; // height of font lgfnt.lfWidth = -data->xScrTile; // average character width @@ -231,95 +260,92 @@ mswin_map_mode(HWND hWnd, int mode) case MAP_MODE_ASCII4x6: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 4 * COLNO; - mapSize.cy = 6 * ROWNO; + data->tileWidth = 4; + data->tileHeight = 6; break; case MAP_MODE_ASCII6x8: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 6 * COLNO; - mapSize.cy = 8 * ROWNO; + data->tileWidth = 6; + data->tileHeight = 8; break; case MAP_MODE_ASCII8x8: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 8 * COLNO; - mapSize.cy = 8 * ROWNO; + data->tileWidth = 8; + data->tileHeight = 8; break; case MAP_MODE_ASCII16x8: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 16 * COLNO; - mapSize.cy = 8 * ROWNO; + data->tileWidth = 16; + data->tileHeight = 8; break; case MAP_MODE_ASCII7x12: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 7 * COLNO; - mapSize.cy = 12 * ROWNO; + data->tileWidth = 7; + data->tileHeight = 12; break; case MAP_MODE_ASCII8x12: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 8 * COLNO; - mapSize.cy = 12 * ROWNO; + data->tileWidth = 8; + data->tileHeight = 12; break; case MAP_MODE_ASCII16x12: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 16 * COLNO; - mapSize.cy = 12 * ROWNO; + data->tileWidth = 16; + data->tileHeight = 12; break; case MAP_MODE_ASCII12x16: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 12 * COLNO; - mapSize.cy = 16 * ROWNO; + data->tileWidth = 12; + data->tileHeight = 16; break; case MAP_MODE_ASCII10x18: data->bAsciiMode = TRUE; data->bFitToScreenMode = FALSE; - mapSize.cx = 10 * COLNO; - mapSize.cy = 18 * ROWNO; + data->tileWidth = 10; + data->tileHeight = 18; break; - case MAP_MODE_ASCII_FIT_TO_SCREEN: { - RECT client_rt; - GetClientRect(hWnd, &client_rt); - mapSize.cx = client_rt.right - client_rt.left; - mapSize.cy = client_rt.bottom - client_rt.top; - + case MAP_MODE_ASCII_FIT_TO_SCREEN: data->bAsciiMode = TRUE; data->bFitToScreenMode = TRUE; - } break; - - case MAP_MODE_TILES_FIT_TO_SCREEN: { - RECT client_rt; - GetClientRect(hWnd, &client_rt); - mapSize.cx = client_rt.right - client_rt.left; - mapSize.cy = client_rt.bottom - client_rt.top; + data->tileWidth = 12; + data->tileHeight = 16; + break; + case MAP_MODE_TILES_FIT_TO_SCREEN: data->bAsciiMode = FALSE; data->bFitToScreenMode = TRUE; - } break; + data->tileWidth = GetNHApp()->mapTile_X; + data->tileHeight = GetNHApp()->mapTile_Y; + break; case MAP_MODE_TILES: default: data->bAsciiMode = FALSE; data->bFitToScreenMode = FALSE; - mapSize.cx = GetNHApp()->mapTile_X * COLNO; - mapSize.cy = GetNHApp()->mapTile_Y * ROWNO; + data->tileWidth = GetNHApp()->mapTile_X; + data->tileHeight = GetNHApp()->mapTile_Y; break; } + mapSize.cx = data->tileWidth * COLNO; + mapSize.cy = data->tileHeight * ROWNO; + mswin_map_stretch(hWnd, &mapSize, TRUE); mswin_update_inventory(); /* for perm_invent to hide/show tiles */ @@ -618,6 +644,8 @@ onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam) data->xScrTile = GetNHApp()->mapTile_X; data->yScrTile = GetNHApp()->mapTile_Y; + data->tileWidth = GetNHApp()->mapTile_X; + data->tileHeight = GetNHApp()->mapTile_Y; SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) data); } @@ -712,10 +740,10 @@ onPaint(HWND hWnd) if (data->bUnicodeFont) { wch = winos_ascii_to_wide(ch); DrawTextW(hDC, &wch, 1, &glyph_rect, - DT_CENTER | DT_VCENTER | DT_NOPREFIX); + DT_CENTER | DT_VCENTER | DT_NOPREFIX); } else { DrawTextA(hDC, &ch, 1, &glyph_rect, - DT_CENTER | DT_VCENTER | DT_NOPREFIX); + DT_CENTER | DT_VCENTER | DT_NOPREFIX); } SetTextColor(hDC, OldFg); @@ -887,7 +915,7 @@ onMSNH_VScroll(HWND hWnd, WPARAM wParam, LPARAM lParam) yNewPos = data->yPos; } - yNewPos = max(0, min(ROWNO - data->yPageSize + 1, yNewPos)); + yNewPos = max(0, min(data->yMax, yNewPos)); if (yNewPos == data->yPos) return; @@ -948,7 +976,7 @@ onMSNH_HScroll(HWND hWnd, WPARAM wParam, LPARAM lParam) xNewPos = data->xPos; } - xNewPos = max(0, min(COLNO - data->xPageSize + 1, xNewPos)); + xNewPos = max(0, min(data->xMax, xNewPos)); if (xNewPos == data->xPos) return; diff --git a/win/win32/vs2017/.gitignore b/win/win32/vs2017/.gitignore index 6d1d5c867..f87237325 100644 --- a/win/win32/vs2017/.gitignore +++ b/win/win32/vs2017/.gitignore @@ -1,4 +1,4 @@ !NetHack.sln *.db-shm *.db-wal - +paniclog diff --git a/win/win32/vs2017/NetHackW.exe.manifest b/win/win32/vs2017/NetHackW.exe.manifest index 3a236519c..51db0685b 100644 --- a/win/win32/vs2017/NetHackW.exe.manifest +++ b/win/win32/vs2017/NetHackW.exe.manifest @@ -2,9 +2,7 @@ - unaware - - + PerMonitorV2 diff --git a/win/win32/winhack.c b/win/win32/winhack.c index 1657b0220..9dcbb4e4b 100644 --- a/win/win32/winhack.c +++ b/win/win32/winhack.c @@ -5,14 +5,15 @@ // winhack.cpp : Defines the entry point for the application. // +#include "win10.h" #include + #include "winMS.h" #include "hack.h" #include "dlb.h" #include "resource.h" #include "mhmain.h" #include "mhmap.h" -#include "win10.h" /* Borland and MinGW redefine "boolean" in shlwapi.h, so just use the little bit we need */ From 0bbc7cb6db6fa9cc2b870a19a12d61d02e29dcf5 Mon Sep 17 00:00:00 2001 From: Bart House Date: Mon, 12 Nov 2018 19:36:08 -0800 Subject: [PATCH 4/5] Adjust tile size to bounds of text meterics when in ascii mode. --- win/win32/mhmap.c | 127 +++++++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 46 deletions(-) diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index e186ca13a..ce9330e8e 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -2,13 +2,13 @@ /* Copyright (C) 2001 by Alex Kompel */ /* NetHack may be freely redistributed. See license for details. */ -#include "winos.h" -#include "winMS.h" #include "win10.h" +#include "winMS.h" +#include "winos.h" -#include "mhmap.h" #include "mhfont.h" #include "mhinput.h" +#include "mhmap.h" #include "mhmsg.h" #include "resource.h" @@ -31,22 +31,22 @@ typedef struct mswin_nethack_map_window { int map[COLNO][ROWNO]; /* glyph map */ int bkmap[COLNO][ROWNO]; /* backround glyph map */ - int mapMode; /* current map mode */ - boolean bAsciiMode; /* switch ASCII/tiled mode */ - boolean bFitToScreenMode; /* switch Fit map to screen mode on/off */ - int xPos, yPos; /* scroll position */ - int xPageSize, yPageSize; /* scroll page size */ + int mapMode; /* current map mode */ + boolean bAsciiMode; /* switch ASCII/tiled mode */ + boolean bFitToScreenMode; /* switch Fit map to screen mode on/off */ + int xPos, yPos; /* scroll position */ + int xPageSize, yPageSize; /* scroll page size */ int xMin, xMax, yMin, yMax; /* scroll range */ - int xCur, yCur; /* position of the cursor */ - int xScrTile, yScrTile; /* size of tile on screen in pixels */ - POINT map_orig; /* map origin point */ + int xCur, yCur; /* position of the cursor */ + int xScrTile, yScrTile; /* size of tile on screen in pixels */ + POINT map_orig; /* map origin point */ HFONT hMapFont; /* font for ASCII mode */ boolean bUnicodeFont; /* font supports unicode page 437 */ - int tileWidth; /* width of tile in pixels at 96 dpi */ - int tileHeight; /* height of tile in pixels at 96 dpi */ - double scale; /* scale factor */ + int tileWidth; /* width of tile in pixels at 96 dpi */ + int tileHeight; /* height of tile in pixels at 96 dpi */ + double scale; /* scale factor */ } NHMapWindow, *PNHMapWindow; @@ -161,6 +161,68 @@ mswin_map_stretch(HWND hWnd, LPSIZE map_size, BOOL redraw) data->xScrTile = max(1, data->xScrTile); data->yScrTile = max(1, data->yScrTile); + /* create font */ + if (data->hMapFont) + DeleteObject(data->hMapFont); + + LOGFONT lgfnt; + + ZeroMemory(&lgfnt, sizeof(lgfnt)); + lgfnt.lfHeight = -data->yScrTile; // height of font + lgfnt.lfWidth = -data->xScrTile; // average character width + lgfnt.lfEscapement = 0; // angle of escapement + lgfnt.lfOrientation = 0; // base-line orientation angle + lgfnt.lfWeight = FW_NORMAL; // font weight + lgfnt.lfItalic = FALSE; // italic attribute option + lgfnt.lfUnderline = FALSE; // underline attribute option + lgfnt.lfStrikeOut = FALSE; // strikeout attribute option + lgfnt.lfCharSet = mswin_charset(); // character set identifier + lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision + lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision + lgfnt.lfQuality = NONANTIALIASED_QUALITY; // output quality + if (iflags.wc_font_map && *iflags.wc_font_map) { + lgfnt.lfPitchAndFamily = DEFAULT_PITCH; // pitch and family + NH_A2W(iflags.wc_font_map, lgfnt.lfFaceName, LF_FACESIZE); + } else { + lgfnt.lfPitchAndFamily = FIXED_PITCH; // pitch and family + NH_A2W(NHMAP_FONT_NAME, lgfnt.lfFaceName, LF_FACESIZE); + } + + TEXTMETRIC textMetrics; + + while (1) { + data->hMapFont = CreateFontIndirect(&lgfnt); + + HDC hdc = GetDC(NULL); + HFONT savedFont = SelectObject(hdc, data->hMapFont); + + GetTextMetrics(hdc, &textMetrics); + + SelectObject(hdc, savedFont); + ReleaseDC(NULL, hdc); + + if (textMetrics.tmHeight > data->yScrTile) { + lgfnt.lfHeight++; + continue; + } + + if (textMetrics.tmAveCharWidth > data->xScrTile) { + lgfnt.lfWidth++; + continue; + } + + break; + } + + data->bUnicodeFont = winos_font_support_cp437(data->hMapFont); + + // set tile size to match font metrics + + if (data->bAsciiMode) { + data->xScrTile = textMetrics.tmAveCharWidth; + data->yScrTile = textMetrics.tmHeight; + } + /* set map origin point */ data->map_orig.x = max(0, client_rt.left + (wnd_size.cx - data->xScrTile * COLNO) / 2); @@ -206,35 +268,6 @@ mswin_map_stretch(HWND hWnd, LPSIZE map_size, BOOL redraw) si.nPos = data->yPos; SetScrollInfo(hWnd, SB_VERT, &si, TRUE); - /* create font */ - if (data->hMapFont) - DeleteObject(data->hMapFont); - - LOGFONT lgfnt; - - ZeroMemory(&lgfnt, sizeof(lgfnt)); - lgfnt.lfHeight = -data->yScrTile; // height of font - lgfnt.lfWidth = -data->xScrTile; // average character width - lgfnt.lfEscapement = 0; // angle of escapement - lgfnt.lfOrientation = 0; // base-line orientation angle - lgfnt.lfWeight = FW_NORMAL; // font weight - lgfnt.lfItalic = FALSE; // italic attribute option - lgfnt.lfUnderline = FALSE; // underline attribute option - lgfnt.lfStrikeOut = FALSE; // strikeout attribute option - lgfnt.lfCharSet = mswin_charset(); // character set identifier - lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision - lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision - lgfnt.lfQuality = DEFAULT_QUALITY; // output quality - if (iflags.wc_font_map && *iflags.wc_font_map) { - lgfnt.lfPitchAndFamily = DEFAULT_PITCH; // pitch and family - NH_A2W(iflags.wc_font_map, lgfnt.lfFaceName, LF_FACESIZE); - } else { - lgfnt.lfPitchAndFamily = FIXED_PITCH; // pitch and family - NH_A2W(NHMAP_FONT_NAME, lgfnt.lfFaceName, LF_FACESIZE); - } - data->hMapFont = CreateFontIndirect(&lgfnt); - data->bUnicodeFont = winos_font_support_cp437(data->hMapFont); - mswin_cliparound(data->xCur, data->yCur); if (redraw) @@ -320,7 +353,7 @@ mswin_map_mode(HWND hWnd, int mode) data->tileHeight = 18; break; - case MAP_MODE_ASCII_FIT_TO_SCREEN: + case MAP_MODE_ASCII_FIT_TO_SCREEN: data->bAsciiMode = TRUE; data->bFitToScreenMode = TRUE; data->tileWidth = 12; @@ -740,10 +773,12 @@ onPaint(HWND hWnd) if (data->bUnicodeFont) { wch = winos_ascii_to_wide(ch); DrawTextW(hDC, &wch, 1, &glyph_rect, - DT_CENTER | DT_VCENTER | DT_NOPREFIX); + DT_CENTER | DT_VCENTER | DT_NOPREFIX + | DT_SINGLELINE); } else { DrawTextA(hDC, &ch, 1, &glyph_rect, - DT_CENTER | DT_VCENTER | DT_NOPREFIX); + DT_CENTER | DT_VCENTER | DT_NOPREFIX + | DT_SINGLELINE); } SetTextColor(hDC, OldFg); From d89deb5bf7a08953616189bd8a56f916261054d9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 12 Nov 2018 23:10:42 -0500 Subject: [PATCH 5/5] Makefile update to reference recently added file --- sys/winnt/Makefile.msc | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index ca781610b..2967c2cd0 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -300,7 +300,7 @@ conlibs = $(baselibs) guilibs = $(winlibs) # -INCLDIR= /I..\include +INCLDIR= /I..\include /I..\sys\winnt #========================================== # Util builds @@ -397,7 +397,8 @@ VOBJ23 = $(O)sys.o $(O)teleport.o $(O)timeout.o $(O)topten.o VOBJ24 = $(O)track.o $(O)trap.o $(O)u_init.o $(O)uhitm.o VOBJ25 = $(O)vault.o $(O)vis_tab.o $(O)vision.o $(O)weapon.o VOBJ26 = $(O)were.o $(O)wield.o $(O)windows.o $(O)wizard.o -VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o +VOBJ27 = $(O)worm.o $(O)worn.o $(O)write.o $(O)zap.o +VOBJ28 = $(O)win10.o DLBOBJ = $(O)dlb.o @@ -996,14 +997,6 @@ $(O)envchk.tag: $(O)obj.tag #=========== SECONDARY TARGETS ============ #========================================== -#=========================================== -# Header files NOT distributed in $(INCL) -#=========================================== - -$(INCL)\win32api.h: $(MSWSYS)\win32api.h - copy $(MSWSYS)\win32api.h $@ - - #========================================== # DLB utility and nhdat file creation #========================================== @@ -1064,7 +1057,7 @@ $(U)recover.exe: $(RECOVOBJS) @echo Linking $(@:\=/) $(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(RECOVOBJS) -$(O)recover.o: $(CONFIG_H) $(U)recover.c $(INCL)\win32api.h +$(O)recover.o: $(CONFIG_H) $(U)recover.c $(MSWSYS)\win32api.h @$(cc) $(cflagsBuild) -Fo$@ $(U)recover.c #========================================== @@ -1158,10 +1151,10 @@ $(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32) ) << -$(O)tile2bmp.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h +$(O)tile2bmp.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h @$(cc) $(cflagsBuild) -I$(WSHR) /DPACKED_FILE /Fo$@ $(WSHR)\tile2bmp.c -$(O)til2bm32.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h +$(O)til2bm32.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h @$(cc) $(cflagsBuild) -I$(WSHR) /DPACKED_FILE /DTILE_X=32 /DTILE_Y=32 /Fo$@ $(WSHR)\tile2bmp.c #========================================== @@ -1234,7 +1227,6 @@ spotless: clean if exist $(O)gamedir.tag del $(O)gamedir.tag if exist $(O)nh*key.lib del $(O)nh*key.lib if exist $(O)nh*key.exp del $(O)nh*key.exp - if exist $(INCL)\win32api.h del $(INCL)\win32api.h if exist $(MSWIN)\mnsel.bmp del $(MSWIN)\mnsel.bmp if exist $(MSWIN)\mnselcnt.bmp del $(MSWIN)\mnselcnt.bmp if exist $(MSWIN)\mnunsel.bmp del $(MSWIN)\mnunsel.bmp @@ -1339,9 +1331,9 @@ $(DAT)\dungeon: $(O)utility.tag $(DAT)\dungeon.def # NT dependencies # -$(O)nttty.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(MSWSYS)\nttty.c +$(O)nttty.o: $(HACK_H) $(TILE_H) $(MSWSYS)\win32api.h $(MSWSYS)\nttty.c @$(cc) $(cflagsBuild) -I$(WSHR) -Fo$@ $(MSWSYS)\nttty.c -$(O)winnt.o: $(HACK_H) $(INCL)\win32api.h $(MSWSYS)\winnt.c +$(O)winnt.o: $(HACK_H) $(MSWSYS)\win32api.h $(MSWSYS)\winnt.c @$(cc) $(cflagsBuild) -Fo$@ $(MSWSYS)\winnt.c $(O)ntsound.o: $(HACK_H) $(MSWSYS)\ntsound.c @$(cc) $(cflagsBuild) -Fo$@ $(MSWSYS)\ntsound.c @@ -1390,7 +1382,7 @@ $(O)panic.o: $(U)panic.c $(CONFIG_H) $(O)tos.o: ..\sys\atari\tos.c $(HACK_H) $(INCL)\tcap.h @$(CC) $(cflagsBuild) -Fo$@ ..\sys\atari\tos.c $(O)pcmain.o: ..\sys\share\pcmain.c $(HACK_H) $(INCL)\dlb.h \ - $(INCL)\win32api.h + $(MSWSYS)\win32api.h @$(CC) $(cflagsBuild) -Fo$@ ..\sys\share\pcmain.c $(O)pcsys.o: ..\sys\share\pcsys.c $(HACK_H) @$(CC) $(cflagsBuild) -Fo$@ ..\sys\share\pcsys.c