some mingw bits to move its gui variation closer to building and running
This commit is contained in:
@@ -138,6 +138,10 @@ TARGET_CPU=x86
|
|||||||
#
|
#
|
||||||
ADD_LUA=Y
|
ADD_LUA=Y
|
||||||
LUATOP=../lib/lua-5.3.5
|
LUATOP=../lib/lua-5.3.5
|
||||||
|
ifndef LUA_VERSION
|
||||||
|
LUA_VERSION=5.3.5
|
||||||
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
# This marks the end of the BUILD DECISIONS section.
|
# This marks the end of the BUILD DECISIONS section.
|
||||||
@@ -549,7 +553,7 @@ CFLAGSBASE = -c $(cflags) $(WINPINC) $(cdebug) $(CURSESDEF)
|
|||||||
#LFLAGSBASEG = $(linkdebug) -mwindows
|
#LFLAGSBASEG = $(linkdebug) -mwindows
|
||||||
baselibs = -lwinmm -lshell32 -lole32 -luuid
|
baselibs = -lwinmm -lshell32 -lole32 -luuid
|
||||||
conlibs = -lgdi32 $(baselibs) $(BCRYPT)
|
conlibs = -lgdi32 $(baselibs) $(BCRYPT)
|
||||||
guilibs = -lcomctl32 $(baselibs)
|
guilibs = -lcomctl32 $(baselibs) $(BCRYPT)
|
||||||
ifeq "$(WANT_WIN_QT4)" "Y"
|
ifeq "$(WANT_WIN_QT4)" "Y"
|
||||||
# Might be either Qt 4 or Qt 5
|
# Might be either Qt 4 or Qt 5
|
||||||
ifeq "$(HAVE_QT5)" "Y"
|
ifeq "$(HAVE_QT5)" "Y"
|
||||||
@@ -715,7 +719,7 @@ $(QT4)/%.moc : $(QT4)/%.h
|
|||||||
ifeq "$(SKIP_NETHACKW)" "Y"
|
ifeq "$(SKIP_NETHACKW)" "Y"
|
||||||
NETHACKW_EXE =
|
NETHACKW_EXE =
|
||||||
else
|
else
|
||||||
NETHACKW_EXE = $(GAMEDIR)/NetHack.exe
|
NETHACKW_EXE = $(GAMEDIR)/NetHackW.exe
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SHELL=CMD.EXE
|
SHELL=CMD.EXE
|
||||||
@@ -1257,8 +1261,8 @@ endif
|
|||||||
clean:
|
clean:
|
||||||
if exist initialchk del initialchk
|
if exist initialchk del initialchk
|
||||||
if exist $(W_INCL)\nhlua.h del $(W_INCL)\nhlua.h
|
if exist $(W_INCL)\nhlua.h del $(W_INCL)\nhlua.h
|
||||||
if exist $(O)install.tag del $(O)install.tag
|
if exist $(W_OBJ)\install.tag del $(W_OBJ)\install.tag
|
||||||
if exist $(O)utility.tag del $(O)utility.tag
|
if exist $(W_UTIL)utility.tag del $(W_UTIL)\utility.tag
|
||||||
ifneq "$(W_UTIL)" ""
|
ifneq "$(W_UTIL)" ""
|
||||||
if exist $(W_UTIL)\makedefs.exe del $(W_UTIL)\makedefs.exe
|
if exist $(W_UTIL)\makedefs.exe del $(W_UTIL)\makedefs.exe
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
/* Copyright (C) 2018 by Bart House */
|
/* Copyright (C) 2018 by Bart House */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#include "win10.h"
|
#include "win10.h"
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <VersionHelpers.h>
|
#include <VersionHelpers.h>
|
||||||
@@ -119,6 +118,3 @@ win10_is_desktop_bridge_application()
|
|||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* _MSC_VER */
|
|
||||||
|
|||||||
@@ -7,6 +7,28 @@
|
|||||||
|
|
||||||
#include "win32api.h"
|
#include "win32api.h"
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#ifndef DECLARE_HANDLE
|
||||||
|
#define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name
|
||||||
|
#endif
|
||||||
|
DECLARE_HANDLE(DPI_AWARENESS_CONTEXT);
|
||||||
|
|
||||||
|
/* DPI awareness */
|
||||||
|
typedef enum DPI_AWARENESS
|
||||||
|
{
|
||||||
|
DPI_AWARENESS_INVALID = -1,
|
||||||
|
DPI_AWARENESS_UNAWARE = 0,
|
||||||
|
DPI_AWARENESS_SYSTEM_AWARE,
|
||||||
|
DPI_AWARENESS_PER_MONITOR_AWARE
|
||||||
|
} DPI_AWARENESS;
|
||||||
|
|
||||||
|
#define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1)
|
||||||
|
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
|
||||||
|
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
|
||||||
|
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
|
||||||
|
#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT)-5)
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
double scale; // dpi of monitor / 96
|
double scale; // dpi of monitor / 96
|
||||||
int width; // in pixels
|
int width; // in pixels
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
#ifndef WIN32API
|
#ifndef WIN32API
|
||||||
#define WIN32API
|
#define WIN32API
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
|
|
||||||
#if defined(HACK_H)
|
#if defined(HACK_H)
|
||||||
#error win32api.h must be included before hack.h
|
#error win32api.h must be included before hack.h
|
||||||
#endif
|
#endif
|
||||||
@@ -32,9 +30,10 @@
|
|||||||
#error win32api.h should be included first
|
#error win32api.h should be included first
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
#pragma warning(disable : 4142) /* Warning, Benign redefinition of type */
|
#pragma warning(disable : 4142) /* Warning, Benign redefinition of type */
|
||||||
#pragma pack(8)
|
#pragma pack(8)
|
||||||
#endif // _MSC_VER
|
#endif
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ enum player_selector_control {
|
|||||||
psc_control_count
|
psc_control_count
|
||||||
};
|
};
|
||||||
|
|
||||||
static const s_psc_id[psc_control_count] = {
|
static const int s_psc_id[psc_control_count] = {
|
||||||
IDC_PLSEL_NAME_GROUP,
|
IDC_PLSEL_NAME_GROUP,
|
||||||
IDC_PLSEL_ROLE_GROUP,
|
IDC_PLSEL_ROLE_GROUP,
|
||||||
IDC_PLSEL_RACE_GROUP,
|
IDC_PLSEL_RACE_GROUP,
|
||||||
|
|||||||
@@ -1333,12 +1333,18 @@ mswin_raw_print_flush()
|
|||||||
{
|
{
|
||||||
if (raw_print_strbuf.str != NULL) {
|
if (raw_print_strbuf.str != NULL) {
|
||||||
int wlen = strlen(raw_print_strbuf.str) + 1;
|
int wlen = strlen(raw_print_strbuf.str) + 1;
|
||||||
TCHAR * wbuf = (TCHAR *) alloc(wlen * sizeof(TCHAR));
|
if (strcmp(raw_print_strbuf.str, "\n") != 0
|
||||||
if (wbuf != NULL) {
|
#ifdef _MSC_VER
|
||||||
NHMessageBox(GetNHApp()->hMainWnd,
|
|| IsDebuggerPresent()
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
|
TCHAR * wbuf = (TCHAR *) alloc(wlen * sizeof(TCHAR));
|
||||||
|
if (wbuf != NULL) {
|
||||||
|
NHMessageBox(GetNHApp()->hMainWnd,
|
||||||
NH_A2W(raw_print_strbuf.str, wbuf, wlen),
|
NH_A2W(raw_print_strbuf.str, wbuf, wlen),
|
||||||
MB_ICONINFORMATION | MB_OK);
|
MB_ICONINFORMATION | MB_OK);
|
||||||
free(wbuf);
|
free(wbuf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
strbuf_empty(&raw_print_strbuf);
|
strbuf_empty(&raw_print_strbuf);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user