curses changes to existing files

This commit is contained in:
nhmall
2018-11-16 20:51:22 -05:00
parent 20018c2719
commit cb43061076
18 changed files with 345 additions and 42 deletions
+12 -4
View File
@@ -98,8 +98,12 @@ char *argv[];
nethack_enter(argc, argv);
sys_early_init();
#ifdef WIN32
#if defined(WIN32) && defined(TTY_GRAPHICS)
Strcpy(default_window_sys, "tty");
#else
#if defined(CURSES_GRAPHICS)
Strcpy(default_window_sys, "curses");
#endif
#endif
resuming = pcmain(argc, argv);
@@ -173,6 +177,10 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
choose_windows(DEFAULT_WINDOW_SYS);
#else
choose_windows(default_window_sys);
if (argc > 1
&& !strcmpi(default_window_sys, "mswin")
&& strstri(argv[0], "nethackw.exe"))
iflags.windowtype_locked = TRUE;
#endif
#if !defined(AMIGA) && !defined(GNUDOS)
@@ -500,9 +508,9 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
} else {
iflags.use_background_glyph = TRUE;
}
#endif
#endif
#endif
#endif /* TTY_GRAPHICS */
#endif /* WIN32 */
#endif /* MSDOS || WIN32 */
#if defined(MSDOS) || defined(WIN32)
init_nhwindows(&argc, argv);
+59 -4
View File
@@ -146,6 +146,15 @@ SYSOBJ = ioctl.o unixmain.o unixtty.o unixunix.o unixres.o
#LINK = gcc
#LFLAGS = -Xlinker -soname=_APP_
# Compile with PDCurses installed in a separate directory that doesn't
# conflict with the system curses/ncurses library
#CFLAGS = -O -I../include -I/usr/local/include/pdcurses
# Same as above, but for XCurses
#CFLAGS = -O -DXCURSES -I../include -I/usr/local/include/pdcurses
# Compile against system curses library, such as ncurses
#CFLAGS = -O -I../include
# Only used for the Gnome interface.
# When including the Gnome interface, you need to include gnome specific
# directories. The ones given below is the usual spot for linux systems.
@@ -190,6 +199,14 @@ WINTTYSRC = ../win/tty/getline.c ../win/tty/termcap.c ../win/tty/topl.c \
../win/tty/wintty.c
WINTTYOBJ = getline.o termcap.o topl.o wintty.o
#
# Files for curses interface
WINCURSESSRC = ../win/curses/cursmain.c ../win/curses/curswins.c \
../win/curses/cursmisc.c ../win/curses/cursdial.c \
../win/curses/cursstat.c ../win/curses/cursinit.c \
../win/curses/cursmesg.c ../win/curses/cursinvt.c
WINCURSESOBJ = cursmain.o curswins.o cursmisc.o cursdial.o cursstat.o \
cursinit.o cursmesg.o cursinvt.o
#
# files for an X11 port
# (tile.c is a generated source file)
WINX11SRC = ../win/X11/Window.c ../win/X11/dialogs.c ../win/X11/winX.c \
@@ -243,12 +260,15 @@ WINBEOBJ =
#WINBESRC = ../win/BeOS/winbe.cpp ../win/BeOS/NHWindow.cpp \
# ../win/BeOS/NHMenuWindow.cpp ../win/BeOS/NHMapWindow.cpp tile.c
#WINBEOBJ = winbe.o NHWindow.o NHMenuWindow.o NHMapWindow.o tile.o
#
#
#WINSRC = $(WINTTYSRC)
#WINOBJ = $(WINTTYOBJ)
#
# Curses - Karl Garrison, Tangles
#WINSRC = $(WINCURSESSRC)
#WINOBJ = $(WINCURSESOBJ)
#
# on some systems the termcap library is in -ltermcap or -lcurses
# on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
# Sysatt uses shared library in lieu of this option
@@ -272,6 +292,7 @@ WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
# WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
# WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0
#
#
# libraries for Qt 3
WINQTLIB = -L$(QTDIR)/lib -lqt
#
@@ -292,9 +313,20 @@ WINGEMLIB = -le_gem -lgem
#
# libraries for BeOS
WINBELIB = -lbe
#
# libraries for curses port
# link with ncurses
WINCURSESLIB = -lncurses
# link with pdcurses for SDL, installed in a separate directory
#WINCURSESLIB = -L/usr/local/lib/pdcurses -lpdcurses -lSDL
# same as above, for XCurses
#WINCURSESLIB = -L/usr/local/lib/pdcurses -lXCurses -lXawM -lXmu -lXext -lXt -lX11
#
#WINLIB = $(WINTTYLIB)
#
# For Curses
#WINLIB = $(WINCURSESLIB)
#
# any other strange libraries your system needs (for Sysunix only -- the more
# specialized targets should already be right)
#
@@ -743,6 +775,29 @@ topl.o: ../win/tty/topl.c $(HACK_H) ../include/tcap.h
$(CC) $(CFLAGS) -c ../win/tty/topl.c
wintty.o: ../win/tty/wintty.c $(HACK_H) ../include/dlb.h ../include/tcap.h
$(CC) $(CFLAGS) -c ../win/tty/wintty.c
cursmain.o: ../win/curses/cursmain.c $(HACK_H) ../include/wincurs.h
$(CC) $(CFLAGS) -c ../win/curses/cursmain.c
curswins.o: ../win/curses/curswins.c $(HACK_H) ../include/func_tab.h \
../include/wincurs.h ../win/curses/curswins.h
$(CC) $(CFLAGS) -c ../win/curses/curswins.c
cursmisc.o: ../win/curses/cursmisc.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursmisc.h
$(CC) $(CFLAGS) -c ../win/curses/cursmisc.c
cursdial.o: ../win/curses/cursdial.c $(HACK_H) ../include/func_tab.h \
../include/wincurs.h ../win/curses/cursdial.h
$(CC) $(CFLAGS) -c ../win/curses/cursdial.c
cursstat.o: ../win/curses/cursstat.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursstat.h
$(CC) $(CFLAGS) -c ../win/curses/cursstat.c
cursinit.o: ../win/curses/cursinit.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursinit.h
$(CC) $(CFLAGS) -c ../win/curses/cursinit.c
cursinvt.o: ../win/curses/cursinvt.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursinvt.h
$(CC) $(CFLAGS) -c ../win/curses/cursinvt.c
cursmesg.o: ../win/curses/cursmesg.c $(HACK_H) ../include/wincurs.h \
../win/curses/cursmesg.h
$(CC) $(CFLAGS) -c ../win/curses/cursmesg.c
Window.o: ../win/X11/Window.c ../include/xwindowp.h ../include/xwindow.h \
$(CONFIG_H) ../include/lint.h
$(CC) $(CFLAGS) -c ../win/X11/Window.c
+4 -3
View File
@@ -27,14 +27,15 @@ CFLAGS+=-DTIMED_DELAY
CFLAGS+=-DHACKDIR=\"$(HACKDIR)\"
CFLAGS+=-DDUMPLOG
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE
CFLAGS+=-DCURSES_GRAPHICS
LINK=$(CC)
# Only needed for GLIBC stack trace:
LFLAGS=-rdynamic
WINSRC = $(WINTTYSRC)
WINOBJ = $(WINTTYOBJ)
WINLIB = $(WINTTYLIB)
WINSRC = $(WINTTYSRC) $(WINCURSESSRC)
WINOBJ = $(WINTTYOBJ) $(WINCURSESOBJ)
WINLIB = $(WINTTYLIB) $(WINCURSESLIB)
WINTTYLIB=-lcurses
+9
View File
@@ -21,11 +21,13 @@
WANT_WIN_TTY=1
#WANT_WIN_X11=1
#WANT_WIN_QT=1
#WANT_WIN_CURSES=1
# 1a. What is the default window system?
WANT_DEFAULT=tty
#WANT_DEFAULT=x11
#WANT_DEFAULT=qt
#WANT_DEFAULT=curses
# 1b. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt2 or Qt3
@@ -96,6 +98,13 @@ else # !WANT_WIN_TTY
CFLAGS += -DNOTTYGRAPHICS
endif # !WANT_WIN_TTY
ifdef WANT_WIN_CURSES
CFLAGS += -DCURSES_GRAPHICS
WINSRC += $(WINCURSESSRC)
WINOBJ += $(WINCURSESOBJ)
WINLIB += -lncurses
endif
ifdef WANT_WIN_X11
WINSRC += $(WINX11SRC)
WINOBJ += $(WINX11OBJ)
+70 -14
View File
@@ -61,6 +61,19 @@ DEBUGINFO = Y
#TARGET_CPU=x64
#TARGET_CPU=x86
#---------------------------------------------------------------
# OPTIONAL - Curses window port support
#
# 4. Uncomment these and set them appropriate if you want to
# include curses port support alongside TTY support in your
# console binary. You'll have to set CURSESINCL to the location
# of your curses header (.h) files and CURSESDLL to the location
# of your pdcurses.dll.
#
ADD_CURSES=Y
CURSESINCL=..\..\pdcurses
CURSESLIB=..\..\pdcurses\wincon\pdcurses.lib
#
#==============================================================================
# This marks the end of the BUILD DECISIONS section.
#==============================================================================
@@ -85,16 +98,17 @@ DEBUGINFO = Y
# Source directories. Makedefs hardcodes these, don't change them.
#
INCL = ..\include # NetHack include files
DAT = ..\dat # NetHack data files
DOC = ..\doc # NetHack documentation files
UTIL = ..\util # Utility source
SRC = ..\src # Main source
SSYS = ..\sys\share # Shared system files
MSWSYS= ..\sys\winnt # mswin specific files
TTY = ..\win\tty # window port files (tty)
MSWIN = ..\win\win32 # window port files (WIN32)
WSHR = ..\win\share # Tile support files
INCL = ..\include # NetHack include files
DAT = ..\dat # NetHack data files
DOC = ..\doc # NetHack documentation files
UTIL = ..\util # Utility source
SRC = ..\src # Main source
SSYS = ..\sys\share # Shared system files
MSWSYS = ..\sys\winnt # mswin specific files
TTY = ..\win\tty # window port files (tty)
MSWIN = ..\win\win32 # window port files (win32)
CURSES = ..\win\curses # window port files (curses)
WSHR = ..\win\share # Tile support files
#
# Object directory.
@@ -203,6 +217,15 @@ VSVER=2999 #untested future version
#----------------------------------------------------------------
!IF "$(ADD_CURSES)" == "Y"
#CURSESDEF=-D"PDC_DLL_BUILD" -D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE"
!ELSE
CURSDEF=
CURSESLIB=
CURSESINCL=
!ENDIF
#These will be in the environment variables with one of the VS2017
#developer command prompts.
#VSCMD_ARG_HOST_ARCH=x64
@@ -234,7 +257,8 @@ CL_RECENT=-sdl
ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \
-D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"DLB" -D"_MBCS" \
-DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" -EHsc -fp:precise -Gd -GF -GS -Gy \
-DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" $(CURSESDEF) \
-EHsc -fp:precise -Gd -GF -GS -Gy \
$(CL_RECENT) -WX- -Zc:forScope -Zc:wchar_t -Zi
cdebug= -analyze- -D"_DEBUG" -Gm -MTd -RTC1 -Od
crelease= -analyze- -D"_MBCS" -errorReport:prompt -Gm- -MT -O2 -Ot -Ox -Oy
@@ -300,7 +324,12 @@ conlibs = $(baselibs)
guilibs = $(winlibs)
#
!IFNDEF ADD_CURSES
INCLDIR= /I..\include /I..\sys\winnt
!ELSE
INCLDIR= /I..\include /I..\sys\winnt /I$(CURSESINCL)
!ENDIF
#==========================================
# Util builds
@@ -313,7 +342,7 @@ lflagsBuild = $(lflags) $(conlibs) $(MACHINE)
# - Game build
#==========================================
LIBS= user32.lib winmm.lib $(ZLIB)
LIBS= user32.lib winmm.lib $(ZLIB) $(CURSESLIB)
! IF ("$(USE_DLB)"=="Y")
DLB = nhdat
@@ -406,6 +435,13 @@ REGEX = $(O)cppregex.o
TTYOBJ = $(O)topl.o $(O)getline.o $(O)wintty.o
!IFNDEF ADD_CURSES
CURSESOBJ=
!ELSE
CURSESOBJ= $(O)cursdial.o $(O)cursinit.o $(O)cursinvt.o $(O)cursmain.o \
$(O)cursmesg.o $(O)cursmisc.o $(O)cursstat.o $(O)curswins.o
!ENDIF
SOBJ = $(O)winnt.o $(O)pcsys.o $(O)pcunix.o \
$(SOUND) $(O)nhlan.o
@@ -414,7 +450,8 @@ OBJS = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
$(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
$(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
$(VOBJ21) $(VOBJ22) $(VOBJ23) $(VOBJ24) $(VOBJ25) \
$(VOBJ26) $(VOBJ27) $(VOBJ28) $(VOBJ29) $(REGEX)
$(VOBJ26) $(VOBJ27) $(VOBJ28) $(VOBJ29) $(REGEX) \
$(CURSESOBJ)
GUIOBJ = $(O)mhaskyn.o $(O)mhdlg.o \
$(O)mhfont.o $(O)mhinput.o $(O)mhmain.o $(O)mhmap.o \
@@ -524,6 +561,19 @@ DATABASE = $(DAT)\data.base
{$(UTIL)}.c{$(OBJ)}.o:
@$(cc) $(cflagsBuild) -Fo$@ $<
#==========================================
# Rules for files in win\curses
#==========================================
{$(CURSES)}.c{$(OBJ)}.o:
@$(cc) $(cflagsBuild) -Fo$@ $<
{$(CURSES)}.h{$(INCL)}.h:
@copy $< $@
#{$(CURSES)}.txt{$(DAT)}.txt:
# @copy $< $@
#==========================================
# Rules for files in win\share
#==========================================
@@ -592,7 +642,7 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \
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
-copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh
-if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh
-if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record.
echo install done > $@
@@ -987,6 +1037,12 @@ $(O)envchk.tag: $(O)obj.tag
! ELSE
@echo Windows x86 32-bit target build
! ENDIF
!IFDEF TTYOBJ
@echo tty window support included
! IF "$(ADD_CURSES)"=="Y"
@echo curses window support also included
! ENDIF
!ENDIF
! IF "$(CL)"!=""
# @echo Warning, the CL Environment variable is defined:
# @echo CL=$(CL)