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

View File

@@ -45,6 +45,7 @@
#if !defined(NOTTYGRAPHICS)
#define TTY_GRAPHICS /* good old tty based graphics */
#endif
/* #define CURSES_GRAPHICS *//* Curses interface - Karl Garrison*/
/* #define X11_GRAPHICS */ /* X11 interface */
/* #define QT_GRAPHICS */ /* Qt interface */
/* #define GNOME_GRAPHICS */ /* Gnome interface */
@@ -118,6 +119,12 @@
#define DEFAULT_WINDOW_SYS "tty"
#endif
#ifdef CURSES_GRAPHICS
#ifndef DEFAULT_WINDOW_SYS
#define DEFAULT_WINDOW_SYS "curses"
#endif
#endif
#ifdef X11_GRAPHICS
/*
* There are two ways that X11 tiles may be defined. (1) using a custom

View File

@@ -312,6 +312,7 @@ struct instance_flags {
boolean rlecomp; /* alternative to zerocomp; run-length encoding
* compression of levels when writing savefile */
uchar num_pad_mode;
boolean cursesgraphics; /* Use portable curses extended characters */
#if 0 /* XXXgraphics superseded by symbol sets */
boolean DECgraphics; /* use DEC VT-xxx extended character set */
boolean IBMgraphics; /* use IBM extended character set */
@@ -323,6 +324,8 @@ struct instance_flags {
uchar bouldersym; /* symbol for boulder display */
#ifdef TTY_GRAPHICS
char prevmsg_window; /* type of old message window to use */
#endif
#if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS)
boolean extmenu; /* extended commands use menu interface */
#endif
#ifdef MFLOPPY
@@ -363,8 +366,12 @@ struct instance_flags {
#ifdef TTY_TILES_ESCCODES
boolean vt_tiledata; /* output console codes for tile support in TTY */
#endif
boolean wizweight; /* display weight of everything in wizard mode */
boolean wizweight; /* display weight of everything in wizard mode */
boolean cmdassist; /* provide detailed assistance for some commands */
boolean clicklook; /* allow right-clicking for look */
boolean msg_is_alert; /* suggest windowport should grab player's attention
* and request <TAB> acknowlegement */
int statuslines; /* default = 2, code support for alternative 3 */
/*
* Window capability support.
*/
@@ -416,8 +423,11 @@ struct instance_flags {
boolean wc2_selectsaved; /* display a menu of user's saved games */
boolean wc2_darkgray; /* try to use dark-gray color for black glyphs */
boolean wc2_hitpointbar; /* show graphical bar representing hit points */
boolean cmdassist; /* provide detailed assistance for some commands */
boolean clicklook; /* allow right-clicking for look */
int wc2_term_cols; /* terminal width, in characters */
int wc2_term_rows; /* terminal height, in characters */
int wc2_windowborders; /* display borders on NetHack windows */
int wc2_petattr; /* text attributes for pet */
boolean wc2_guicolor; /* allow colours in gui (outside map) */
boolean obsolete; /* obsolete options can point at this, it isn't used */
struct autopickup_exception *autopickup_exceptions[2];
#define AP_LEAVE 0
@@ -438,6 +448,7 @@ struct instance_flags {
short soko_prize_type1; /* bag of holding or */
short soko_prize_type2; /* amulet of reflection */
struct debug_flags debug;
boolean windowtype_locked; /* windowtype can't change from configfile */
};
/*

View File

@@ -93,6 +93,7 @@ extern void FDECL(interject, (int));
* Compiler-specific adjustments
*===============================================
*/
#ifdef _MSC_VER
#if (_MSC_VER > 1000)
/* Visual C 8 warning elimination */
@@ -227,7 +228,9 @@ open(const char _FAR *__path, int __access, ... /*unsigned mode*/);
long _RTLENTRY _EXPFUNC lseek(int __handle, long __offset, int __fromwhere);
int _RTLENTRY _EXPFUNC read(int __handle, void _FAR *__buf, unsigned __len);
#endif
#include <conio.h>
#ifndef CURSES_GRAPHICS
#include <conio.h> /* conflicting definitions with curses.h */
#endif
#undef kbhit /* Use our special NT kbhit */
#define kbhit (*nt_kbhit)

View File

@@ -108,7 +108,7 @@ enum levl_typ_types {
/*
* The screen symbols may be the default or defined at game startup time.
* See drawing.c for defaults.
* Note: {ibm|dec}_graphics[] arrays (also in drawing.c) must be kept in
* Note: {ibm|dec|curses}_graphics[] arrays (also in drawing.c) must be kept in
* synch.
*/
@@ -294,9 +294,10 @@ struct symsetentry {
* Must match the order of the known_handlers strings
* in drawing.c
*/
#define H_UNK 0
#define H_IBM 1
#define H_DEC 2
#define H_UNK 0
#define H_IBM 1
#define H_DEC 2
#define H_CURS 3
extern const struct symdef defsyms[MAXPCHARS]; /* defaults */
extern const struct symdef def_warnsyms[WARNCOUNT];

View File

@@ -216,7 +216,11 @@ extern
after updating status window fields */
#define WC2_RESET_STATUS 0x0100L /* 09 call status_update(BL_RESET) to indicate
draw everything */
/* 23 free bits */
#define WC2_TERM_SIZE 0x0100L /* 10 support setting terminal size */
#define WC2_WINDOWBORDERS 0x0200L /* 11 display borders on nh windows */
#define WC2_PETATTR 0x0400L /* 12 attributes for hilite_pet */
#define WC2_GUICOLOR 0x0800L /* 13 display colours outside map win */
/* 19 free bits */
#define ALIGN_LEFT 1
#define ALIGN_RIGHT 2