Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-11-02 22:53:46 -04:00
15 changed files with 106 additions and 89 deletions

View File

@@ -1,4 +1,4 @@
# NetHack 3.6 Makefile.gcc $NHDT-Date: 1546174698 2018/12/30 12:58:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.71 $
# NetHack 3.6 Makefile.gcc $NHDT-Date: 1572748375 2019/11/03 02:32:55 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.80 $
# Copyright (c) 2010 by Michael Allison
# NetHack may be freely redistributed. See license for details.
#
@@ -764,11 +764,11 @@ else
$(subst /,\,copy $(DAT)/*.lev $(GAMEDIR))
$(subst /,\,if exist $(GAMEDIR)/makefile del $(GAMEDIR)/makefile)
endif
$(subst /,\,if not exist $(GAMEDIR)/sysconf copy $(MSWSYS)/sysconf $(GAMEDIR))
$(subst /,\,if exist $(DAT)/symbols copy $(DAT)/symbols $(GAMEDIR))
$(subst /,\,if exist $(MSWSYS)/sysconf.template copy $(MSWSYS)/sysconf.template $(GAMEDIR))
$(subst /,\,if exist $(DAT)/symbols copy $(DAT)/symbols $(GAMEDIR)/symbols.template)
$(subst /,\,if exist $(DOC)/guidebook.txt copy $(DOC)/guidebook.txt $(GAMEDIR)/Guidebook.txt)
$(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR)/NetHack.txt)
$(subst /,\,if not exist $(GAMEDIR)/defaults.nh copy $(MSWSYS)/defaults.nh $(GAMEDIR)/defaults.nh)
$(subst /,\,if exist $(MSWSYS)/.nethackrc.template copy $(MSWSYS)/.nethackrc.template $(GAMEDIR))
$(subst /,\,-if not exist $(GAMEDIR)/record. echo.>$(GAMEDIR)/record.)
#
#

View File

@@ -1,4 +1,4 @@
# NetHack 3.7 Makefile.msc $NHDT-Date: 1554784482 2019/04/09 04:34:42 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.153 $ */
# NetHack 3.6 Makefile.msc $NHDT-Date: 1572748386 2019/11/03 02:33:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.167 $ */
# Copyright (c) NetHack PC Development Team 1993-2019
#
#==============================================================================
@@ -702,13 +702,13 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \
copy $(DAT)\*.lev $(GAMEDIR)
if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile
! ENDIF
if not exist $(GAMEDIR)\sysconf copy $(MSWSYS)\sysconf $(GAMEDIR)
if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR)
if exist $(MSWSYS)\sysconf.template copy $(MSWSYS)\sysconf.template $(GAMEDIR)
if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR)\symbols.template
if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt
if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
@if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space
@if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space
-if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh
if exist $(MSWSYS)\.nethackrc.template copy $(MSWSYS)\.nethackrc.template $(GAMEDIR)
-if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record.
echo install done > $@

View File

@@ -9,6 +9,21 @@
#include "hack.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 LONG (WINAPI *GetCurrentPackageFullNameProc)(UINT32 *packageFullNameLength,
PWSTR packageFullName);
typedef struct {
BOOL Valid;
GetThreadDpiAwarenessContextProc GetThreadDpiAwarenessContext;
AreDpiAwarenessContextsEqualProc AreDpiAwarenessContextsEqual;
GetDpiForWindowProc GetDpiForWindow;
GetCurrentPackageFullNameProc GetCurrentPackageFullName;
} Win10;
Win10 gWin10 = { 0 };
void win10_init()
@@ -37,7 +52,7 @@ void win10_init()
HINSTANCE hKernel32 = LoadLibraryA("kernel32.dll");
if (hKernel32 == NULL)
panic("Unable to load user32.dll");
panic("Unable to load kernel32.dll");
gWin10.GetCurrentPackageFullName = (GetCurrentPackageFullNameProc) GetProcAddress(hKernel32, "GetCurrentPackageFullName");
if (gWin10.GetCurrentPackageFullName == NULL)

View File

@@ -7,21 +7,6 @@
#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 LONG (WINAPI *GetCurrentPackageFullNameProc)(UINT32 *packageFullNameLength,
PWSTR packageFullName);
typedef struct {
BOOL Valid;
GetThreadDpiAwarenessContextProc GetThreadDpiAwarenessContext;
AreDpiAwarenessContextsEqualProc AreDpiAwarenessContextsEqual;
GetDpiForWindowProc GetDpiForWindow;
GetCurrentPackageFullNameProc GetCurrentPackageFullName;
} Win10;
typedef struct {
double scale; // dpi of monitor / 96
int width; // in pixels
@@ -30,12 +15,9 @@ typedef struct {
int left; // in desktop coordinate pixel space
} MonitorInfo;
extern Win10 gWin10;
void win10_init();
int win10_monitor_dpi(HWND hWnd);
double win10_monitor_scale(HWND hWnd);
void win10_monitor_size(HWND hWnd, int * width, int * height);
void win10_monitor_info(HWND hWnd, MonitorInfo * monitorInfo);
BOOL win10_is_desktop_bridge_application(void);

View File

@@ -304,23 +304,23 @@ void copy_config_content()
/* Keep templates up to date */
/* TODO: Update the package to store config file as .nethackrc */
update_file(g.fqn_prefix[CONFIGPREFIX], CONFIG_TEMPLATE,
g.fqn_prefix[DATAPREFIX], CONFIG_FILE, FALSE);
g.fqn_prefix[DATAPREFIX], CONFIG_TEMPLATE, FALSE);
update_file(g.fqn_prefix[SYSCONFPREFIX], SYSCF_TEMPLATE,
g.fqn_prefix[DATAPREFIX], SYSCF_FILE, FALSE);
g.fqn_prefix[DATAPREFIX], SYSCF_TEMPLATE, FALSE);
/* If the required early game file does not exist, copy it */
/* NOTE: We never replace .nethackrc or sysconf */
copy_file(g.fqn_prefix[CONFIGPREFIX], CONFIG_FILE,
g.fqn_prefix[DATAPREFIX], CONFIG_FILE);
g.fqn_prefix[DATAPREFIX], CONFIG_TEMPLATE);
copy_file(g.fqn_prefix[SYSCONFPREFIX], SYSCF_FILE,
g.fqn_prefix[DATAPREFIX], SYSCF_FILE);
g.fqn_prefix[DATAPREFIX], SYSCF_TEMPLATE);
/* Update symbols and save a copy if we are replacing */
/* TODO: Can't HACKDIR be changed during option parsing
causing us to perhaps be checking options against the wrong
symbols file? */
update_file(g.fqn_prefix[HACKPREFIX], SYMBOLS,
g.fqn_prefix[DATAPREFIX], SYMBOLS, TRUE);
g.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE, TRUE);
}
void
@@ -334,7 +334,7 @@ copy_hack_content()
/* Keep templates up to date */
update_file(g.fqn_prefix[HACKPREFIX], SYMBOLS_TEMPLATE,
g.fqn_prefix[DATAPREFIX], SYMBOLS, FALSE);
g.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE, FALSE);
}