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.
This commit is contained in:
Bart House
2018-11-12 01:58:56 -08:00
parent e87496b897
commit 8944235282
17 changed files with 276 additions and 124 deletions

View File

@@ -7,22 +7,36 @@
* header files & NetHack before including windows.h, so all NetHack
* files should include "win32api.h" rather than <windows.h>.
*/
#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 <windows.h>
#include <commctrl.h>
@@ -31,4 +45,6 @@
#pragma pack()
#endif
#endif // WIN32API
/*win32api.h*/