mirror of
https://codeberg.org/noisytoot/notnotdnethack.git
synced 2025-04-06 08:30:41 +01:00
Compare commits
3 commits
1f5f3dab6d
...
cb6dd23ae1
Author | SHA1 | Date | |
---|---|---|---|
cb6dd23ae1 | |||
63bfa5a56b | |||
68bc9393d9 |
39 changed files with 39 additions and 6414 deletions
dat
include
amiconf.hbeconf.hbitmfile.hconfig.hconfig1.hdef_os2.hgem_rsc.hload_img.hmac-carbon.hmac-qt.hmac-term.hmacconf.hmacpopup.hmactty.hmacwin.hmicro.hmttypriv.hntconf.hos2conf.hpcconf.hqt_clust.hqt_kde0.hqt_win.hqt_xpms.hqttableview.hsystem.htile2x11.htosconf.htradstdc.hvmsconf.hwceconf.hwinGnome.hwinX.hwingem.hxwindow.hxwindowp.h
src
sys/unix
22
dat/opthelp
22
dat/opthelp
|
@ -8,9 +8,14 @@ autopickup automatically pick up objects you move over [TRUE]
|
|||
autoquiver when firing with an empty quiver, select some
|
||||
suitable inventory weapon to fill the quiver [FALSE]
|
||||
BIOS allow the use of IBM ROM BIOS calls [FALSE]
|
||||
block_forget_map disable amnesia map forgetting [TRUE]
|
||||
cmdassist give help for errors on direction & other commands [TRUE]
|
||||
confirm ask before hitting tame or peaceful monsters [TRUE]
|
||||
DECgraphics use DEC/VT line-drawing characters for the dungeon [FALSE]
|
||||
default_template_hilite enable default hilites for monster
|
||||
templates [TRUE]
|
||||
dnethack_start_text enable extra dNetHack-specific hints on
|
||||
starting or restoring a game [TRUE]
|
||||
eight_bit_tty send 8-bit characters straight to terminal [FALSE]
|
||||
extmenu use a menu for selecting extended commands (#) [FALSE]
|
||||
fixinv try to retain the same letter for the same object [TRUE]
|
||||
|
@ -79,6 +84,9 @@ paranoid_quit ask for explicit 'yes' when quitting [FALSE]
|
|||
Boolean option if PARANOID was set at compile time:
|
||||
paranoid_remove always show menu with the T and R commands [FALSE]
|
||||
|
||||
Boolean option if PARANOID was set at compile time:
|
||||
paranoid_swim require 'm' prefix to move into unsafe terrain [TRUE]
|
||||
|
||||
Boolean option if EXP_ON_BOTL was set at compile time:
|
||||
showexp display your accumulated experience points [FALSE]
|
||||
|
||||
|
@ -107,6 +115,12 @@ preload_tiles control whether tiles get pre-loaded into RAM at the
|
|||
Boolean option if WIN_EDGE was set at compile time (tty interface only):
|
||||
win_edge align menus and text windows left instead of right [FALSE]
|
||||
|
||||
Boolean option if CURSES_GRAPHICS was set at compile time:
|
||||
classic_status use a traditional NH3-style 2 or 3 line status window
|
||||
instead of an NH4-style 3 or 4 line status window [TRUE]
|
||||
classic_colors enables using traditional curses colours
|
||||
(ignoring terminal configuration) [FALSE]
|
||||
|
||||
Any Boolean option can be negated by prefixing it with a '!' or 'no'.
|
||||
|
||||
|
||||
|
@ -158,6 +172,12 @@ sortloot controls the sortloot patch [none]:
|
|||
loot -- When inventory letters are shown, has no effect.
|
||||
Otherwise sorts by description
|
||||
none -- Works the traditional way, like without the patch
|
||||
statuseffects space-separated list of status effects to show in the status line
|
||||
status effects can be negated by prefixing them with !
|
||||
the special value 'all' enables all status effects
|
||||
'all' can be negated with '!all' to disable all status effects
|
||||
default: [all]
|
||||
statuslines number of status lines (2, 3, or 4) [4]
|
||||
suppress_alert disable various version-specific warnings about changes
|
||||
in game play or the user interface, such as notification given
|
||||
for the 'Q' command that quitting is now done via #quit
|
||||
|
@ -169,6 +189,8 @@ Compound options which may be set only on startup are:
|
|||
align Your starting alignment (align:lawful, align:neutral,
|
||||
or align:chaotic). You may specify just the first letter. [RANDOM]
|
||||
catname the name of your first cat [NONE]
|
||||
delay_length set the length of delays when rendering animations
|
||||
none, short, or normal [normal]
|
||||
dogname the name of your first dog [NONE]
|
||||
dungeon a list of symbols to be used in place of the default ones for
|
||||
drawing the dungeon.
|
||||
|
|
|
@ -1,190 +0,0 @@
|
|||
/* SCCS Id: @(#)amiconf.h 3.4 2000/01/12 */
|
||||
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1990, 1991, 1992, 1993. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef AMICONF_H
|
||||
#define AMICONF_H
|
||||
|
||||
#undef abs /* avoid using macro form of abs */
|
||||
#ifndef __SASC_60
|
||||
# undef min /* this gets redefined */
|
||||
# undef max /* this gets redefined */
|
||||
#endif
|
||||
|
||||
#include <time.h> /* get time_t defined before use! */
|
||||
|
||||
#ifdef __SASC_60 /* since SAS can prevent re-inclusion */
|
||||
#include <stdlib.h> /* general things, including builtins */
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef AZTEC_50
|
||||
#include <stdlib.h>
|
||||
# define AZTEC_C_WORKAROUND /* Bug which turns up in sounds.c. Bummer... */
|
||||
# define NO_SIGNAL /* 5.0 signal handling doesn't like SIGINT... */
|
||||
#endif
|
||||
|
||||
#ifdef _DCC
|
||||
#include <stdlib.h>
|
||||
# define _SIZE_T
|
||||
# define DCC30_BUG /* A bitfield bug (from dog.c, others) in DICE 3.0. */
|
||||
#endif
|
||||
|
||||
#ifndef __GNUC__
|
||||
typedef long off_t;
|
||||
#endif
|
||||
|
||||
#define MICRO /* must be defined to allow some inclusions */
|
||||
|
||||
#define NOCWD_ASSUMPTIONS /* Allow paths to be specified for HACKDIR,
|
||||
LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
|
||||
SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
|
||||
|
||||
/* data librarian defs */
|
||||
#ifndef NOCWD_ASSUMPTIONS
|
||||
# define DLBFILE "NetHack:nhdat" /* main library */
|
||||
# define DLBFILE2 "NetHack:nhsdat" /* sound library */
|
||||
#else
|
||||
# define DLBFILE "nhdat" /* main library */
|
||||
# define DLBFILE2 "nhsdat" /* sound library */
|
||||
#endif
|
||||
|
||||
#define FILENAME_CMP stricmp /* case insensitive */
|
||||
|
||||
#ifndef __SASC_60
|
||||
# define O_BINARY 0
|
||||
#endif
|
||||
|
||||
/* Compile in New Intuition look for 2.0 */
|
||||
#ifdef IDCMP_CLOSEWINDOW
|
||||
# ifndef INTUI_NEW_LOOK
|
||||
# define INTUI_NEW_LOOK 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define MFLOPPY /* You'll probably want this; provides assistance
|
||||
* for typical personal computer configurations
|
||||
*/
|
||||
#define RANDOM
|
||||
|
||||
/* ### amidos.c ### */
|
||||
|
||||
extern void FDECL(nethack_exit, (int));
|
||||
|
||||
/* ### amiwbench.c ### */
|
||||
|
||||
extern void NDECL(ami_wbench_init);
|
||||
extern void NDECL(ami_wbench_args);
|
||||
extern int FDECL(ami_wbench_getsave, (int));
|
||||
extern void FDECL(ami_wbench_unlink, (char *));
|
||||
extern int FDECL(ami_wbench_iconsize, (char *));
|
||||
extern void FDECL(ami_wbench_iconwrite, (char *));
|
||||
extern int FDECL(ami_wbench_badopt, (const char *));
|
||||
extern void NDECL(ami_wbench_cleanup);
|
||||
extern void FDECL(getlind, (const char *,char *,const char *));
|
||||
|
||||
/* ### winreq.c ### */
|
||||
|
||||
extern void amii_setpens(int);
|
||||
|
||||
extern void FDECL(exit, (int));
|
||||
extern void NDECL(CleanUp);
|
||||
extern void FDECL(Abort, (long));
|
||||
extern int NDECL(getpid);
|
||||
extern char *FDECL(CopyFile, (const char *, const char *));
|
||||
extern int NDECL(kbhit);
|
||||
extern int NDECL(WindowGetchar);
|
||||
extern void FDECL(ami_argset, (int *, char *[]));
|
||||
extern void FDECL(ami_mkargline, (int *, char **[]));
|
||||
extern void ami_wininit_data(void);
|
||||
|
||||
#define FromWBench 0 /* A hint for compiler ... */
|
||||
/* extern boolean FromWBench; /* how were we run? */
|
||||
extern int ami_argc;
|
||||
extern char **ami_argv;
|
||||
|
||||
#ifndef MICRO_H
|
||||
#include "micro.h"
|
||||
#endif
|
||||
|
||||
#ifndef PCCONF_H
|
||||
#include "pcconf.h" /* remainder of stuff is almost same as the PC */
|
||||
#endif
|
||||
|
||||
#define remove(x) unlink(x)
|
||||
|
||||
/* DICE wants rewind() to return void. We want it to return int. */
|
||||
#if defined(_DCC) || defined(__GNUC__)
|
||||
# define rewind(f) fseek(f, 0, 0)
|
||||
#endif
|
||||
|
||||
#ifdef AZTEC_C
|
||||
extern FILE *FDECL(freopen, (const char *, const char *, FILE *));
|
||||
extern char *FDECL(gets, (char *));
|
||||
#endif
|
||||
|
||||
#define msmsg printf
|
||||
|
||||
/*
|
||||
* If AZTEC_C we can't use the long cpath in vision.c....
|
||||
*/
|
||||
#ifdef AZTEC_C
|
||||
# undef MACRO_CPATH
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (Possibly) configurable Amiga options:
|
||||
*/
|
||||
|
||||
#define TEXTCOLOR /* Use colored monsters and objects */
|
||||
#define HACKFONT /* Use special hack.font */
|
||||
#define SHELL /* Have a shell escape command (!) */
|
||||
#define MAIL /* Get mail at unexpected occasions */
|
||||
#define DEFAULT_ICON "NetHack:default.icon" /* private icon */
|
||||
#define AMIFLUSH /* toss typeahead (select flush in .cnf) */
|
||||
/* #define OPT_DISPMAP /* enable fast_map option */
|
||||
|
||||
/* new window system options */
|
||||
/* WRONG - AMIGA_INTUITION should go away */
|
||||
#ifdef AMII_GRAPHICS
|
||||
# define AMIGA_INTUITION /* high power graphics interface (amii) */
|
||||
#endif
|
||||
|
||||
#define CHANGE_COLOR 1
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
# define DEPTH 6 /* Maximum depth of the screen allowed */
|
||||
#else
|
||||
# define DEPTH 2 /* Four colors...sigh... */
|
||||
#endif
|
||||
|
||||
#define AMII_MAXCOLORS (1L<<DEPTH)
|
||||
typedef unsigned short AMII_COLOR_TYPE;
|
||||
|
||||
#define PORT_HELP "nethack:amii.hlp"
|
||||
|
||||
#undef TERMLIB
|
||||
|
||||
#define AMII_MUFFLED_VOLUME 40
|
||||
#define AMII_SOFT_VOLUME 50
|
||||
#define AMII_OKAY_VOLUME 60
|
||||
#define AMII_LOUDER_VOLUME 80
|
||||
|
||||
#ifdef TTY_GRAPHICS
|
||||
# define ANSI_DEFAULT
|
||||
#endif
|
||||
|
||||
extern int amibbs; /* BBS mode? */
|
||||
|
||||
#ifdef AMII_GRAPHICS
|
||||
extern int amii_numcolors;
|
||||
void FDECL( amii_setpens, (int) );
|
||||
#endif
|
||||
|
||||
/* for cmd.c: override version in micro.h */
|
||||
#ifdef __SASC_60
|
||||
# undef M
|
||||
# define M(c) ((c) - 128 )
|
||||
#endif
|
||||
|
||||
#endif /* AMICONF_H */
|
|
@ -1,36 +0,0 @@
|
|||
/* SCCS Id: @(#)beconf.h 3.4 1998/07/08 */
|
||||
/* Copyright (c) Dean Luick 1996. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/* Configuration for Be Inc.'s BeOS */
|
||||
|
||||
#ifndef BECONF_H
|
||||
#define BECONF_H
|
||||
|
||||
/*
|
||||
* We must use UNWIDENED_PROTOTYPES because we mix C++ and C.
|
||||
*/
|
||||
|
||||
#define index strchr
|
||||
#define rindex strrchr
|
||||
#define Rand rand /* Be should have a better rand function! */
|
||||
#define tgetch getchar
|
||||
#define FCMASK 0666
|
||||
#define PORT_ID "BeOS"
|
||||
#define TEXTCOLOR
|
||||
#define POSIX_TYPES
|
||||
#define SIG_RET_TYPE __signal_func_ptr
|
||||
|
||||
#include <time.h> /* for time_t */
|
||||
#include <unistd.h> /* for lseek() */
|
||||
|
||||
/* could go in extern.h, under bemain.c (or something..) */
|
||||
void regularize(char *);
|
||||
|
||||
|
||||
/* instead of including system.h... */
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <termcap.h>
|
||||
|
||||
#endif /* BECONF_H */
|
|
@ -1,37 +0,0 @@
|
|||
/****************************\
|
||||
* Bitmap mit Farbtabelle als *
|
||||
* Graphik-Datei speichern *
|
||||
* Autor: Gabriel Schmidt *
|
||||
* (c} 1992 by MAXON-Computer *
|
||||
* -> Header-Datei *
|
||||
\****************************/
|
||||
|
||||
#ifndef H_TO_FILE
|
||||
#define H_TO_FILE
|
||||
|
||||
/* #include <portab.h> */
|
||||
#define UWORD unsigned short
|
||||
#define ULONG unsigned long
|
||||
#define UBYTE unsigned char
|
||||
|
||||
#define XIMG_MAGIC 0x58494D47
|
||||
|
||||
|
||||
typedef enum { IMG, XIMG } FILE_TYP;
|
||||
|
||||
const char *get_file_ext(FILE_TYP typ);
|
||||
|
||||
struct RGB
|
||||
{
|
||||
UWORD r, g, b;
|
||||
};
|
||||
|
||||
int bitmap_to_file(FILE_TYP typ, int ww, int wh,
|
||||
unsigned int pwx, unsigned int pwy,
|
||||
unsigned int planes, unsigned int colors,
|
||||
const char *filename,
|
||||
void (*get_color) (unsigned int colind, struct RGB *rgb) ,
|
||||
void (*get_pixel) (int x, int y, unsigned int *colind) ) ;
|
||||
|
||||
#endif
|
||||
|
|
@ -153,12 +153,7 @@
|
|||
*/
|
||||
|
||||
#ifndef WIZARD /* allow for compile-time or Makefile changes */
|
||||
# ifndef KR1ED
|
||||
# define WIZARD "nethack" /* the person allowed to use the -D option */
|
||||
# else
|
||||
# define WIZARD
|
||||
# define WIZARD_NAME "nethack"
|
||||
# endif
|
||||
# define WIZARD "nethack" /* the person allowed to use the -D option */
|
||||
#endif
|
||||
|
||||
#define LOGFILE "logfile" /* larger file for debugging purposes */
|
||||
|
|
|
@ -5,200 +5,11 @@
|
|||
#ifndef CONFIG1_H
|
||||
#define CONFIG1_H
|
||||
|
||||
/*
|
||||
* MS DOS - compilers
|
||||
*
|
||||
* Microsoft C auto-defines MSDOS,
|
||||
* Borland C auto-defines __MSDOS__,
|
||||
* DJGPP auto-defines MSDOS.
|
||||
*/
|
||||
|
||||
/* #define MSDOS */ /* use if not defined by compiler or cases below */
|
||||
|
||||
#ifdef __MSDOS__ /* for Borland C */
|
||||
# ifndef MSDOS
|
||||
# define MSDOS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __TURBOC__
|
||||
# define __MSC /* increase Borland C compatibility in libraries */
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS
|
||||
# undef UNIX
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Mac Stuff.
|
||||
*/
|
||||
#ifdef macintosh /* Auto-defined symbol for MPW compilers (sc and mrc) */
|
||||
# define MAC
|
||||
#endif
|
||||
|
||||
#ifdef THINK_C /* Think C auto-defined symbol */
|
||||
# define MAC
|
||||
# define NEED_VARARGS
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__ /* defined by Metrowerks' Codewarrior compiler */
|
||||
# ifndef __BEOS__ /* BeOS */
|
||||
# define MAC
|
||||
# endif
|
||||
# define NEED_VARARGS
|
||||
# define USE_STDARG
|
||||
#endif
|
||||
|
||||
#if defined(MAC) || defined(__BEOS__)
|
||||
# define DLB
|
||||
# undef UNIX
|
||||
#endif
|
||||
|
||||
#ifdef __BEOS__
|
||||
# define NEED_VARARGS
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Amiga setup.
|
||||
*/
|
||||
#ifdef AZTEC_C /* Manx auto-defines this */
|
||||
# ifdef MCH_AMIGA /* Manx auto-defines this for AMIGA */
|
||||
# ifndef AMIGA
|
||||
#define AMIGA /* define for Commodore-Amiga */
|
||||
# endif /* (SAS/C auto-defines AMIGA) */
|
||||
#define AZTEC_50 /* define for version 5.0 of manx */
|
||||
# endif
|
||||
#endif
|
||||
#ifdef __SASC_60
|
||||
# define NEARDATA __near /* put some data close */
|
||||
#else
|
||||
# ifdef _DCC
|
||||
# define NEARDATA __near /* put some data close */
|
||||
# else
|
||||
# define NEARDATA
|
||||
# endif
|
||||
#endif
|
||||
#ifdef AMIGA
|
||||
# define NEED_VARARGS
|
||||
# undef UNIX
|
||||
# define DLB
|
||||
# define HACKDIR "NetHack:"
|
||||
# define NO_MACRO_CPATH
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Atari auto-detection
|
||||
*/
|
||||
|
||||
#ifdef atarist
|
||||
# undef UNIX
|
||||
# ifndef TOS
|
||||
# define TOS
|
||||
# endif
|
||||
#else
|
||||
# ifdef __MINT__
|
||||
# undef UNIX
|
||||
# ifndef TOS
|
||||
# define TOS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Windows NT Autodetection
|
||||
*/
|
||||
#ifdef _WIN32_WCE
|
||||
#define WIN_CE
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
# undef UNIX
|
||||
# undef MSDOS
|
||||
# define NHSTDC
|
||||
# define USE_STDARG
|
||||
# define NEED_VARARGS
|
||||
|
||||
#ifndef WIN_CE
|
||||
# define STRNCMPI
|
||||
# define STRCMPI
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define NEARDATA
|
||||
|
||||
#if defined(__linux__) && defined(__GNUC__) && !defined(_GNU_SOURCE)
|
||||
/* ensure _GNU_SOURCE is defined before including any system headers */
|
||||
# define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#ifdef VMS /* really old compilers need special handling, detected here */
|
||||
# undef UNIX
|
||||
# ifdef __DECC
|
||||
# ifndef __DECC_VER /* buggy early versions want widened prototypes */
|
||||
# define NOTSTDC /* except when typedefs are involved */
|
||||
# define USE_VARARGS
|
||||
# else
|
||||
# define NHSTDC
|
||||
# define USE_STDARG
|
||||
# define POSIX_TYPES
|
||||
# define _DECC_V4_SOURCE /* avoid some incompatible V5.x changes */
|
||||
# endif
|
||||
# undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */
|
||||
# else
|
||||
# ifdef VAXC /* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */
|
||||
# ifdef ANCIENT_VAXC /* vaxc v2.2 and earlier [lots of warnings to come] */
|
||||
# define KR1ED /* simulate defined() */
|
||||
# define USE_VARARGS
|
||||
# else /* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */
|
||||
# if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/
|
||||
# define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */
|
||||
# define signed /* well, almost close enough */
|
||||
#include <stddef.h>
|
||||
# define UNWIDENED_PROTOTYPES
|
||||
# endif
|
||||
# define USE_STDARG
|
||||
# endif
|
||||
# endif /*VAXC*/
|
||||
# endif /*__DECC*/
|
||||
# ifdef VERYOLD_VMS /* v4.5 or earlier; no longer available for testing */
|
||||
# define USE_OLDARGS /* <varargs.h> is there, vprintf & vsprintf aren't */
|
||||
# ifdef USE_VARARGS
|
||||
# undef USE_VARARGS
|
||||
# endif
|
||||
# ifdef USE_STDARG
|
||||
# undef USE_STDARG
|
||||
# endif
|
||||
# endif
|
||||
#endif /*VMS*/
|
||||
|
||||
#ifdef vax
|
||||
/* just in case someone thinks a DECstation is a vax. It's not, it's a mips */
|
||||
# ifdef ULTRIX_PROTO
|
||||
# undef ULTRIX_PROTO
|
||||
# endif
|
||||
# ifdef ULTRIX_CC20
|
||||
# undef ULTRIX_CC20
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef KR1ED /* For compilers which cannot handle defined() */
|
||||
#define defined(x) (-x-1 != -1)
|
||||
/* Because:
|
||||
* #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
|
||||
* #define FOO 1 or on command-line -DFOO
|
||||
* => defined(1) => (-1 != - 1 - 1) => 1
|
||||
* if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
|
||||
* for -DFOO, oh well.
|
||||
* => defined(0) => (-1 != - 0 - 1) => 0
|
||||
*
|
||||
* But:
|
||||
* defined("") => (-1 != - "" - 1)
|
||||
* [which is an unavoidable catastrophe.]
|
||||
*/
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG1_H */
|
||||
|
|
|
@ -1,212 +0,0 @@
|
|||
/* SCCS Id: @(#)def_os2.h 3.4 1993/01/19 */
|
||||
/* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/*
|
||||
* Only a small portion of all OS/2 defines are needed, so the
|
||||
* actual include files often need not be used. In fact,
|
||||
* including the full headers may stall the compile in DOS.
|
||||
*/
|
||||
|
||||
#ifdef OS2_USESYSHEADERS
|
||||
|
||||
# define INCL_NOPMAPI
|
||||
# define INCL_DOSFILEMGR
|
||||
# define INCL_DOS
|
||||
# define INCL_SUB
|
||||
|
||||
#include <os2.h>
|
||||
|
||||
#else
|
||||
|
||||
typedef char CHAR;
|
||||
typedef void VOID;
|
||||
|
||||
typedef unsigned char UCHAR;
|
||||
typedef unsigned short USHORT;
|
||||
typedef unsigned int UINT;
|
||||
typedef unsigned long ULONG;
|
||||
typedef unsigned char BYTE;
|
||||
|
||||
# ifdef OS2_32BITAPI
|
||||
|
||||
typedef unsigned long SHANDLE;
|
||||
typedef USHORT HKBD;
|
||||
typedef USHORT HVIO;
|
||||
|
||||
# define CCHMAXPATHCOMP 256
|
||||
|
||||
# ifdef OS2_CSET2
|
||||
# define API16 _Far16 _Pascal
|
||||
# define DAT16
|
||||
# define API32 _System
|
||||
# define KbdGetStatus KBD16GETSTATUS
|
||||
# define KbdSetStatus KBD16SETSTATUS
|
||||
# define KbdCharIn KBD16CHARIN
|
||||
# define KbdPeek KBD16PEEK
|
||||
# define VioGetMode VIO16GETMODE
|
||||
# define VioSetCurPos VIO16SETCURPOS
|
||||
# else
|
||||
# define API16
|
||||
# define DAT16
|
||||
# define API32
|
||||
# endif
|
||||
|
||||
# define DAT
|
||||
|
||||
# else /* OS2_32BITAPI */
|
||||
|
||||
typedef unsigned short SHANDLE;
|
||||
typedef SHANDLE HKBD;
|
||||
typedef SHANDLE HVIO;
|
||||
|
||||
# define CCHMAXPATHCOMP 13
|
||||
|
||||
# ifdef OS2_MSC
|
||||
# define API16 pascal far
|
||||
# define DAT16
|
||||
# endif
|
||||
|
||||
# define DAT DAT16
|
||||
|
||||
# endif /* OS2_32BITAPI */
|
||||
|
||||
typedef USHORT * DAT16 PUSHORT;
|
||||
typedef BYTE * DAT16 PBYTE;
|
||||
typedef ULONG * DAT PULONG;
|
||||
typedef VOID * DAT PVOID;
|
||||
|
||||
typedef SHANDLE HDIR;
|
||||
typedef HDIR * DAT PHDIR;
|
||||
|
||||
typedef char * DAT16 PCH;
|
||||
typedef char * DAT PSZ;
|
||||
|
||||
/* all supported compilers understand this */
|
||||
|
||||
# pragma pack(2)
|
||||
|
||||
typedef struct {
|
||||
UCHAR chChar;
|
||||
UCHAR chScan;
|
||||
UCHAR fbStatus;
|
||||
UCHAR bNlsShift;
|
||||
USHORT fsState;
|
||||
ULONG time;
|
||||
} KBDKEYINFO;
|
||||
|
||||
typedef KBDKEYINFO * DAT16 PKBDKEYINFO;
|
||||
|
||||
/* File time and date types */
|
||||
|
||||
typedef struct {
|
||||
UINT twosecs : 5;
|
||||
UINT minutes : 6;
|
||||
UINT hours : 5;
|
||||
} FTIME;
|
||||
|
||||
typedef struct {
|
||||
UINT day : 5;
|
||||
UINT month : 4;
|
||||
UINT year : 7;
|
||||
} FDATE;
|
||||
|
||||
# ifdef OS2_32BITAPI
|
||||
|
||||
typedef struct {
|
||||
ULONG oNextEntryOffset;
|
||||
FDATE fdateCreation;
|
||||
FTIME ftimeCreation;
|
||||
FDATE fdateLastAccess;
|
||||
FTIME ftimeLastAccess;
|
||||
FDATE fdateLastWrite;
|
||||
FTIME ftimeLastWrite;
|
||||
ULONG cbFile;
|
||||
ULONG cbFileAlloc;
|
||||
ULONG attrFile;
|
||||
UCHAR cchName;
|
||||
CHAR achName[CCHMAXPATHCOMP];
|
||||
} FILEFINDBUF3;
|
||||
|
||||
# else
|
||||
|
||||
typedef struct {
|
||||
FDATE fdateCreation;
|
||||
FTIME ftimeCreation;
|
||||
FDATE fdateLastAccess;
|
||||
FTIME ftimeLastAccess;
|
||||
FDATE fdateLastWrite;
|
||||
FTIME ftimeLastWrite;
|
||||
ULONG cbFile;
|
||||
ULONG cbFileAlloc;
|
||||
USHORT attrFile;
|
||||
UCHAR cchName;
|
||||
CHAR achName[CCHMAXPATHCOMP];
|
||||
} FILEFINDBUF;
|
||||
|
||||
typedef FILEFINDBUF * DAT16 PFILEFINDBUF;
|
||||
|
||||
# endif /* OS2_32BITAPI */
|
||||
|
||||
typedef struct {
|
||||
ULONG idFileSystem;
|
||||
ULONG cSectorUnit;
|
||||
ULONG cUnit;
|
||||
ULONG cUnitAvail;
|
||||
USHORT cbSector;
|
||||
} FSALLOCATE;
|
||||
|
||||
typedef struct {
|
||||
USHORT cb;
|
||||
USHORT fsMask;
|
||||
USHORT chTurnAround;
|
||||
USHORT fsInterim;
|
||||
USHORT fsState;
|
||||
} KBDINFO;
|
||||
|
||||
typedef KBDINFO * DAT16 PKBDINFO;
|
||||
|
||||
typedef struct {
|
||||
USHORT cb;
|
||||
UCHAR fbType;
|
||||
UCHAR color;
|
||||
USHORT col;
|
||||
USHORT row;
|
||||
USHORT hres;
|
||||
USHORT vres;
|
||||
UCHAR fmt_ID;
|
||||
UCHAR attrib;
|
||||
ULONG buf_addr;
|
||||
ULONG buf_length;
|
||||
ULONG full_length;
|
||||
ULONG partial_length;
|
||||
PCH ext_data_addr;
|
||||
} VIOMODEINFO;
|
||||
|
||||
typedef VIOMODEINFO * DAT16 PVIOMODEINFO;
|
||||
|
||||
# pragma pack()
|
||||
|
||||
/* OS2 API functions */
|
||||
|
||||
USHORT API16 KbdGetStatus(PKBDINFO, HKBD);
|
||||
USHORT API16 KbdSetStatus(PKBDINFO, HKBD);
|
||||
USHORT API16 KbdCharIn(PKBDKEYINFO, USHORT, HKBD);
|
||||
USHORT API16 KbdPeek(PKBDKEYINFO, HKBD);
|
||||
|
||||
USHORT API16 VioGetMode(PVIOMODEINFO, HVIO);
|
||||
USHORT API16 VioSetCurPos(USHORT, USHORT, HVIO);
|
||||
|
||||
# ifdef OS2_32BITAPI
|
||||
ULONG API32 DosQueryFSInfo(ULONG, ULONG, PVOID, ULONG);
|
||||
ULONG API32 DosFindFirst(PSZ, PHDIR, ULONG, PVOID, ULONG, PULONG, ULONG);
|
||||
ULONG API32 DosFindNext(HDIR, PVOID, ULONG, PULONG);
|
||||
ULONG API32 DosSetDefaultDisk(ULONG);
|
||||
# else
|
||||
USHORT API16 DosQFSInfo(USHORT, USHORT, PBYTE, USHORT);
|
||||
USHORT API16 DosFindFirst(PSZ, PHDIR, USHORT, PFILEFINDBUF, USHORT, PUSHORT, ULONG);
|
||||
USHORT API16 DosFindNext(HDIR, PFILEFINDBUF, USHORT, PUSHORT);
|
||||
USHORT API16 DosSelectDisk(USHORT);
|
||||
# endif /* OS2_32BITAPI */
|
||||
|
||||
#endif /* OS2_USESYSHEADERS */
|
|
@ -1,65 +0,0 @@
|
|||
/* resource set indices for GEM_RSC */
|
||||
|
||||
#define MENU 0 /* menu */
|
||||
#define DOABOUT 12 /* STRING in tree MENU */
|
||||
#define DOQUIT 30 /* STRING in tree MENU */
|
||||
|
||||
#define STATUSLINE 1 /* form/dialog */
|
||||
#define GRABSTATUS 1 /* BOX in tree STATUSLINE */
|
||||
|
||||
#define MAPWIN 2 /* form/dialog */
|
||||
#define MAPBOX 0 /* BOX in tree MAPWIN */
|
||||
#define MAPCURSOR 1 /* IBOX in tree MAPWIN */
|
||||
|
||||
#define ABOUT 3 /* form/dialog */
|
||||
#define FLYABOUT 0 /* BOX in tree ABOUT */
|
||||
#define OKABOUT 1 /* BUTTON in tree ABOUT */
|
||||
#define NETHACKIMG0 3 /* ICON in tree ABOUT */
|
||||
|
||||
#define LINES 4 /* form/dialog */
|
||||
#define FLYLINES 0 /* BOX in tree LINES */
|
||||
#define QLINE 1 /* BUTTON in tree LINES */
|
||||
#define LINESLIST 2 /* USERDEF in tree LINES */
|
||||
|
||||
#define YNCHOICE 5 /* form/dialog */
|
||||
#define FLYYNCHOICE 0 /* BOX in tree YNCHOICE */
|
||||
#define YNPROMPT 1 /* TEXT in tree YNCHOICE */
|
||||
#define SOMECHARS 2 /* BOX in tree YNCHOICE */
|
||||
#define YN1 3 /* BUTTON in tree YNCHOICE */
|
||||
#define YNN 53 /* BUTTON in tree YNCHOICE */
|
||||
#define ANYCHAR 55 /* BOX in tree YNCHOICE */
|
||||
#define CHOSENCH 56 /* FBOXTEXT in tree YNCHOICE */
|
||||
#define COUNT 58 /* FBOXTEXT in tree YNCHOICE */
|
||||
#define YNOK 59 /* BUTTON in tree YNCHOICE */
|
||||
|
||||
#define LINEGET 6 /* form/dialog */
|
||||
#define FLYLINEGET 0 /* BOX in tree LINEGET */
|
||||
#define LGPROMPT 1 /* TEXT in tree LINEGET */
|
||||
#define LGREPLY 2 /* FBOXTEXT in tree LINEGET */
|
||||
#define QLG 3 /* BUTTON in tree LINEGET */
|
||||
#define LGOK 4 /* BUTTON in tree LINEGET */
|
||||
|
||||
#define DIRECTION 7 /* form/dialog */
|
||||
#define FLYDIRECTION 0 /* BOX in tree DIRECTION */
|
||||
#define DIR1 5 /* BOXTEXT in tree DIRECTION */
|
||||
#define DIR9 21 /* BOXTEXT in tree DIRECTION */
|
||||
#define DIRDOWN 23 /* BOXTEXT in tree DIRECTION */
|
||||
#define DIRUP 25 /* BOXTEXT in tree DIRECTION */
|
||||
|
||||
#define MSGWIN 8 /* form/dialog */
|
||||
#define UPMSG 1 /* BOXCHAR in tree MSGWIN */
|
||||
#define GRABMSGWIN 2 /* BOX in tree MSGWIN */
|
||||
#define DNMSG 3 /* BOXCHAR in tree MSGWIN */
|
||||
#define MSGLINES 4 /* USERDEF in tree MSGWIN */
|
||||
|
||||
#define NAMEGET 9 /* form/dialog */
|
||||
#define FLYNAMEGET 0 /* BOX in tree NAMEGET */
|
||||
#define PLNAME 2 /* FBOXTEXT in tree NAMEGET */
|
||||
#define NETHACKPICTURE 4 /* BOXTEXT in tree NAMEGET */
|
||||
|
||||
#define PAGER 10 /* form/dialog */
|
||||
#define FLYPAGER 0 /* BOX in tree PAGER */
|
||||
#define QPAGER 1 /* BUTTON in tree PAGER */
|
||||
|
||||
#define NHICON 11 /* form/dialog */
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
|
||||
/* ------------------------------------------- */
|
||||
#define XIMG 0x58494D47
|
||||
|
||||
/* Header of GEM Image Files */
|
||||
typedef struct IMG_HEADER{
|
||||
short version; /* Img file format version (1) */
|
||||
short length; /* Header length in words (8) */
|
||||
short planes; /* Number of bit-planes (1) */
|
||||
short pat_len; /* length of Patterns (2) */
|
||||
short pix_w; /* Pixel width in 1/1000 mmm (372) */
|
||||
short pix_h; /* Pixel height in 1/1000 mmm (372) */
|
||||
short img_w; /* Pixels per line (=(x+7)/8 Bytes) */
|
||||
short img_h; /* Total number of lines */
|
||||
long magic; /* Contains "XIMG" if standard color */
|
||||
short paltype; /* palette type (0=RGB (short each)) */
|
||||
short *palette; /* palette etc. */
|
||||
char *addr; /* Address for the depacked bit-planes */
|
||||
} IMG_header;
|
||||
|
||||
/* ------------------------------------------- */
|
||||
/* error codes */
|
||||
#define ERR_HEADER 1
|
||||
#define ERR_ALLOC 2
|
||||
#define ERR_FILE 3
|
||||
#define ERR_DEPACK 4
|
||||
#define ERR_COLOR 5
|
||||
|
||||
/* saves the current colorpalette with col colors in palette */
|
||||
void get_colors(int handle, short *palette, int col);
|
||||
|
||||
/* sets col colors from palette */
|
||||
void img_set_colors(int handle,short *palette, int col);
|
||||
|
||||
/* converts MFDB of size from standard to deviceformat (0 if succeded, else error). */
|
||||
int convert(MFDB *, long );
|
||||
|
||||
/* transforms image in VDI-Device format */
|
||||
int transform_img(MFDB *);
|
||||
|
||||
/* Loads & depacks IMG (0 if succeded, else error). */
|
||||
/* Bitplanes are one after another in address IMG_HEADER.addr. */
|
||||
int depack_img(char *, IMG_header *);
|
||||
|
||||
/* Halves IMG in Device-format, dest memory has to be allocated*/
|
||||
int half_img(MFDB *,MFDB *);
|
|
@ -1,32 +0,0 @@
|
|||
/* SCCS Id: @(#)mac-carbon.h 3.4 2003/06/01 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/* Compiler prefix file for the Macintosh Carbon port.
|
||||
*
|
||||
* IMPORTANT: This file is intended only as a compiler prefix
|
||||
* file and must NEVER be included by other source (.c or .h)
|
||||
* files.
|
||||
*
|
||||
* Usage for MacOS X Project Builder:
|
||||
* Project menu -> Edit Active Target '_target_' ->
|
||||
* target settings dialog -> Settings -> Simple View ->
|
||||
* GCC Compiler Settings ->
|
||||
* set "Prefix Header" to include/mac-carbon.h
|
||||
*
|
||||
* Usage for Metrowerks CodeWarrior:
|
||||
* Edit menu -> _target_ Settings -> Language Settings ->
|
||||
* C/C++ Language ->
|
||||
* set "Prefix File" to include/mac-carbon.h
|
||||
*/
|
||||
|
||||
#define MAC
|
||||
#undef UNIX
|
||||
|
||||
/* May already be defined by CodeWarrior as 0 or 1 */
|
||||
#ifdef TARGET_API_MAC_CARBON
|
||||
# undef TARGET_API_MAC_CARBON
|
||||
#endif
|
||||
#define TARGET_API_MAC_CARBON 1
|
||||
|
||||
#define GCC_WARN
|
|
@ -1,33 +0,0 @@
|
|||
/* SCCS Id: @(#)mac-qt.h 3.4 2003/06/01 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/* Compiler prefix file for the Macintosh Qt port.
|
||||
*
|
||||
* IMPORTANT: This file is intended only as a compiler prefix
|
||||
* file and must NEVER be included by other source (.c or .h)
|
||||
* files.
|
||||
*
|
||||
* Usage for MacOS X Project Builder:
|
||||
* Project menu -> Edit Active Target '_target_' ->
|
||||
* target settings dialog -> Settings -> Simple View ->
|
||||
* GCC Compiler Settings ->
|
||||
* set "Prefix Header" to include/mac-qt.h
|
||||
*
|
||||
* Usage for Metrowerks CodeWarrior:
|
||||
* Edit menu -> _target_ Settings -> Language Settings ->
|
||||
* C/C++ Language ->
|
||||
* set "Prefix File" to include/mac-qt.h
|
||||
*/
|
||||
|
||||
#undef MAC
|
||||
#define UNIX
|
||||
#define BSD
|
||||
|
||||
/* May already be defined by CodeWarrior as 0 or 1 */
|
||||
#ifdef TARGET_API_MAC_CARBON
|
||||
# undef TARGET_API_MAC_CARBON
|
||||
#endif
|
||||
#define TARGET_API_MAC_CARBON 0
|
||||
|
||||
#define GCC_WARN
|
|
@ -1,34 +0,0 @@
|
|||
/* SCCS Id: @(#)mac-term.h 3.4 2003/06/01 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2003. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/* Compiler prefix file for the MacOS X Terminal.app port.
|
||||
*
|
||||
* IMPORTANT: This file is intended only as a compiler prefix
|
||||
* file and must NEVER be included by other source (.c or .h)
|
||||
* files.
|
||||
*
|
||||
* Usage for MacOS X Project Builder:
|
||||
* Project menu -> Edit Active Target '_target_' ->
|
||||
* target settings dialog -> Settings -> Simple View ->
|
||||
* GCC Compiler Settings ->
|
||||
* set "Prefix Header" to include/mac-term.h
|
||||
*
|
||||
* Usage for Metrowerks CodeWarrior:
|
||||
* Edit menu -> _target_ Settings -> Language Settings ->
|
||||
* C/C++ Language ->
|
||||
* set "Prefix File" to include/mac-term.h
|
||||
*/
|
||||
|
||||
/* Stuff needed for the core of NetHack */
|
||||
#undef MAC
|
||||
#define UNIX
|
||||
#define BSD
|
||||
#define __FreeBSD__ /* Darwin is based on FreeBSD */
|
||||
#define GCC_WARN
|
||||
|
||||
/* May already be defined by CodeWarrior as 0 or 1 */
|
||||
#ifdef TARGET_API_MAC_CARBON
|
||||
# undef TARGET_API_MAC_CARBON
|
||||
#endif
|
||||
#define TARGET_API_MAC_CARBON 0 /* Not Carbon */
|
|
@ -1,119 +0,0 @@
|
|||
/* SCCS Id: @(#)macconf.h 3.4 1999/10/25 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifdef MAC
|
||||
# ifndef MACCONF_H
|
||||
# define MACCONF_H
|
||||
|
||||
/*
|
||||
* Compiler selection is based on the following symbols:
|
||||
*
|
||||
* __SC__ sc, a MPW 68k compiler
|
||||
* __MRC__ mrc, a MPW PowerPC compiler
|
||||
* THINK_C Think C compiler
|
||||
* __MWERKS__ Metrowerks' Codewarrior compiler
|
||||
*
|
||||
* We use these early in config.h to define some needed symbols,
|
||||
* including MAC.
|
||||
#
|
||||
# The Metrowerks compiler defines __STDC__ (which sets NHSTC) and uses
|
||||
# WIDENED_PROTOTYPES (defined if UNWIDENED_PROTOTYPES is undefined and
|
||||
# NHSTDC is defined).
|
||||
*/
|
||||
|
||||
#ifndef __powerc
|
||||
# define MAC68K /* 68K mac (non-powerpc) */
|
||||
#endif
|
||||
#ifndef TARGET_API_MAC_CARBON
|
||||
# define TARGET_API_MAC_CARBON 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __MACH__
|
||||
#define RANDOM
|
||||
#endif
|
||||
#define NO_SIGNAL /* You wouldn't believe our signals ... */
|
||||
#define FILENAME 256
|
||||
#define NO_TERMS /* For tty port (see wintty.h) */
|
||||
|
||||
#define TEXTCOLOR /* For Mac TTY interface */
|
||||
#define CHANGE_COLOR
|
||||
|
||||
/* Use these two includes instead of system.h. */
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Uncomment this line if your headers don't already define off_t */
|
||||
/*typedef long off_t;*/
|
||||
#include <time.h> /* for time_t */
|
||||
|
||||
/*
|
||||
* Try and keep the number of files here to an ABSOLUTE minimum !
|
||||
* include the relevant files in the relevant .c files instead !
|
||||
*/
|
||||
#if TARGET_API_MAC_CARBON
|
||||
/* Avoid including <CarbonCore/fp.h> -- it has a conflicting expl() */
|
||||
# define __FP__
|
||||
# include <Carbon/Carbon.h>
|
||||
#else
|
||||
# include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We could use the PSN under sys 7 here ...
|
||||
* ...but it wouldn't matter...
|
||||
*/
|
||||
#define getpid() 1
|
||||
#define getuid() 1
|
||||
#define index strchr
|
||||
#define rindex strrchr
|
||||
|
||||
#define Rand random
|
||||
extern void error(const char *,...);
|
||||
|
||||
#if !defined(O_WRONLY)
|
||||
# ifdef __MWERKS__
|
||||
# include <unix.h>
|
||||
# endif
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't redefine these Unix IO functions when making LevComp or DgnComp for
|
||||
* MPW. With MPW, we make them into MPW tools, which use unix IO. SPEC_LEV
|
||||
* and DGN_COMP are defined when compiling for LevComp and DgnComp respectively.
|
||||
*/
|
||||
#if !((defined(__SC__) || defined(__MRC__) || defined(__MACH__)) && (defined(SPEC_LEV) || defined(DGN_COMP)))
|
||||
# define creat maccreat
|
||||
# define open macopen
|
||||
# define close macclose
|
||||
# define read macread
|
||||
# define write macwrite
|
||||
# define lseek macseek
|
||||
#ifdef __MWERKS__
|
||||
# define unlink _unlink
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
|
||||
# define TEXT_TYPE 'TEXT'
|
||||
# define LEVL_TYPE 'LEVL'
|
||||
# define BONE_TYPE 'BONE'
|
||||
# define SAVE_TYPE 'SAVE'
|
||||
# define PREF_TYPE 'PREF'
|
||||
# define DATA_TYPE 'DATA'
|
||||
# define MAC_CREATOR 'nh31' /* Registered with DTS ! */
|
||||
# define TEXT_CREATOR 'ttxt' /* Something the user can actually edit */
|
||||
|
||||
/*
|
||||
* Define PORT_HELP to be the name of the port-specfic help file.
|
||||
* This file is included into the resource fork of the application.
|
||||
*/
|
||||
#define PORT_HELP "MacHelp"
|
||||
|
||||
#define MAC_GRAPHICS_ENV
|
||||
|
||||
# endif /* ! MACCONF_H */
|
||||
#endif /* MAC */
|
|
@ -1,15 +0,0 @@
|
|||
/* SCCS Id: @(#)macpopup.h 3.4 1999/10/25 */
|
||||
/* Copyright (c) Nethack Develpment Team, 1999. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef MACPOPUP_H
|
||||
# define MACPOPUP_H
|
||||
|
||||
/* ### mmodal.c ### */
|
||||
|
||||
extern void FlashButton(DialogRef, short);
|
||||
extern char queued_resp(char *resp);
|
||||
extern char topl_yn_function(const char *query, const char *resp, char def);
|
||||
extern int get_line_from_key_queue(char *bufp);
|
||||
|
||||
#endif /* MACPOPUP_H */
|
347
include/mactty.h
347
include/mactty.h
|
@ -1,347 +0,0 @@
|
|||
/* SCCS Id: @(#)mactty.h 3.4 1993/03/01 */
|
||||
/* Copyright (c) Jon W{tte 1993. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/*
|
||||
* This header is the supported external interface for the "tty" window
|
||||
* package. This package sports care-free handling of "dumb" tty windows
|
||||
* (preferrably using monospaced fonts) - it does NOT remember the strings
|
||||
* sent to it; rather, it uses an offscreen bitmap.
|
||||
*
|
||||
* For best performance, make sure it is aligned on a 32-pixel boundary
|
||||
* (or at least a 16-pixel one) in black & white. For 24bit color,
|
||||
* alignment doesn't matter, and for 8-bit color, alignment to every
|
||||
* fourth pixel is most efficient.
|
||||
*
|
||||
* (c) Copyright 1993 Jon W{tte
|
||||
*/
|
||||
|
||||
/*
|
||||
* You should really not poke in the structures used by the tty window.
|
||||
* However, since it uses the wRefCon of windows (by calling GetWRefCon
|
||||
* and SetWRefCon) you lose that possibility. If you still want to store
|
||||
* information about a window, the FIRST location _pointed to_ by the
|
||||
* wRefCon will be a void * that you can use for whatever reasons. Don't
|
||||
* take the address of this variable and expect it to stay the same
|
||||
* across calls to the tty window.
|
||||
*
|
||||
* void * my_config_ptr = * ( void * * ) GetWRefCon ( tty_window ) ;
|
||||
*/
|
||||
|
||||
/*
|
||||
* The library uses the window's port temporarily through SetPortBits;
|
||||
* that means you shouldn't do any funky things to the clipping region
|
||||
* etc. Actually, you shouldn't even resize the window, as that will clip
|
||||
* new drawing.
|
||||
*
|
||||
* Also, if you use this library under Pascal, remember that the string
|
||||
* passed to add_tty_string() is a "C" style string with NO length byte,
|
||||
* and a terminating zero byte at the end instead.
|
||||
*/
|
||||
|
||||
#ifndef _H_tty_public
|
||||
# define _H_tty_public
|
||||
#undef red /* undef internal color const strings from decl */
|
||||
#undef green
|
||||
#undef blue
|
||||
#if !TARGET_API_MAC_CARBON
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Error code returned when it's probably our fault, or
|
||||
* bad parameters.
|
||||
*/
|
||||
#define general_failure 1
|
||||
|
||||
/*
|
||||
* Base resource id's for window types
|
||||
*/
|
||||
#define WIN_BASE_RES 128
|
||||
#define WIN_BASE_KIND 128
|
||||
|
||||
/*
|
||||
* Commonly used characters
|
||||
*/
|
||||
#define CHAR_ENTER ((char)3)
|
||||
#define CHAR_BELL ((char)7)
|
||||
#define CHAR_BS ((char)8)
|
||||
#define CHAR_LF ((char)10)
|
||||
#define CHAR_CR ((char)13)
|
||||
#define CHAR_ESC ((char)27)
|
||||
#define CHAR_BLANK ((char)32)
|
||||
#define CHAR_DELETE ((char)127)
|
||||
|
||||
extern char game_active; /* flag to window rendering routines not to use ppat */
|
||||
/*
|
||||
* If you want some fancy operations that not a normal TTY device normally
|
||||
* supports, use EXTENDED_SUPPORT. For frames, area erases and area scrolls,
|
||||
* plus bitmap graphics - RESOLUTION DEPENDENT, be sure to call
|
||||
* get_tty_metrics and use those limits.
|
||||
*/
|
||||
#define EXTENDED_SUPPORT 0
|
||||
/*
|
||||
* if you print a lot of single characters, accumulating each one in a
|
||||
* clipping region will take too much time. Instead, define this, which
|
||||
* will clip in rects.
|
||||
*/
|
||||
#define CLIP_RECT_ONLY 1
|
||||
|
||||
typedef enum tty_attrib {
|
||||
|
||||
/*
|
||||
* Flags relating to the general functioning of the window.
|
||||
* These flags are passed at create_tty time, and changing them
|
||||
* later will clear the screen.
|
||||
*/
|
||||
TTY_ATTRIB_FLAGS ,
|
||||
/*
|
||||
* When using proportional fonts, this will place each character
|
||||
* separately, ensuring aligned columns (but looking ugly and taking
|
||||
* time)
|
||||
*/
|
||||
# define TA_MOVE_EACH_CHAR 1L
|
||||
/*
|
||||
* This means draw each change as it occurs instead of collecting the area
|
||||
* and draw it all at once at update_tty() - slower, but more reliable.
|
||||
*/
|
||||
# define TA_ALWAYS_REFRESH 2L
|
||||
/*
|
||||
* When reaching the right end, we either just stop drawing, or wrap to the
|
||||
* next line.
|
||||
*/
|
||||
# define TA_WRAP_AROUND 4L
|
||||
/*
|
||||
* Overstrike means that characters are added on top of each other; i e don't
|
||||
* clear the letter beneath. This is faster, using srcOr under QuickDraw
|
||||
*/
|
||||
# define TA_OVERSTRIKE 8L
|
||||
/*
|
||||
* We may want the window not to scroll when we reach the end line,
|
||||
* but stop drawing instead.
|
||||
*/
|
||||
# define TA_INHIBIT_VERT_SCROLL 16L
|
||||
|
||||
/*
|
||||
* Foreground and background colors. These only affect characters
|
||||
* drawn by subsequent calls; not what's already there (but it does
|
||||
* affect clears)
|
||||
* On b/w screens these do nothing.
|
||||
*/
|
||||
TTY_ATTRIB_FOREGROUND ,
|
||||
TTY_ATTRIB_BACKGROUND ,
|
||||
# define TA_RGB_TO_TTY(r) ((((long)((r).red>>8)&0xff)<<16)+\
|
||||
(((long)((r).green>>8)&0xff)<<8)+((long)((r).blue>>8)&0xff))
|
||||
|
||||
/*
|
||||
* Attributes relating to the cursor, and character set mappings
|
||||
*/
|
||||
TTY_ATTRIB_CURSOR ,
|
||||
/*
|
||||
* Blinking cursor is more noticeable when it's idle
|
||||
*/
|
||||
# define TA_BLINKING_CURSOR 1L
|
||||
/*
|
||||
* When handling input, do we echo characters as they are typed?
|
||||
*/
|
||||
# define TA_ECHO_INPUT 2L
|
||||
/*
|
||||
* Do we return each character code separately, or map delete etc? Note
|
||||
* that non-raw input means getchar won't return anything until the user
|
||||
* has typed a return.
|
||||
*/
|
||||
# define TA_RAW_INPUT 4L
|
||||
/*
|
||||
* Do we print every character as it is (including BS, NL and CR!) or do
|
||||
* do we interpret characters such as NL, BS and CR?
|
||||
*/
|
||||
# define TA_RAW_OUTPUT 8L
|
||||
/*
|
||||
* When getting a NL, do we also move to the left?
|
||||
*/
|
||||
# define TA_NL_ADD_CR 16L
|
||||
/*
|
||||
* When getting a CR, do we also move down?
|
||||
*/
|
||||
# define TA_CR_ADD_NL 32L
|
||||
/*
|
||||
* Wait for input or return what we've got?
|
||||
*/
|
||||
# define TA_NONBLOCKING_IO 64L
|
||||
|
||||
/*
|
||||
* Use this macro to cast a function pointer to a tty attribute; this will help
|
||||
* portability to systems where a function pointer doesn't fit in a long
|
||||
*/
|
||||
# define TA_ATTRIB_FUNC(x) ((long)(x))
|
||||
|
||||
/*
|
||||
* This symbolic constant is used to check the number of attributes
|
||||
*/
|
||||
TTY_NUMBER_ATTRIBUTES
|
||||
|
||||
} tty_attrib ;
|
||||
|
||||
/*
|
||||
* Character returned by end-of-file condition
|
||||
*/
|
||||
# define TTY_EOF -1
|
||||
|
||||
|
||||
/*
|
||||
* Create the window according to a resource WIND template.
|
||||
* The window pointer pointed to by window should be NULL to
|
||||
* allocate the window record dynamically, or point to a
|
||||
* WindowRecord structure already allocated.
|
||||
*
|
||||
* Passing in_color means you have to be sure there's color support;
|
||||
* on the Mac, this means 32bit QuickDraw present, else it will
|
||||
* crash. Not passing in_color means everything's rendered in
|
||||
* black & white.
|
||||
*/
|
||||
extern short create_tty ( WindowPtr * window , short resource_id ,
|
||||
Boolean in_color ) ;
|
||||
|
||||
/*
|
||||
* Use init_tty_name or init_tty_number to initialize a window
|
||||
* once allocated by create_tty. Size parameters are in characters.
|
||||
*/
|
||||
|
||||
extern short init_tty_number ( WindowPtr window , short font_number ,
|
||||
short font_size , short x_size , short y_size ) ;
|
||||
|
||||
/*
|
||||
* Close and deallocate a window and its data
|
||||
*/
|
||||
extern short destroy_tty ( WindowPtr window ) ;
|
||||
|
||||
/*
|
||||
* Change the font and font size used in the window for drawing after
|
||||
* the calls are made. To change the coordinate system, be sure to call
|
||||
* force_tty_coordinate_system_recalc() - else it may look strange if
|
||||
* the new font doesn't match the old one.
|
||||
*/
|
||||
extern short set_tty_font_name (winid window_type , char * name ) ;
|
||||
extern short force_tty_coordinate_system_recalc ( WindowPtr window ) ;
|
||||
|
||||
/*
|
||||
* Getting some metrics about the tty and its drawing.
|
||||
*/
|
||||
extern short get_tty_metrics ( WindowPtr window , short * x_size ,
|
||||
short * y_size , short * x_size_pixels , short * y_size_pixels ,
|
||||
short * font_number , short * font_size ,
|
||||
short * char_width , short * row_height ) ;
|
||||
|
||||
/*
|
||||
* The basic move cursor function. 0,0 is topleft.
|
||||
*/
|
||||
extern short move_tty_cursor ( WindowPtr window , short x_pos ,
|
||||
short y_pos ) ;
|
||||
|
||||
/*
|
||||
* Flush all changes done to a tty to the screen (see TA_ALWAYS_UPDATE above)
|
||||
*/
|
||||
extern short update_tty ( WindowPtr window ) ;
|
||||
|
||||
/*
|
||||
* Add a character to the tty and update the cursor position
|
||||
*/
|
||||
extern short add_tty_char ( WindowPtr window , short character ) ;
|
||||
|
||||
/*
|
||||
* Add a string of characters to the tty and update the cursor
|
||||
* position. The string is 0-terminated!
|
||||
*/
|
||||
extern short add_tty_string ( WindowPtr window , const char * string ) ;
|
||||
|
||||
/*
|
||||
* Change or read an attribute of the tty. Note that some attribute changes
|
||||
* may clear the screen. See the above enum and defines for values.
|
||||
* Attributes can be both function pointers and special flag values.
|
||||
*/
|
||||
extern short get_tty_attrib ( WindowPtr window , tty_attrib attrib ,
|
||||
long * value ) ;
|
||||
extern short set_tty_attrib ( WindowPtr window , tty_attrib attrib ,
|
||||
long value ) ;
|
||||
|
||||
/*
|
||||
* Scroll the actual TTY image, in characters, positive means up/left
|
||||
* scroll_tty ( my_tty , 0 , 1 ) means a linefeed. Is always carried out
|
||||
* directly, regardless of the wait-update setting. Does updates before
|
||||
* scrolling.
|
||||
*/
|
||||
extern short scroll_tty ( WindowPtr window , short delta_x ,
|
||||
short delta_y ) ;
|
||||
|
||||
/*
|
||||
* Erase the offscreen bitmap and move the cursor to 0,0. Re-init some window
|
||||
* values (font etc) Is always carried out directly on-screen, regardless of
|
||||
* the wait-for-update setting. Clears update area.
|
||||
*/
|
||||
extern short clear_tty ( WindowPtr window ) ;
|
||||
|
||||
/*
|
||||
* Call this routine with a window (always _mt_window) and a time (usually
|
||||
* from most recent event) to determine if cursor in window should be blinked
|
||||
*/
|
||||
extern short blink_cursor ( WindowPtr window , long when ) ;
|
||||
|
||||
/*
|
||||
* For screen dumps, open the printer port and call this function. Can be used
|
||||
* for clipboard as well (only for a PICT, though; this library doesn't concern
|
||||
* itself with characters, just bitmaps)
|
||||
*/
|
||||
extern short image_tty ( EventRecord *theEvent, WindowPtr window ) ;
|
||||
|
||||
/*
|
||||
* For erasing just an area of characters
|
||||
*/
|
||||
extern short clear_tty_window ( WindowPtr window , short from_row ,
|
||||
short from_col , short to_row , short to_col ) ;
|
||||
|
||||
/*
|
||||
* get and set the invalid region of the main window
|
||||
*/
|
||||
extern short get_invalid_region (WindowPtr window, Rect *inval_rect);
|
||||
extern short set_invalid_region (WindowPtr window, Rect *inval_rect);
|
||||
|
||||
/*
|
||||
* Now in macsnd.c, which seemed like a good place
|
||||
*/
|
||||
extern void tty_nhbell ();
|
||||
|
||||
#if EXTENDED_SUPPORT
|
||||
|
||||
/*
|
||||
* Various versions of delete character/s, insert line/s etc can be handled by
|
||||
* this general-purpose function. Negative num_ means delete, positive means
|
||||
* insert, and you can never be sure which of row and col operations come first
|
||||
* if you specify both...
|
||||
*/
|
||||
extern short mangle_tty_rows_columns ( WindowPtr window ,
|
||||
short from_row , short num_rows , short from_col , short num_cols ) ;
|
||||
|
||||
/*
|
||||
* For framing an area without using grahpics characters.
|
||||
* Note that the given limits are those used for framing, you should not
|
||||
* draw in them. frame_fatness should typically be 1-5, and may be clipped
|
||||
* if it is too large.
|
||||
*/
|
||||
extern short frame_tty_window ( WindowPtr window , short from_row ,
|
||||
short from_col , short to_row , short to_col , short frame_fatness ) ;
|
||||
|
||||
/*
|
||||
* For inverting specific characters after the fact. May look funny in color.
|
||||
*/
|
||||
extern short invert_tty_window ( WindowPtr window , short from_row ,
|
||||
short from_col , short to_row , short to_col ) ;
|
||||
|
||||
/*
|
||||
* For drawing lines on the tty - VERY DEVICE DEPENDENT. Use get_tty_metrics.
|
||||
*/
|
||||
extern short draw_tty_line ( WindowPtr window , short from_x ,
|
||||
short from_y , short to_x , short to_y ) ;
|
||||
|
||||
#endif /* EXTENDED_SUPPORT */
|
||||
|
||||
#endif /* _H_tty_public */
|
246
include/macwin.h
246
include/macwin.h
|
@ -1,246 +0,0 @@
|
|||
/* SCCS Id: @(#)macwin.h 3.4 1996/01/15 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef MACWIN_H
|
||||
# define MACWIN_H
|
||||
#undef red /* undef internal color const strings from decl */
|
||||
#undef green
|
||||
#undef blue
|
||||
|
||||
#ifndef __MACH__
|
||||
#include <windows.h>
|
||||
#include <dialogs.h>
|
||||
#endif
|
||||
|
||||
/* more headers */
|
||||
#ifdef THINK_C
|
||||
#include <pascal.h> /* for CtoPStr and PtoCStr */
|
||||
#endif
|
||||
|
||||
/* resources */
|
||||
#define PLAYER_NAME_RES_ID 1001
|
||||
|
||||
/* fake some things if we don't have universal headers.. */
|
||||
#if 0 /*ndef NewUserItemProc*/
|
||||
typedef pascal void (*UserItemProcPtr)(WindowPtr theWindow, short itemNo);
|
||||
typedef UserItemProcPtr UserItemUPP;
|
||||
#define NewUserItemProc(p) (UserItemUPP)(p)
|
||||
|
||||
typedef pascal void (*ControlActionProcPtr)(ControlHandle theControl, short partCode);
|
||||
typedef ControlActionProcPtr ControlActionUPP;
|
||||
#define NewControlActionProc(p) (ControlActionUPP)(p)
|
||||
|
||||
typedef ModalFilterProcPtr ModalFilterUPP;
|
||||
#define DisposeRoutineDescriptor(p)
|
||||
#endif
|
||||
|
||||
/* misc */
|
||||
#ifdef __MWERKS__
|
||||
# define ResumeProcPtr long /* for call to InitDialogs */
|
||||
#endif
|
||||
|
||||
/* working dirs structure */
|
||||
typedef struct macdirs {
|
||||
Str32 dataName;
|
||||
short dataRefNum;
|
||||
long dataDirID;
|
||||
|
||||
Str32 saveName;
|
||||
short saveRefNum;
|
||||
long saveDirID;
|
||||
|
||||
Str32 levelName;
|
||||
short levelRefNum;
|
||||
long levelDirID;
|
||||
} MacDirs;
|
||||
|
||||
typedef struct macflags {
|
||||
Bitfield (processes, 1);
|
||||
Bitfield (color, 1);
|
||||
Bitfield (folders, 1);
|
||||
Bitfield (tempMem, 1);
|
||||
Bitfield (help, 1);
|
||||
Bitfield (fsSpec, 1);
|
||||
Bitfield (trueType, 1);
|
||||
Bitfield (aux, 1);
|
||||
Bitfield (alias, 1);
|
||||
Bitfield (standardFile, 1);
|
||||
Bitfield (hasDebugger, 1);
|
||||
Bitfield (hasAE, 1);
|
||||
Bitfield (gotOpen, 1);
|
||||
} MacFlags;
|
||||
|
||||
extern MacDirs theDirs; /* used in macfile.c */
|
||||
extern MacFlags macFlags;
|
||||
|
||||
/*
|
||||
* Mac windows
|
||||
*/
|
||||
#define NUM_MACWINDOWS 15
|
||||
#define TEXT_BLOCK 512L
|
||||
|
||||
/* Window constants */
|
||||
#define kMapWindow 0
|
||||
#define kStatusWindow 1
|
||||
#define kMessageWindow 2
|
||||
#define kTextWindow 3
|
||||
#define kMenuWindow 4
|
||||
#define kLastWindowKind kMenuWindow
|
||||
|
||||
/*
|
||||
* This determines the minimum logical line length in text windows
|
||||
* That is; even if physical width is less, this is where line breaks
|
||||
* go at the minimum. 350 is about right for score lines with a
|
||||
* geneva 10 pt font.
|
||||
*/
|
||||
#define MIN_RIGHT 350
|
||||
|
||||
typedef struct {
|
||||
anything id;
|
||||
char accelerator;
|
||||
char groupAcc;
|
||||
short line;
|
||||
} MacMHMenuItem;
|
||||
|
||||
typedef struct NhWindow {
|
||||
WindowPtr its_window;
|
||||
|
||||
short font_number;
|
||||
short font_size;
|
||||
short char_width;
|
||||
short row_height;
|
||||
short ascent_height;
|
||||
|
||||
short x_size;
|
||||
short y_size;
|
||||
short x_curs;
|
||||
short y_curs;
|
||||
|
||||
short last_more_lin; /* Used by message window */
|
||||
short save_lin; /* Used by message window */
|
||||
|
||||
short miSize; /* size of menu items arrays */
|
||||
short miLen; /* number of menu items in array */
|
||||
MacMHMenuItem **menuInfo; /* Used by menus (array handle) */
|
||||
char menuChar; /* next menu accelerator to use */
|
||||
short **menuSelected; /* list of selected elements from list */
|
||||
short miSelLen; /* number of items selected */
|
||||
short how; /* menu mode */
|
||||
|
||||
char drawn;
|
||||
Handle windowText;
|
||||
long windowTextLen;
|
||||
short scrollPos;
|
||||
ControlHandle scrollBar;
|
||||
} NhWindow;
|
||||
|
||||
extern Boolean CheckNhWin(WindowPtr mac_win);
|
||||
|
||||
|
||||
#define NUM_STAT_ROWS 2
|
||||
#define NUM_ROWS 22
|
||||
#define NUM_COLS 80 /* We shouldn't use column 0 */
|
||||
#define QUEUE_LEN 24
|
||||
|
||||
extern NhWindow * theWindows;
|
||||
|
||||
extern struct window_procs mac_procs;
|
||||
|
||||
#define NHW_BASE 0
|
||||
extern winid BASE_WINDOW, WIN_MAP, WIN_MESSAGE, WIN_INVEN, WIN_STATUS;
|
||||
|
||||
|
||||
/*
|
||||
* External declarations for the window routines.
|
||||
*/
|
||||
|
||||
#define E extern
|
||||
|
||||
/* ### dprintf.c ### */
|
||||
|
||||
extern void dprintf (char *, ...);
|
||||
|
||||
/* ### maccurs.c ### */
|
||||
|
||||
extern Boolean RetrievePosition (short, short *, short *);
|
||||
extern Boolean RetrieveSize (short, short, short, short *, short *);
|
||||
extern void SaveWindowPos (WindowPtr);
|
||||
extern void SaveWindowSize (WindowPtr);
|
||||
extern Boolean FDECL(RetrieveWinPos, (WindowPtr,short *,short *));
|
||||
|
||||
/* ### macerrs.c ### */
|
||||
|
||||
extern void showerror(char *,const char *);
|
||||
extern Boolean itworked(short);
|
||||
extern void mustwork(short);
|
||||
extern void attemptingto(char *);
|
||||
/* appear to be unused
|
||||
extern void comment(char *,long);
|
||||
extern void pushattemptingto(char *);
|
||||
extern void popattempt(void);
|
||||
*/
|
||||
/* ### macfile.c ### */
|
||||
|
||||
/* extern char *macgets(int fd, char *ptr, unsigned len); unused */
|
||||
extern void FDECL(C2P,(const char *c, unsigned char *p));
|
||||
extern void FDECL(P2C,(const unsigned char *p, char *c));
|
||||
|
||||
/* ### macmenu.c ### */
|
||||
|
||||
extern void DoMenuEvt (long);
|
||||
extern void InitMenuRes(void);
|
||||
extern void AdjustMenus(short);
|
||||
#define DimMenuBar() AdjustMenus(1)
|
||||
#define UndimMenuBar() AdjustMenus(0)
|
||||
|
||||
/* ### macmain.c ### */
|
||||
|
||||
extern void FDECL (process_openfile, (short s_vol, long s_dir, Str255 fNm, OSType ft));
|
||||
|
||||
/* ### macwin.c ### */
|
||||
|
||||
extern void AddToKeyQueue(unsigned char, Boolean);
|
||||
extern unsigned char GetFromKeyQueue (void);
|
||||
void trans_num_keys (EventRecord *);
|
||||
extern void NDECL (InitMac);
|
||||
int FDECL (try_key_queue, (char *));
|
||||
void FDECL (enter_topl_mode, (char *));
|
||||
void FDECL (leave_topl_mode, (char *));
|
||||
void FDECL (topl_set_resp, (char *, char));
|
||||
Boolean FDECL (topl_key, (unsigned char, Boolean));
|
||||
E void FDECL(HandleEvent, (EventRecord *)); /* used in mmodal.c */
|
||||
extern void NDECL(port_help);
|
||||
|
||||
extern Boolean small_screen;
|
||||
|
||||
E void FDECL(mac_init_nhwindows, (int *, char **));
|
||||
E void NDECL(mac_askname);
|
||||
E void NDECL(mac_get_nh_event);
|
||||
E void FDECL(mac_exit_nhwindows, (const char *));
|
||||
E winid FDECL(mac_create_nhwindow, (int));
|
||||
E void FDECL(mac_clear_nhwindow, (winid));
|
||||
E void FDECL(mac_display_nhwindow, (winid, BOOLEAN_P));
|
||||
E void FDECL(mac_destroy_nhwindow, (winid));
|
||||
E void FDECL(mac_curs, (winid,int,int));
|
||||
E void FDECL(mac_putstr, (winid, int, const char *));
|
||||
E void FDECL(mac_start_menu, (winid));
|
||||
E void FDECL(mac_add_menu, (winid,int,const anything *,
|
||||
CHAR_P,CHAR_P,int,const char *, BOOLEAN_P));
|
||||
E void FDECL(mac_end_menu, (winid, const char *));
|
||||
E int FDECL(mac_select_menu, (winid, int, menu_item **));
|
||||
#ifdef CLIPPING
|
||||
E void FDECL(mac_cliparound, (int, int));
|
||||
#endif
|
||||
E int NDECL(mac_nhgetch);
|
||||
E int FDECL(mac_nh_poskey, (int *, int *, int *));
|
||||
E int NDECL(mac_doprev_message);
|
||||
E char FDECL(mac_yn_function, (const char *, const char *, CHAR_P));
|
||||
E void FDECL(mac_getlin, (const char *,char *));
|
||||
E int NDECL(mac_get_ext_cmd);
|
||||
E void FDECL(mac_number_pad, (int));
|
||||
E void FDECL(mac_delay_output, (int));
|
||||
|
||||
#undef E
|
||||
|
||||
#endif /* ! MACWIN_H */
|
|
@ -1,21 +0,0 @@
|
|||
/* SCCS Id: @(#)micro.h 3.4 1990/02/22 */
|
||||
/* micro.h - function declarations for various microcomputers */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef MICRO_H
|
||||
#define MICRO_H
|
||||
|
||||
extern const char *alllevels, *allbones;
|
||||
extern char levels[], bones[], permbones[], hackdir[];
|
||||
|
||||
extern int ramdisk;
|
||||
|
||||
#ifndef C
|
||||
#define C(c) (0x1f & (c))
|
||||
#endif
|
||||
#ifndef M
|
||||
#define M(c) (((char)0x80) | (c))
|
||||
#endif
|
||||
#define ABORT C('a')
|
||||
|
||||
#endif /* MICRO_H */
|
|
@ -1,60 +0,0 @@
|
|||
/* SCCS Id: @(#)mttypriv.h 3.4 1993/03/01 */
|
||||
/* Copyright (c) Jon W{tte 1993. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/*
|
||||
* This file contains private structures used to implement the
|
||||
* tty windows - note that these structures may change between
|
||||
* minor releases!
|
||||
*/
|
||||
|
||||
#ifndef _H_tty_private
|
||||
# define _H_tty_private
|
||||
|
||||
# ifndef _H_tty_public
|
||||
#include "mactty.h"
|
||||
# endif
|
||||
|
||||
#if !TARGET_API_MAC_CARBON
|
||||
# include <QDOffscreen.h>
|
||||
# include <Gestalt.h>
|
||||
# include <Errors.h>
|
||||
#endif
|
||||
|
||||
#define TA_TO_RGB(ta,rgb) (((rgb).red=(((ta)>>16)&0xff)*257),((rgb).green=(((ta)>>8)&0xff)*257),\
|
||||
((rgb).blue=((ta)&0xff)*257)),rgb
|
||||
|
||||
typedef struct tty_record {
|
||||
WindowPtr its_window ;
|
||||
|
||||
short font_number ;
|
||||
short font_size ;
|
||||
short char_width ;
|
||||
short row_height ;
|
||||
short ascent_height ;
|
||||
|
||||
short x_size ;
|
||||
short y_size ;
|
||||
short x_curs ;
|
||||
short y_curs ;
|
||||
|
||||
GWorldPtr its_window_world ;
|
||||
BitMap its_bits ;
|
||||
GrafPtr offscreen_port ;
|
||||
GWorldPtr offscreen_world ;
|
||||
#if CLIP_RECT_ONLY
|
||||
Rect invalid_rect ;
|
||||
#else
|
||||
RgnHandle invalid_part ;
|
||||
#endif
|
||||
|
||||
long attribute [ TTY_NUMBER_ATTRIBUTES ] ;
|
||||
long last_cursor ;
|
||||
|
||||
Boolean was_allocated ;
|
||||
Boolean curs_state ;
|
||||
Boolean uses_gworld ;
|
||||
} tty_record ;
|
||||
|
||||
|
||||
#endif /* _H_tty_private */
|
200
include/ntconf.h
200
include/ntconf.h
|
@ -1,200 +0,0 @@
|
|||
/* SCCS Id: @(#)ntconf.h 3.4 2002/03/10 */
|
||||
/* Copyright (c) NetHack PC Development Team 1993, 1994. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef NTCONF_H
|
||||
#define NTCONF_H
|
||||
|
||||
/* #define SHELL /* nt use of pcsys routines caused a hang */
|
||||
|
||||
#define RANDOM /* have Berkeley random(3) */
|
||||
#define TEXTCOLOR /* Color text */
|
||||
|
||||
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
|
||||
#define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */
|
||||
#ifdef WIN32CON
|
||||
#define LAN_FEATURES /* Include code for lan-aware features. Untested in 3.4.0*/
|
||||
#endif
|
||||
|
||||
#define PC_LOCKING /* Prevent overwrites of aborted or in-progress games */
|
||||
/* without first receiving confirmation. */
|
||||
|
||||
#define HOLD_LOCKFILE_OPEN /* Keep an exclusive lock on the .0 file */
|
||||
|
||||
#define SELF_RECOVER /* Allow the game itself to recover from an aborted game */
|
||||
|
||||
#define USER_SOUNDS
|
||||
/*
|
||||
* -----------------------------------------------------------------
|
||||
* The remaining code shouldn't need modification.
|
||||
* -----------------------------------------------------------------
|
||||
*/
|
||||
/* #define SHORT_FILENAMES /* All NT filesystems support long names now */
|
||||
|
||||
#ifdef MICRO
|
||||
#undef MICRO /* never define this! */
|
||||
#endif
|
||||
|
||||
#define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that
|
||||
it is defined for WIN32.
|
||||
Allow paths to be specified for HACKDIR,
|
||||
LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
|
||||
SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
|
||||
#define NO_TERMS
|
||||
#define ASCIIGRAPH
|
||||
|
||||
#ifdef OPTIONS_USED
|
||||
#undef OPTIONS_USED
|
||||
#endif
|
||||
#ifdef MSWIN_GRAPHICS
|
||||
#define OPTIONS_USED "guioptions"
|
||||
#else
|
||||
#define OPTIONS_USED "ttyoptions"
|
||||
#endif
|
||||
#define OPTIONS_FILE OPTIONS_USED
|
||||
|
||||
#define PORT_HELP "porthelp"
|
||||
|
||||
#ifdef WIN32CON
|
||||
#define PORT_DEBUG /* include ability to debug international keyboard issues */
|
||||
#endif
|
||||
|
||||
/* Stuff to help the user with some common, yet significant errors */
|
||||
#define INTERJECT_PANIC 0
|
||||
#define INTERJECTION_TYPES (INTERJECT_PANIC + 1)
|
||||
extern void FDECL(interject_assistance, (int,int,genericptr_t,genericptr_t));
|
||||
extern void FDECL(interject, (int));
|
||||
|
||||
/* The following is needed for prototypes of certain functions */
|
||||
#if defined(_MSC_VER)
|
||||
#include <process.h> /* Provides prototypes of exit(), spawn() */
|
||||
#endif
|
||||
|
||||
#include <string.h> /* Provides prototypes of strncmpi(), etc. */
|
||||
#ifdef STRNCMPI
|
||||
#define strncmpi(a,b,c) strnicmp(a,b,c)
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef __BORLANDC__
|
||||
#undef randomize
|
||||
#undef random
|
||||
#endif
|
||||
|
||||
#define PATHLEN BUFSZ /* maximum pathlength */
|
||||
#define FILENAME BUFSZ /* maximum filename length (conservative) */
|
||||
|
||||
#if defined(_MAX_PATH) && defined(_MAX_FNAME)
|
||||
# if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
|
||||
#undef PATHLEN
|
||||
#undef FILENAME
|
||||
#define PATHLEN _MAX_PATH
|
||||
#define FILENAME _MAX_FNAME
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define NO_SIGNAL
|
||||
#define index strchr
|
||||
#define rindex strrchr
|
||||
#include <time.h>
|
||||
#define USE_STDARG
|
||||
#ifdef RANDOM
|
||||
/* Use the high quality random number routines. */
|
||||
#define Rand() random()
|
||||
#else
|
||||
#define Rand() rand()
|
||||
#endif
|
||||
|
||||
#define FCMASK 0660 /* file creation mask */
|
||||
#define regularize nt_regularize
|
||||
#define HLOCK "NHPERM"
|
||||
|
||||
#ifndef M
|
||||
#define M(c) ((char) (0x80 | (c)))
|
||||
/* #define M(c) ((c) - 128) */
|
||||
#endif
|
||||
|
||||
#ifndef C
|
||||
#define C(c) (0x1f & (c))
|
||||
#endif
|
||||
|
||||
#if defined(DLB)
|
||||
#define FILENAME_CMP stricmp /* case insensitive */
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
extern char levels[], bones[], permbones[],
|
||||
#endif /* 0 */
|
||||
|
||||
/* this was part of the MICRO stuff in the past */
|
||||
extern const char *alllevels, *allbones;
|
||||
extern char hackdir[];
|
||||
#define ABORT C('a')
|
||||
#define getuid() 1
|
||||
#define getlogin() ((char *)0)
|
||||
extern void NDECL(win32_abort);
|
||||
#ifdef WIN32CON
|
||||
extern void FDECL(nttty_preference_update, (const char *));
|
||||
extern void NDECL(toggle_mouse_support);
|
||||
extern void FDECL(map_subkeyvalue, (char *));
|
||||
extern void NDECL(load_keyboard_handler);
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
#ifndef __BORLANDC__
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#else
|
||||
int _RTLENTRY _EXPFUNC access (const char _FAR *__path, int __amode);
|
||||
int _RTLENTRY _EXPFUNC _chdrive(int __drive);
|
||||
int _RTLENTRYF _EXPFUNC32 chdir( const char _FAR *__path );
|
||||
char _FAR * _RTLENTRY _EXPFUNC getcwd( char _FAR *__buf, int __buflen );
|
||||
int _RTLENTRY _EXPFUNC write (int __handle, const void _FAR *__buf, unsigned __len);
|
||||
int _RTLENTRY _EXPFUNC creat (const char _FAR *__path, int __amode);
|
||||
int _RTLENTRY _EXPFUNC close (int __handle);
|
||||
int _RTLENTRY _EXPFUNC _close (int __handle);
|
||||
int _RTLENTRY _EXPFUNC 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>
|
||||
#undef kbhit /* Use our special NT kbhit */
|
||||
#define kbhit (*nt_kbhit)
|
||||
|
||||
#ifdef LAN_FEATURES
|
||||
#define MAX_LAN_USERNAME 20
|
||||
#define LAN_RO_PLAYGROUND /* not implemented in 3.3.0 */
|
||||
#define LAN_SHARED_BONES /* not implemented in 3.3.0 */
|
||||
#include "nhlan.h"
|
||||
#endif
|
||||
|
||||
#ifndef alloca
|
||||
#define ALLOCA_HACK /* used in util/panic.c */
|
||||
#endif
|
||||
|
||||
#ifndef REDO
|
||||
#undef Getchar
|
||||
#define Getchar nhgetch
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if 0
|
||||
#pragma warning(disable:4018) /* signed/unsigned mismatch */
|
||||
#pragma warning(disable:4305) /* init, conv from 'const int' to 'char' */
|
||||
#endif
|
||||
#pragma warning(disable:4761) /* integral size mismatch in arg; conv supp*/
|
||||
#ifdef YYPREFIX
|
||||
#pragma warning(disable:4102) /* unreferenced label */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int FDECL(set_win32_option, (const char *, const char *));
|
||||
#ifdef WIN32CON
|
||||
#define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED
|
||||
#define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
|
||||
#define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED
|
||||
#define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
|
||||
#endif /* WIN32CON */
|
||||
|
||||
#endif /* NTCONF_H */
|
|
@ -1,107 +0,0 @@
|
|||
/* SCCS Id: @(#)os2conf.h 3.4 1996/10/29 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993, 1996. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifdef OS2
|
||||
#ifndef OS2CONF_H
|
||||
#define OS2CONF_H
|
||||
|
||||
/*
|
||||
* Compiler configuration. Compiler may be
|
||||
* selected either here or in Makefile.os2.
|
||||
*/
|
||||
|
||||
/* #define OS2_MSC /* Microsoft C 5.1 and 6.0 */
|
||||
#define OS2_GCC /* GCC emx 0.8f */
|
||||
/* #define OS2_CSET2 /* IBM C Set/2 (courtesy Jeff Urlwin) */
|
||||
/* #define OS2_CSET2_VER_1 /* CSet/2 version selection */
|
||||
/* #define OS2_CSET2_VER_2 /* - " - */
|
||||
|
||||
/*
|
||||
* System configuration.
|
||||
*/
|
||||
|
||||
#define OS2_USESYSHEADERS /* use compiler's own system headers */
|
||||
/* #define OS2_HPFS /* use OS/2 High Performance File System */
|
||||
|
||||
#if defined(OS2_GCC) || defined(OS2_CSET2)
|
||||
# define OS2_32BITAPI /* enable for compilation in OS/2 2.0 */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Other configurable options. Generally no
|
||||
* reason to touch the defaults, I think.
|
||||
*/
|
||||
|
||||
/*#define MFLOPPY /* floppy and ramdisk support */
|
||||
#define RANDOM /* Berkeley random(3) */
|
||||
#define SHELL /* shell escape */
|
||||
/* #define TERMLIB /* use termcap file */
|
||||
#define ANSI_DEFAULT /* allows NetHack to run without termcap file */
|
||||
#define TEXTCOLOR /* allow color */
|
||||
|
||||
/*
|
||||
* The remaining code shouldn't need modification.
|
||||
*/
|
||||
|
||||
#ifdef MSDOS
|
||||
# undef MSDOS /* MSC autodefines this but we don't want it */
|
||||
#endif
|
||||
|
||||
#ifndef MICRO
|
||||
# define MICRO /* must be defined to allow some inclusions */
|
||||
#endif
|
||||
|
||||
#if !defined(TERMLIB) && !defined(ANSI_DEFAULT)
|
||||
# define ANSI_DEFAULT /* have to have one or the other */
|
||||
#endif
|
||||
|
||||
#define PATHLEN 260 /* maximum pathlength (HPFS) */
|
||||
#define FILENAME 260 /* maximum filename length (HPFS) */
|
||||
#ifndef MICRO_H
|
||||
#include "micro.h" /* necessary externs for [os_name].c */
|
||||
#endif
|
||||
|
||||
#ifndef SYSTEM_H
|
||||
#include "system.h"
|
||||
#endif
|
||||
|
||||
#ifndef index
|
||||
#define index strchr
|
||||
#endif
|
||||
#ifndef rindex
|
||||
#define rindex strrchr
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
/* the high quality random number routines */
|
||||
|
||||
#ifdef RANDOM
|
||||
# define Rand() random()
|
||||
#else
|
||||
# define Rand() rand()
|
||||
#endif
|
||||
|
||||
/* file creation mask */
|
||||
|
||||
#include <sys\types.h>
|
||||
#include <sys\stat.h>
|
||||
|
||||
#define FCMASK (S_IREAD | S_IWRITE)
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef __EMX__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef REDO
|
||||
# undef Getchar
|
||||
# define Getchar nhgetch
|
||||
#endif
|
||||
|
||||
void hangup(int i);
|
||||
#endif /* OS2CONF_H */
|
||||
#endif /* OS2 */
|
338
include/pcconf.h
338
include/pcconf.h
|
@ -1,338 +0,0 @@
|
|||
/* SCCS Id: @(#)pcconf.h 3.4 1995/10/11 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef PCCONF_H
|
||||
#define PCCONF_H
|
||||
|
||||
#define MICRO /* always define this! */
|
||||
|
||||
#ifdef MSDOS /* some of this material is MS-DOS specific */
|
||||
|
||||
/*
|
||||
* Automatic Defines:
|
||||
*
|
||||
* __GO32__ is defined automatically by the djgpp port of gcc.
|
||||
* __DJGPP__ is defined automatically by djgpp version 2 and above.
|
||||
* _MSC_VER is defined automatically by Microsoft C.
|
||||
* __BORLANDC__ is defined automatically by Borland C.
|
||||
* __SC__ is defined automatically by Symantec C.
|
||||
* Note: 3.4.1 was not verified with Symantec C.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following options are somewhat configurable depending on
|
||||
* your compiler.
|
||||
*/
|
||||
|
||||
/*
|
||||
* For pre-V7.0 Microsoft Compilers only, manually define OVERLAY here.
|
||||
*/
|
||||
|
||||
/*#define OVERLAY */ /* Manual overlay definition (MSC 6.0ax only) */
|
||||
|
||||
# ifndef __GO32__
|
||||
#define MFLOPPY /* Support for floppy drives and ramdisks by dgk */
|
||||
# endif
|
||||
|
||||
# define SHELL /* via exec of COMMAND.COM */
|
||||
|
||||
# ifdef __BORLANDC__
|
||||
#define PCMUSIC /* Music option, enable very basic pc speaker music notes */
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Screen control options
|
||||
*
|
||||
* You may uncomment:
|
||||
* ANSI_DEFAULT
|
||||
* or TERMLIB
|
||||
* or ANSI_DEFAULT and TERMLIB
|
||||
* or NO_TERMS
|
||||
*/
|
||||
|
||||
/* # define TERMLIB */ /* enable use of termcap file /etc/termcap */
|
||||
/* or ./termcap for MSDOS (SAC) */
|
||||
/* compile and link in Fred Fish's termcap library, */
|
||||
/* enclosed in TERMCAP.ARC, to use this */
|
||||
|
||||
/* # define ANSI_DEFAULT */ /* allows NetHack to run without a ./termcap */
|
||||
|
||||
# define NO_TERMS /* Allows Nethack to run without ansi.sys by linking */
|
||||
/* screen routines into the .exe */
|
||||
|
||||
# ifdef NO_TERMS /* if NO_TERMS select one screen package below */
|
||||
#define SCREEN_BIOS /* Use bios calls for all screen control */
|
||||
/* #define SCREEN_DJGPPFAST */ /* Use djgpp fast screen routines */
|
||||
# endif
|
||||
|
||||
|
||||
/* # define PC9800 */ /* Allows NetHack to run on NEC PC-9800 machines */
|
||||
/* Yamamoto Keizo */
|
||||
|
||||
|
||||
/*
|
||||
* PC video hardware support options (for graphical tile support)
|
||||
*
|
||||
* You may uncomment any/all of the options below.
|
||||
*
|
||||
*/
|
||||
# ifndef SUPPRESS_GRAPHICS
|
||||
# if (defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST)) && !defined(PC9800)
|
||||
# ifdef USE_TILES
|
||||
#define SCREEN_VGA /* Include VGA graphics routines in the build */
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# undef NO_TERMS
|
||||
# undef SCREEN_BIOS
|
||||
# undef SCREEN_DJGPPFAST
|
||||
# undef SCREEN_VGA
|
||||
# undef TERMLIB
|
||||
# define ANSI_DEFAULT
|
||||
# endif
|
||||
|
||||
# define RANDOM /* have Berkeley random(3) */
|
||||
|
||||
# define MAIL /* Allows for fake mail daemon to deliver mail */
|
||||
/* in the MSDOS version. (For AMIGA MAIL see */
|
||||
/* amiconf.h). In the future this will be the */
|
||||
/* hook for mail reader implementation. */
|
||||
|
||||
/* The following is needed for prototypes of certain functions */
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
|
||||
#include <process.h> /* Provides prototypes of exit(), spawn() */
|
||||
#endif
|
||||
|
||||
#if defined(__BORLANDC__) && defined(STRNCMPI)
|
||||
#include <string.h> /* Provides prototypes of strncmpi(), etc. */
|
||||
#endif
|
||||
|
||||
#if defined(__DJGPP__)
|
||||
#define _NAIVE_DOS_REGS
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* Provides prototypes of strncmpi(), etc. */
|
||||
# ifndef M
|
||||
#define M(c) ((char) (0x80 | (c)))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* On the VMS and unix, this option controls whether a delay is done by
|
||||
* the clock, or whether it is done by excess output. On the PC, however,
|
||||
* there is always a clock to use for the delay. The TIMED_DELAY option
|
||||
* on MSDOS (without the termcap routines) is used to determine whether to
|
||||
* include the delay routines in the code (and thus, provides a compile time
|
||||
* method to turn off napping for visual effect). However, it is also used
|
||||
* in the music code to wait between different notes. So it is needed in that
|
||||
* case as well.
|
||||
|
||||
* Whereas on the VMS and unix, flags.nap is a run-time option controlling
|
||||
* whether there is a delay by clock or by excess output, on MSDOS it is
|
||||
* simply a flag to turn on or off napping for visual effects at run-time.
|
||||
*/
|
||||
|
||||
#define TIMED_DELAY /* enable the `timed_delay' run-time option */
|
||||
|
||||
# ifdef PCMUSIC
|
||||
#define TIMED_DELAY /* need it anyway */
|
||||
# endif
|
||||
#define NOCWD_ASSUMPTIONS /* Allow paths to be specified for HACKDIR,
|
||||
LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
|
||||
SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR. */
|
||||
|
||||
#endif /* MSDOS configuration stuff */
|
||||
|
||||
#define PATHLEN 64 /* maximum pathlength */
|
||||
#define FILENAME 80 /* maximum filename length (conservative) */
|
||||
#ifndef MICRO_H
|
||||
#include "micro.h" /* contains necessary externs for [os_name].c */
|
||||
#endif
|
||||
|
||||
|
||||
/* ===================================================
|
||||
* The remaining code shouldn't need modification.
|
||||
*/
|
||||
|
||||
#ifndef SYSTEM_H
|
||||
#include "system.h"
|
||||
#endif
|
||||
|
||||
#ifdef __DJGPP__
|
||||
#include <unistd.h> /* close(), etc. */
|
||||
/* lock() in io.h interferes with lock[] in decl.h */
|
||||
#define lock djlock
|
||||
#include <io.h>
|
||||
#undef lock
|
||||
#include <pc.h> /* kbhit() */
|
||||
#define PC_LOCKING
|
||||
#define HOLD_LOCKFILE_OPEN
|
||||
#define SELF_RECOVER /* NetHack itself can recover games */
|
||||
#endif
|
||||
|
||||
# ifdef MSDOS
|
||||
# ifndef EXEPATH
|
||||
#define EXEPATH /* HACKDIR is .exe location if not explicitly defined */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined(_MSC_VER) && defined(MSDOS)
|
||||
# if (_MSC_VER >= 700) && !defined(FUNCTION_LEVEL_LINKING)
|
||||
# ifndef MOVERLAY
|
||||
#define MOVERLAY /* Microsoft's MOVE overlay system (MSC >= 7.0) */
|
||||
# endif
|
||||
# endif
|
||||
#define PC_LOCKING
|
||||
# endif
|
||||
|
||||
/* Borland Stuff */
|
||||
# if defined(__BORLANDC__)
|
||||
# if defined(__OVERLAY__) && !defined(VROOMM)
|
||||
/* __OVERLAY__ is automatically defined by Borland C if overlay option is on */
|
||||
#define VROOMM /* Borland's VROOMM overlay system */
|
||||
# endif
|
||||
# if !defined(STKSIZ)
|
||||
#define STKSIZ 5*1024 /* Use a default of 5K stack for Borland C */
|
||||
/* This macro is used in any file that contains */
|
||||
/* a main() function. */
|
||||
# endif
|
||||
#define PC_LOCKING
|
||||
# endif
|
||||
|
||||
#ifdef PC_LOCKING
|
||||
#define HLOCK "NHPERM"
|
||||
#endif
|
||||
|
||||
#ifndef index
|
||||
# define index strchr
|
||||
#endif
|
||||
#ifndef rindex
|
||||
# define rindex strrchr
|
||||
#endif
|
||||
|
||||
#ifndef AMIGA
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef RANDOM
|
||||
/* Use the high quality random number routines. */
|
||||
# define Rand() random()
|
||||
#else
|
||||
# define Rand() rand()
|
||||
#endif
|
||||
|
||||
#ifndef TOS
|
||||
# define FCMASK 0660 /* file creation mask */
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifndef REDO
|
||||
# undef Getchar
|
||||
# define Getchar nhgetch
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS
|
||||
# define TEXTCOLOR /* */
|
||||
# define PORT_HELP "msdoshlp.txt" /* msdos port specific help file */
|
||||
#endif
|
||||
|
||||
|
||||
/* Sanity check, do not modify these blocks. */
|
||||
|
||||
/* OVERLAY must be defined with MOVERLAY or VROOMM */
|
||||
#if (defined(MOVERLAY) || defined(VROOMM))
|
||||
# ifndef OVERLAY
|
||||
# define OVERLAY
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(FUNCTION_LEVEL_LINKING)
|
||||
#define OVERLAY
|
||||
#define OVL0
|
||||
#define OVL1
|
||||
#define OVL2
|
||||
#define OVL3
|
||||
#define OVLB
|
||||
#endif
|
||||
|
||||
#if defined(OVERLAY) && !defined(MOVERLAY) && !defined(VROOMM) && !defined(FUNCTION_LEVEL_LINKING)
|
||||
#define USE_TRAMPOLI
|
||||
#endif
|
||||
|
||||
#if defined(MSDOS) && defined(NO_TERMS)
|
||||
# ifdef TERMLIB
|
||||
# if defined(_MSC_VER) || defined(__SC__)
|
||||
# pragma message("Warning -- TERMLIB defined with NO_TERMS in pcconf.h")
|
||||
# pragma message(" Forcing undef of TERMLIB")
|
||||
# endif
|
||||
#undef TERMLIB
|
||||
# endif
|
||||
# ifdef ANSI_DEFAULT
|
||||
# if defined(_MSC_VER) || defined(__SC__)
|
||||
# pragma message("Warning -- ANSI_DEFAULT defined with NO_TERMS in pcconf.h")
|
||||
# pragma message(" Forcing undef of ANSI_DEFAULT")
|
||||
# endif
|
||||
#undef ANSI_DEFAULT
|
||||
# endif
|
||||
/* only one screen package is allowed */
|
||||
# if defined(SCREEN_BIOS) && defined(SCREEN_DJGPPFAST)
|
||||
# if defined(_MSC_VER) || defined(__SC__)
|
||||
# pragma message("Warning -- More than one screen package defined in pcconf.h")
|
||||
# endif
|
||||
# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__SC__)
|
||||
# if defined(SCREEN_DJGPPFAST)
|
||||
# if defined(_MSC_VER) || defined(__SC__)
|
||||
# pragma message(" Forcing undef of SCREEN_DJGPPFAST")
|
||||
# endif
|
||||
#undef SCREEN_DJGPPFAST /* Can't use djgpp fast with other compilers anyway */
|
||||
# endif
|
||||
# else
|
||||
/* djgpp C compiler */
|
||||
# if defined(SCREEN_BIOS)
|
||||
#undef SCREEN_BIOS
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# define ASCIIGRAPH
|
||||
# ifdef TEXTCOLOR
|
||||
# define VIDEOSHADES
|
||||
# endif
|
||||
/* SCREEN_8514, SCREEN_VESA are only placeholders presently - sub VGA instead */
|
||||
# if defined(SCREEN_8514) || defined(SCREEN_VESA)
|
||||
# undef SCREEN_8514
|
||||
# undef SCREEN_VESA
|
||||
# define SCREEN_VGA
|
||||
# endif
|
||||
/* Graphical tile sanity checks */
|
||||
# ifdef SCREEN_VGA
|
||||
# define SIMULATE_CURSOR
|
||||
# define POSITIONBAR
|
||||
/* Select appropriate tile file format, and map size */
|
||||
# define PLANAR_FILE
|
||||
# define SMALL_MAP
|
||||
# endif
|
||||
#endif /* End of sanity check block */
|
||||
|
||||
#if defined(MSDOS) && defined(DLB)
|
||||
#define FILENAME_CMP stricmp /* case insensitive */
|
||||
#endif
|
||||
|
||||
#ifdef MSC7_WARN /* define with cl /DMSC7_WARN */
|
||||
#pragma warning(disable:4131)
|
||||
#endif
|
||||
|
||||
#ifdef TIMED_DELAY
|
||||
# ifdef __DJGPP__
|
||||
# define msleep(k) (void) usleep((k)*1000)
|
||||
# endif
|
||||
# ifdef __BORLANDC__
|
||||
# define msleep(k) delay(k)
|
||||
# endif
|
||||
# ifdef __SC__
|
||||
# define msleep(k) (void) usleep((long)((k)*1000))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* PCCONF_H */
|
|
@ -1,29 +0,0 @@
|
|||
/* SCCS Id: @(#)qt_clust.h 3.4 1999/11/19 */
|
||||
/* Copyright (c) Warwick Allison, 1999. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef clusterizer_H
|
||||
#define clusterizer_H
|
||||
|
||||
#include <qrect.h>
|
||||
|
||||
class Clusterizer {
|
||||
public:
|
||||
Clusterizer(int maxclusters);
|
||||
~Clusterizer();
|
||||
|
||||
void add(int x, int y); // 1x1 rectangle (point)
|
||||
void add(int x, int y, int w, int h);
|
||||
void add(const QRect& rect);
|
||||
|
||||
void clear();
|
||||
int clusters() { return count; }
|
||||
const QRect& operator[](int i);
|
||||
|
||||
private:
|
||||
QRect* cluster;
|
||||
int count;
|
||||
const int max;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,10 +0,0 @@
|
|||
/* SCCS Id: @(#)qt_kde0.h 3.4 1999/11/19 */
|
||||
/* Copyright (c) Warwick Allison, 1999. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef QT_DUMMYKDE
|
||||
#define QT_DUMMYKDE
|
||||
class KTopLevelWidget : public QMainWindow {
|
||||
Q_OBJECT
|
||||
};
|
||||
#endif
|
845
include/qt_win.h
845
include/qt_win.h
|
@ -1,845 +0,0 @@
|
|||
// SCCS Id: @(#)qt_win.h 3.4 1999/11/19
|
||||
// Copyright (c) Warwick Allison, 1999.
|
||||
// NetHack may be freely redistributed. See license for details.
|
||||
//
|
||||
// Qt Binding for NetHack 3.4
|
||||
//
|
||||
// Unfortunately, this doesn't use Qt as well as I would like,
|
||||
// primarily because NetHack is fundamentally a getkey-type
|
||||
// program rather than being event driven (hence the ugly key
|
||||
// and click buffer rather), but also because this is my first
|
||||
// major application of Qt.
|
||||
//
|
||||
|
||||
#ifndef qt_win_h
|
||||
#define qt_win_h
|
||||
|
||||
#define QT_CLEAN_NAMESPACE
|
||||
|
||||
#include <qdialog.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qlabel.h>
|
||||
#include <qlineedit.h>
|
||||
#if defined(QWS)
|
||||
#include <qpe/qpeapplication.h>
|
||||
#else
|
||||
#include <qapplication.h>
|
||||
#endif
|
||||
#include <qspinbox.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <qfile.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qlistview.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qimage.h>
|
||||
#include <qarray.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qscrollview.h>
|
||||
#if QT_VERSION >= 300
|
||||
#include <qttableview.h>
|
||||
// Should stop using QTableView
|
||||
#define QTableView QtTableView
|
||||
#else
|
||||
#include <qtableview.h>
|
||||
#endif
|
||||
#include <qmainwindow.h>
|
||||
#include <qwidgetstack.h>
|
||||
|
||||
#ifdef KDE
|
||||
#include <kapp.h>
|
||||
#include <ktopwidget.h>
|
||||
#endif
|
||||
|
||||
#include "qt_clust.h"
|
||||
|
||||
class QVBox;
|
||||
class QMenuBar;
|
||||
class QRadioButton;
|
||||
class NhPSListView;
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The beautiful, abstracted and well-modelled classes...
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
class NetHackQtGlyphs;
|
||||
|
||||
class NetHackQtLineEdit : public QLineEdit {
|
||||
public:
|
||||
NetHackQtLineEdit();
|
||||
NetHackQtLineEdit(QWidget* parent, const char* name);
|
||||
|
||||
void fakeEvent(int key, int ascii, int state);
|
||||
};
|
||||
|
||||
class NetHackQtSettings : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
// Size of window - used to decide default sizes
|
||||
NetHackQtSettings(int width, int height);
|
||||
|
||||
NetHackQtGlyphs& glyphs();
|
||||
const QFont& normalFont();
|
||||
const QFont& normalFixedFont();
|
||||
const QFont& largeFont();
|
||||
|
||||
bool ynInMessages();
|
||||
|
||||
signals:
|
||||
void fontChanged();
|
||||
void tilesChanged();
|
||||
|
||||
public slots:
|
||||
void toggleGlyphSize();
|
||||
void setGlyphSize(bool);
|
||||
|
||||
private:
|
||||
QSpinBox tilewidth;
|
||||
QSpinBox tileheight;
|
||||
QLabel widthlbl;
|
||||
QLabel heightlbl;
|
||||
QCheckBox whichsize;
|
||||
QSize othersize;
|
||||
|
||||
QComboBox fontsize;
|
||||
|
||||
QFont normal, normalfixed, large;
|
||||
|
||||
NetHackQtGlyphs* theglyphs;
|
||||
|
||||
private slots:
|
||||
void resizeTiles();
|
||||
};
|
||||
|
||||
class NetHackQtKeyBuffer {
|
||||
public:
|
||||
NetHackQtKeyBuffer();
|
||||
|
||||
bool Empty() const;
|
||||
bool Full() const;
|
||||
|
||||
void Put(int k, int ascii, int state);
|
||||
void Put(char a);
|
||||
void Put(const char* str);
|
||||
int GetKey();
|
||||
int GetAscii();
|
||||
int GetState();
|
||||
|
||||
int TopKey() const;
|
||||
int TopAscii() const;
|
||||
int TopState() const;
|
||||
|
||||
private:
|
||||
enum { maxkey=64 };
|
||||
int key[maxkey];
|
||||
int ascii[maxkey];
|
||||
int state[maxkey];
|
||||
int in,out;
|
||||
};
|
||||
|
||||
class NetHackQtClickBuffer {
|
||||
public:
|
||||
NetHackQtClickBuffer();
|
||||
|
||||
bool Empty() const;
|
||||
bool Full() const;
|
||||
|
||||
void Put(int x, int y, int mod);
|
||||
|
||||
int NextX() const;
|
||||
int NextY() const;
|
||||
int NextMod() const;
|
||||
|
||||
void Get();
|
||||
|
||||
private:
|
||||
enum { maxclick=64 };
|
||||
struct ClickRec {
|
||||
int x,y,mod;
|
||||
} click[maxclick];
|
||||
int in,out;
|
||||
};
|
||||
|
||||
|
||||
class NetHackQtSavedGameSelector : public QDialog {
|
||||
public:
|
||||
NetHackQtSavedGameSelector(const char** saved);
|
||||
|
||||
int choose();
|
||||
};
|
||||
|
||||
class NetHackQtPlayerSelector : private QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum { R_None=-1, R_Quit=-2, R_Rand=-3 };
|
||||
|
||||
NetHackQtPlayerSelector(NetHackQtKeyBuffer&);
|
||||
|
||||
protected:
|
||||
virtual void done(int);
|
||||
|
||||
public slots:
|
||||
void Quit();
|
||||
void Random();
|
||||
|
||||
void selectName(const QString& n);
|
||||
void selectRole();
|
||||
void selectRace();
|
||||
void setupOthers();
|
||||
void selectGender(int);
|
||||
void selectAlignment(int);
|
||||
|
||||
public:
|
||||
bool Choose();
|
||||
|
||||
private:
|
||||
NetHackQtKeyBuffer& keysource;
|
||||
NhPSListView* role;
|
||||
NhPSListView* race;
|
||||
QRadioButton **gender;
|
||||
QRadioButton **alignment;
|
||||
bool fully_specified_role;
|
||||
};
|
||||
|
||||
class NetHackQtStringRequestor : QDialog {
|
||||
private:
|
||||
QLabel prompt;
|
||||
NetHackQtLineEdit input;
|
||||
QPushButton* okay;
|
||||
QPushButton* cancel;
|
||||
NetHackQtKeyBuffer& keysource;
|
||||
|
||||
virtual void done(int);
|
||||
|
||||
public:
|
||||
NetHackQtStringRequestor(NetHackQtKeyBuffer&, const char* p,const char* cancelstr="Cancel");
|
||||
void SetDefault(const char*);
|
||||
bool Get(char* buffer, int maxchar=80);
|
||||
virtual void resizeEvent(QResizeEvent*);
|
||||
};
|
||||
|
||||
class NetHackQtExtCmdRequestor : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
NetHackQtKeyBuffer& keysource;
|
||||
|
||||
public:
|
||||
NetHackQtExtCmdRequestor(NetHackQtKeyBuffer& ks);
|
||||
int get();
|
||||
|
||||
private slots:
|
||||
void cancel();
|
||||
void done(int i);
|
||||
};
|
||||
|
||||
|
||||
class NetHackQtWindow {
|
||||
public:
|
||||
NetHackQtWindow();
|
||||
virtual ~NetHackQtWindow();
|
||||
|
||||
virtual QWidget* Widget() =0;
|
||||
|
||||
virtual void Clear();
|
||||
virtual void Display(bool block);
|
||||
virtual bool Destroy();
|
||||
virtual void CursorTo(int x,int y);
|
||||
virtual void PutStr(int attr, const char* text);
|
||||
virtual void StartMenu();
|
||||
virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
|
||||
const char* str, bool presel);
|
||||
virtual void EndMenu(const char* prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
virtual void ClipAround(int x,int y);
|
||||
virtual void PrintGlyph(int x,int y,int glyph);
|
||||
virtual void UseRIP(int how);
|
||||
|
||||
int nhid;
|
||||
};
|
||||
|
||||
class NetHackQtGlyphs {
|
||||
public:
|
||||
NetHackQtGlyphs();
|
||||
|
||||
int width() const { return size.width(); }
|
||||
int height() const { return size.height(); }
|
||||
void toggleSize();
|
||||
void setSize(int w, int h);
|
||||
|
||||
void drawGlyph(QPainter&, int glyph, int pixelx, int pixely);
|
||||
void drawCell(QPainter&, int glyph, int cellx, int celly);
|
||||
|
||||
private:
|
||||
QImage img;
|
||||
QPixmap pm,pm1, pm2;
|
||||
QSize size;
|
||||
int tiles_per_row;
|
||||
};
|
||||
|
||||
class BlackScrollView : public QScrollView {
|
||||
public:
|
||||
BlackScrollView()
|
||||
{
|
||||
viewport()->setBackgroundColor(black);
|
||||
}
|
||||
};
|
||||
|
||||
class NetHackQtMapWindow : public QWidget, public NetHackQtWindow {
|
||||
Q_OBJECT
|
||||
private:
|
||||
NetHackQtClickBuffer& clicksink;
|
||||
unsigned short glyph[ROWNO][COLNO];
|
||||
unsigned short& Glyph(int x, int y) { return glyph[y][x]; }
|
||||
QPoint cursor;
|
||||
BlackScrollView viewport;
|
||||
QPixmap pet_annotation;
|
||||
Clusterizer change;
|
||||
QFont *rogue_font;
|
||||
QString messages;
|
||||
QRect messages_rect;
|
||||
|
||||
void Changed(int x,int y);
|
||||
|
||||
signals:
|
||||
void resized();
|
||||
|
||||
private slots:
|
||||
void updateTiles();
|
||||
void moveMessages(int x, int y);
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent*);
|
||||
virtual void mousePressEvent(QMouseEvent*);
|
||||
|
||||
public:
|
||||
NetHackQtMapWindow(NetHackQtClickBuffer& click_sink);
|
||||
~NetHackQtMapWindow();
|
||||
|
||||
virtual QWidget* Widget();
|
||||
virtual bool Destroy();
|
||||
|
||||
virtual void Clear();
|
||||
virtual void Display(bool block);
|
||||
virtual void CursorTo(int x,int y);
|
||||
virtual void PutStr(int attr, const char* text);
|
||||
virtual void ClipAround(int x,int y);
|
||||
virtual void PrintGlyph(int x,int y,int glyph);
|
||||
|
||||
void Scroll(int dx, int dy);
|
||||
|
||||
// For messages
|
||||
void displayMessages(bool block);
|
||||
void putMessage(int attr, const char* text);
|
||||
void clearMessages();
|
||||
|
||||
void clickCursor();
|
||||
};
|
||||
|
||||
class NetHackQtScrollText;
|
||||
class NetHackQtMessageWindow : QObject, public NetHackQtWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtMessageWindow();
|
||||
~NetHackQtMessageWindow();
|
||||
|
||||
virtual QWidget* Widget();
|
||||
virtual void Clear();
|
||||
virtual void Display(bool block);
|
||||
virtual void PutStr(int attr, const char* text);
|
||||
|
||||
void Scroll(int dx, int dy);
|
||||
|
||||
void setMap(NetHackQtMapWindow*);
|
||||
|
||||
private:
|
||||
NetHackQtScrollText* list;
|
||||
bool changed;
|
||||
NetHackQtMapWindow* map;
|
||||
|
||||
private slots:
|
||||
void updateFont();
|
||||
};
|
||||
|
||||
class NetHackQtLabelledIcon : public QWidget {
|
||||
public:
|
||||
NetHackQtLabelledIcon(QWidget* parent, const char* label);
|
||||
NetHackQtLabelledIcon(QWidget* parent, const char* label, const QPixmap& icon);
|
||||
|
||||
enum { NoNum=-99999 };
|
||||
void setLabel(const char*, bool lower=TRUE); // a string
|
||||
void setLabel(const char*, long, const char* tail=""); // a number
|
||||
void setLabel(const char*, long show_value, long comparative_value, const char* tail="");
|
||||
void setIcon(const QPixmap&);
|
||||
virtual void setFont(const QFont&);
|
||||
|
||||
void highlightWhenChanging();
|
||||
void lowIsGood();
|
||||
void dissipateHighlight();
|
||||
|
||||
virtual void show();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent*);
|
||||
|
||||
private:
|
||||
void initHighlight();
|
||||
void setAlignments();
|
||||
void highlight(const QPalette& highlight);
|
||||
void unhighlight();
|
||||
|
||||
bool low_is_good;
|
||||
int prev_value;
|
||||
int turn_count; /* last time the value changed */
|
||||
QPalette hl_good;
|
||||
QPalette hl_bad;
|
||||
|
||||
QLabel* label;
|
||||
QLabel* icon;
|
||||
};
|
||||
|
||||
class NetHackQtStatusWindow : QWidget, public NetHackQtWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtStatusWindow();
|
||||
|
||||
virtual QWidget* Widget();
|
||||
|
||||
virtual void Clear();
|
||||
virtual void Display(bool block);
|
||||
virtual void CursorTo(int x,int y);
|
||||
virtual void PutStr(int attr, const char* text);
|
||||
|
||||
void fadeHighlighting();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent*);
|
||||
|
||||
private slots:
|
||||
void doUpdate();
|
||||
|
||||
private:
|
||||
enum { hilight_time=1 };
|
||||
|
||||
QPixmap p_str;
|
||||
QPixmap p_dex;
|
||||
QPixmap p_con;
|
||||
QPixmap p_int;
|
||||
QPixmap p_wis;
|
||||
QPixmap p_cha;
|
||||
|
||||
QPixmap p_chaotic;
|
||||
QPixmap p_neutral;
|
||||
QPixmap p_lawful;
|
||||
|
||||
QPixmap p_satiated;
|
||||
QPixmap p_hungry;
|
||||
|
||||
QPixmap p_confused;
|
||||
QPixmap p_sick_fp;
|
||||
QPixmap p_sick_il;
|
||||
QPixmap p_blind;
|
||||
QPixmap p_stunned;
|
||||
QPixmap p_hallu;
|
||||
|
||||
QPixmap p_encumber[5];
|
||||
|
||||
NetHackQtLabelledIcon name;
|
||||
NetHackQtLabelledIcon dlevel;
|
||||
|
||||
NetHackQtLabelledIcon str;
|
||||
NetHackQtLabelledIcon dex;
|
||||
NetHackQtLabelledIcon con;
|
||||
NetHackQtLabelledIcon intel;
|
||||
NetHackQtLabelledIcon wis;
|
||||
NetHackQtLabelledIcon cha;
|
||||
|
||||
NetHackQtLabelledIcon gold;
|
||||
NetHackQtLabelledIcon hp;
|
||||
NetHackQtLabelledIcon power;
|
||||
NetHackQtLabelledIcon ac;
|
||||
NetHackQtLabelledIcon level;
|
||||
NetHackQtLabelledIcon exp;
|
||||
NetHackQtLabelledIcon align;
|
||||
|
||||
NetHackQtLabelledIcon time;
|
||||
NetHackQtLabelledIcon score;
|
||||
|
||||
NetHackQtLabelledIcon hunger;
|
||||
NetHackQtLabelledIcon confused;
|
||||
NetHackQtLabelledIcon sick_fp;
|
||||
NetHackQtLabelledIcon sick_il;
|
||||
NetHackQtLabelledIcon blind;
|
||||
NetHackQtLabelledIcon stunned;
|
||||
NetHackQtLabelledIcon hallu;
|
||||
NetHackQtLabelledIcon encumber;
|
||||
|
||||
QFrame hline1;
|
||||
QFrame hline2;
|
||||
QFrame hline3;
|
||||
|
||||
int cursy;
|
||||
|
||||
bool first_set;
|
||||
|
||||
void nullOut();
|
||||
void updateStats();
|
||||
void checkTurnEvents();
|
||||
};
|
||||
|
||||
class NetHackQtMenuDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtMenuDialog();
|
||||
|
||||
void Accept();
|
||||
void Reject();
|
||||
void SetResult(int);
|
||||
|
||||
virtual void done(int);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent*);
|
||||
|
||||
signals:
|
||||
void Resized();
|
||||
};
|
||||
|
||||
|
||||
class NetHackQtMenuWindow : public QTableView, public NetHackQtWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtMenuWindow(NetHackQtKeyBuffer&);
|
||||
~NetHackQtMenuWindow();
|
||||
|
||||
virtual QWidget* Widget();
|
||||
|
||||
virtual void StartMenu();
|
||||
virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
|
||||
const char* str, bool presel);
|
||||
virtual void EndMenu(const char* prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
|
||||
public slots:
|
||||
void All();
|
||||
void ChooseNone();
|
||||
void Invert();
|
||||
void Search();
|
||||
|
||||
void Layout();
|
||||
void ToggleSelect(int);
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent*);
|
||||
//virtual void mouseDoubleClickEvent(QMouseEvent*);
|
||||
virtual void mousePressEvent(QMouseEvent*);
|
||||
virtual void mouseReleaseEvent(QMouseEvent*);
|
||||
virtual void mouseMoveEvent(QMouseEvent*);
|
||||
virtual void focusOutEvent(QFocusEvent*);
|
||||
virtual void focusInEvent(QFocusEvent*);
|
||||
|
||||
virtual void paintCell(QPainter*, int, int);
|
||||
virtual int cellWidth(int col);
|
||||
|
||||
private:
|
||||
struct MenuItem {
|
||||
MenuItem();
|
||||
~MenuItem();
|
||||
|
||||
int glyph;
|
||||
ANY_P identifier;
|
||||
int attr;
|
||||
const char* str;
|
||||
int count;
|
||||
char ch;
|
||||
bool selected;
|
||||
|
||||
bool Selectable() const { return identifier.a_void!=0; }
|
||||
};
|
||||
|
||||
QArray<MenuItem> item;
|
||||
|
||||
int itemcount;
|
||||
int str_width;
|
||||
bool str_fixed;
|
||||
int next_accel;
|
||||
|
||||
NetHackQtKeyBuffer& keysource;
|
||||
|
||||
NetHackQtMenuDialog* dialog;
|
||||
|
||||
QPushButton* ok;
|
||||
QPushButton* cancel;
|
||||
QPushButton* all;
|
||||
QPushButton* none;
|
||||
QPushButton* invert;
|
||||
QPushButton* search;
|
||||
QLabel prompt;
|
||||
|
||||
int how;
|
||||
|
||||
bool has_glyphs;
|
||||
|
||||
int pressed;
|
||||
bool was_sel;
|
||||
};
|
||||
|
||||
class NetHackQtTextListBox;
|
||||
|
||||
class NetHackQtRIP : public QWidget {
|
||||
private:
|
||||
static QPixmap* pixmap;
|
||||
char** line;
|
||||
int riplines;
|
||||
|
||||
public:
|
||||
NetHackQtRIP(QWidget* parent);
|
||||
|
||||
void setLines(char** l, int n);
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent* event);
|
||||
QSize sizeHint() const;
|
||||
};
|
||||
|
||||
|
||||
class NetHackQtTextWindow : public QDialog, public NetHackQtWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtTextWindow(NetHackQtKeyBuffer&);
|
||||
~NetHackQtTextWindow();
|
||||
|
||||
virtual QWidget* Widget();
|
||||
|
||||
virtual void Clear();
|
||||
virtual bool Destroy();
|
||||
virtual void Display(bool block);
|
||||
virtual void PutStr(int attr, const char* text);
|
||||
virtual void UseRIP(int how);
|
||||
|
||||
public slots:
|
||||
void Search();
|
||||
|
||||
protected:
|
||||
virtual void done(int);
|
||||
virtual void keyPressEvent(QKeyEvent*);
|
||||
|
||||
private slots:
|
||||
void doUpdate();
|
||||
|
||||
private:
|
||||
NetHackQtKeyBuffer& keysource;
|
||||
|
||||
bool use_rip;
|
||||
bool str_fixed;
|
||||
|
||||
QPushButton ok;
|
||||
QPushButton search;
|
||||
NetHackQtTextListBox* lines;
|
||||
|
||||
NetHackQtRIP rip;
|
||||
};
|
||||
|
||||
class NetHackQtMenuOrTextWindow : public NetHackQtWindow {
|
||||
private:
|
||||
NetHackQtWindow* actual;
|
||||
NetHackQtKeyBuffer& keysource;
|
||||
|
||||
public:
|
||||
NetHackQtMenuOrTextWindow(NetHackQtKeyBuffer&);
|
||||
|
||||
virtual QWidget* Widget();
|
||||
|
||||
// Text
|
||||
virtual void Clear();
|
||||
virtual bool Destroy();
|
||||
virtual void Display(bool block);
|
||||
virtual void PutStr(int attr, const char* text);
|
||||
|
||||
// Menu
|
||||
virtual void StartMenu();
|
||||
virtual void AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr,
|
||||
const char* str, bool presel);
|
||||
virtual void EndMenu(const char* prompt);
|
||||
virtual int SelectMenu(int how, MENU_ITEM_P **menu_list);
|
||||
|
||||
};
|
||||
|
||||
class NetHackQtDelay : QObject {
|
||||
private:
|
||||
int msec;
|
||||
|
||||
public:
|
||||
NetHackQtDelay(int ms);
|
||||
void wait();
|
||||
virtual void timerEvent(QTimerEvent* timer);
|
||||
};
|
||||
|
||||
|
||||
class NetHackQtInvUsageWindow : public QWidget {
|
||||
public:
|
||||
NetHackQtInvUsageWindow(QWidget* parent);
|
||||
virtual void paintEvent(QPaintEvent*);
|
||||
private:
|
||||
void drawWorn(QPainter& painter, obj*, int x, int y, bool canbe=TRUE);
|
||||
};
|
||||
|
||||
// This class is the main widget for NetHack
|
||||
//
|
||||
// It is a collection of Message, Map, and Status windows. In the current
|
||||
// version of nethack there is only one of each, and this class makes this
|
||||
// assumption, not showing itself until all are inserted.
|
||||
//
|
||||
// This class simply knows how to layout such children sensibly.
|
||||
//
|
||||
// Since it is only responsible for layout, the class does not
|
||||
// note the actual class of the windows.
|
||||
//
|
||||
#ifndef KDE
|
||||
#include "qt_kde0.h"
|
||||
#endif
|
||||
|
||||
class NetHackQtMainWindow : public KTopLevelWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
NetHackQtMainWindow(NetHackQtKeyBuffer&);
|
||||
|
||||
void AddMessageWindow(NetHackQtMessageWindow* window);
|
||||
void AddMapWindow(NetHackQtMapWindow* window);
|
||||
void AddStatusWindow(NetHackQtStatusWindow* window);
|
||||
void RemoveWindow(NetHackQtWindow* window);
|
||||
void updateInventory();
|
||||
|
||||
void fadeHighlighting();
|
||||
|
||||
public slots:
|
||||
void doMenuItem(int);
|
||||
void doKeys(const QString&);
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent*);
|
||||
virtual void keyPressEvent(QKeyEvent*);
|
||||
virtual void keyReleaseEvent(QKeyEvent* event);
|
||||
virtual void closeEvent(QCloseEvent*);
|
||||
|
||||
private slots:
|
||||
void layout();
|
||||
void raiseMap();
|
||||
void zoomMap();
|
||||
void raiseMessages();
|
||||
void raiseStatus();
|
||||
|
||||
private:
|
||||
void ShowIfReady();
|
||||
|
||||
#ifdef KDE
|
||||
KMenuBar* menubar;
|
||||
#else
|
||||
QMenuBar* menubar;
|
||||
#endif
|
||||
NetHackQtMessageWindow* message;
|
||||
NetHackQtMapWindow* map;
|
||||
NetHackQtStatusWindow* status;
|
||||
NetHackQtInvUsageWindow* invusage;
|
||||
|
||||
NetHackQtKeyBuffer& keysink;
|
||||
QWidgetStack* stack;
|
||||
int dirkey;
|
||||
|
||||
const char* *macro;
|
||||
};
|
||||
|
||||
class NetHackQtYnDialog : QDialog {
|
||||
Q_OBJECT
|
||||
private:
|
||||
const char* question;
|
||||
const char* choices;
|
||||
char def;
|
||||
NetHackQtKeyBuffer& keysource;
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent*);
|
||||
virtual void done(int);
|
||||
|
||||
private slots:
|
||||
void doneItem(int);
|
||||
|
||||
public:
|
||||
NetHackQtYnDialog(NetHackQtKeyBuffer& keysource,const char*,const char*,char);
|
||||
|
||||
char Exec();
|
||||
};
|
||||
|
||||
#ifdef KDE
|
||||
#define NetHackQtBindBase KApplication
|
||||
#elif defined(QWS)
|
||||
#define NetHackQtBindBase QPEApplication
|
||||
#else
|
||||
#define NetHackQtBindBase QApplication
|
||||
#endif
|
||||
|
||||
class NetHackQtBind : NetHackQtBindBase {
|
||||
private:
|
||||
// Single-instance preservation...
|
||||
NetHackQtBind(int& argc, char** argv);
|
||||
|
||||
static NetHackQtBind* instance;
|
||||
|
||||
static NetHackQtKeyBuffer keybuffer;
|
||||
static NetHackQtClickBuffer clickbuffer;
|
||||
|
||||
static QWidget* splash;
|
||||
static NetHackQtMainWindow* main;
|
||||
|
||||
public:
|
||||
static void qt_init_nhwindows(int* argc, char** argv);
|
||||
static void qt_player_selection();
|
||||
static void qt_askname();
|
||||
static void qt_get_nh_event();
|
||||
static void qt_exit_nhwindows(const char *);
|
||||
static void qt_suspend_nhwindows(const char *);
|
||||
static void qt_resume_nhwindows();
|
||||
static winid qt_create_nhwindow(int type);
|
||||
static void qt_clear_nhwindow(winid wid);
|
||||
static void qt_display_nhwindow(winid wid, BOOLEAN_P block);
|
||||
static void qt_destroy_nhwindow(winid wid);
|
||||
static void qt_curs(winid wid, int x, int y);
|
||||
static void qt_putstr(winid wid, int attr, const char *text);
|
||||
static void qt_display_file(const char *filename, BOOLEAN_P must_exist);
|
||||
static void qt_start_menu(winid wid);
|
||||
static void qt_add_menu(winid wid, int glyph,
|
||||
const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr,
|
||||
const char *str, BOOLEAN_P presel);
|
||||
static void qt_end_menu(winid wid, const char *prompt);
|
||||
static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list);
|
||||
static void qt_update_inventory();
|
||||
static void qt_mark_synch();
|
||||
static void qt_wait_synch();
|
||||
|
||||
static void qt_cliparound(int x, int y);
|
||||
static void qt_cliparound_window(winid wid, int x, int y);
|
||||
static void qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph);
|
||||
static void qt_raw_print(const char *str);
|
||||
static void qt_raw_print_bold(const char *str);
|
||||
static int qt_nhgetch();
|
||||
static int qt_nh_poskey(int *x, int *y, int *mod);
|
||||
static void qt_nhbell();
|
||||
static int qt_doprev_message();
|
||||
static char qt_yn_function(const char *question, const char *choices, CHAR_P def);
|
||||
static void qt_getlin(const char *prompt, char *line);
|
||||
static int qt_get_ext_cmd();
|
||||
static void qt_number_pad(int);
|
||||
static void qt_delay_output(int);
|
||||
static void qt_start_screen();
|
||||
static void qt_end_screen();
|
||||
|
||||
static void qt_outrip(winid wid, int how);
|
||||
static int qt_kbhit();
|
||||
|
||||
private:
|
||||
virtual bool notify(QObject *receiver, QEvent *event);
|
||||
};
|
||||
|
||||
#endif
|
1406
include/qt_xpms.h
1406
include/qt_xpms.h
File diff suppressed because it is too large
Load diff
|
@ -1,251 +0,0 @@
|
|||
/**********************************************************************
|
||||
** $Id: qttableview.h,v 1.2 2002/03/09 03:13:13 jwalz Exp $
|
||||
**
|
||||
** Definition of QtTableView class
|
||||
**
|
||||
** Created : 941115
|
||||
**
|
||||
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
||||
**
|
||||
** This file contains a class moved out of the Qt GUI Toolkit API. It
|
||||
** may be used, distributed and modified without limitation.
|
||||
**
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef QTTABLEVIEW_H
|
||||
#define QTTABLEVIEW_H
|
||||
|
||||
#ifndef QT_H
|
||||
#include <qframe.h>
|
||||
#endif // QT_H
|
||||
|
||||
#ifndef QT_NO_QTTABLEVIEW
|
||||
|
||||
class QScrollBar;
|
||||
class QCornerSquare;
|
||||
|
||||
|
||||
class QtTableView : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
virtual void setBackgroundColor( const QColor & );
|
||||
virtual void setPalette( const QPalette & );
|
||||
void show();
|
||||
|
||||
void repaint( bool erase=TRUE );
|
||||
void repaint( int x, int y, int w, int h, bool erase=TRUE );
|
||||
void repaint( const QRect &, bool erase=TRUE );
|
||||
|
||||
protected:
|
||||
QtTableView( QWidget *parent=0, const char *name=0, WFlags f=0 );
|
||||
~QtTableView();
|
||||
|
||||
int numRows() const;
|
||||
virtual void setNumRows( int );
|
||||
int numCols() const;
|
||||
virtual void setNumCols( int );
|
||||
|
||||
int topCell() const;
|
||||
virtual void setTopCell( int row );
|
||||
int leftCell() const;
|
||||
virtual void setLeftCell( int col );
|
||||
virtual void setTopLeftCell( int row, int col );
|
||||
|
||||
int xOffset() const;
|
||||
virtual void setXOffset( int );
|
||||
int yOffset() const;
|
||||
virtual void setYOffset( int );
|
||||
virtual void setOffset( int x, int y, bool updateScrBars = TRUE );
|
||||
|
||||
virtual int cellWidth( int col );
|
||||
virtual int cellHeight( int row );
|
||||
int cellWidth() const;
|
||||
int cellHeight() const;
|
||||
virtual void setCellWidth( int );
|
||||
virtual void setCellHeight( int );
|
||||
|
||||
virtual int totalWidth();
|
||||
virtual int totalHeight();
|
||||
|
||||
uint tableFlags() const;
|
||||
bool testTableFlags( uint f ) const;
|
||||
virtual void setTableFlags( uint f );
|
||||
void clearTableFlags( uint f = ~0 );
|
||||
|
||||
bool autoUpdate() const;
|
||||
virtual void setAutoUpdate( bool );
|
||||
|
||||
void updateCell( int row, int column, bool erase=TRUE );
|
||||
|
||||
QRect cellUpdateRect() const;
|
||||
QRect viewRect() const;
|
||||
|
||||
int lastRowVisible() const;
|
||||
int lastColVisible() const;
|
||||
|
||||
bool rowIsVisible( int row ) const;
|
||||
bool colIsVisible( int col ) const;
|
||||
|
||||
QScrollBar *verticalScrollBar() const;
|
||||
QScrollBar *horizontalScrollBar() const;
|
||||
|
||||
private slots:
|
||||
void horSbValue( int );
|
||||
void horSbSliding( int );
|
||||
void horSbSlidingDone();
|
||||
void verSbValue( int );
|
||||
void verSbSliding( int );
|
||||
void verSbSlidingDone();
|
||||
|
||||
protected:
|
||||
virtual void paintCell( QPainter *, int row, int col ) = 0;
|
||||
virtual void setupPainter( QPainter * );
|
||||
|
||||
void paintEvent( QPaintEvent * );
|
||||
void resizeEvent( QResizeEvent * );
|
||||
|
||||
int findRow( int yPos ) const;
|
||||
int findCol( int xPos ) const;
|
||||
|
||||
bool rowYPos( int row, int *yPos ) const;
|
||||
bool colXPos( int col, int *xPos ) const;
|
||||
|
||||
int maxXOffset();
|
||||
int maxYOffset();
|
||||
int maxColOffset();
|
||||
int maxRowOffset();
|
||||
|
||||
int minViewX() const;
|
||||
int minViewY() const;
|
||||
int maxViewX() const;
|
||||
int maxViewY() const;
|
||||
int viewWidth() const;
|
||||
int viewHeight() const;
|
||||
|
||||
void scroll( int xPixels, int yPixels );
|
||||
void updateScrollBars();
|
||||
void updateTableSize();
|
||||
|
||||
private:
|
||||
void coverCornerSquare( bool );
|
||||
void snapToGrid( bool horizontal, bool vertical );
|
||||
virtual void setHorScrollBar( bool on, bool update = TRUE );
|
||||
virtual void setVerScrollBar( bool on, bool update = TRUE );
|
||||
void updateView();
|
||||
int findRawRow( int yPos, int *cellMaxY, int *cellMinY = 0,
|
||||
bool goOutsideView = FALSE ) const;
|
||||
int findRawCol( int xPos, int *cellMaxX, int *cellMinX = 0,
|
||||
bool goOutsideView = FALSE ) const;
|
||||
int maxColsVisible() const;
|
||||
|
||||
void updateScrollBars( uint );
|
||||
void updateFrameSize();
|
||||
|
||||
void doAutoScrollBars();
|
||||
void showOrHideScrollBars();
|
||||
|
||||
int nRows;
|
||||
int nCols;
|
||||
int xOffs, yOffs;
|
||||
int xCellOffs, yCellOffs;
|
||||
short xCellDelta, yCellDelta;
|
||||
short cellH, cellW;
|
||||
|
||||
uint eraseInPaint : 1;
|
||||
uint verSliding : 1;
|
||||
uint verSnappingOff : 1;
|
||||
uint horSliding : 1;
|
||||
uint horSnappingOff : 1;
|
||||
uint coveringCornerSquare : 1;
|
||||
uint sbDirty : 8;
|
||||
uint inSbUpdate : 1;
|
||||
|
||||
uint tFlags;
|
||||
QRect cellUpdateR;
|
||||
|
||||
QScrollBar *vScrollBar;
|
||||
QScrollBar *hScrollBar;
|
||||
QCornerSquare *cornerSquare;
|
||||
|
||||
private: // Disabled copy constructor and operator=
|
||||
#if defined(Q_DISABLE_COPY)
|
||||
QtTableView( const QtTableView & );
|
||||
QtTableView &operator=( const QtTableView & );
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
const uint Tbl_vScrollBar = 0x00000001;
|
||||
const uint Tbl_hScrollBar = 0x00000002;
|
||||
const uint Tbl_autoVScrollBar = 0x00000004;
|
||||
const uint Tbl_autoHScrollBar = 0x00000008;
|
||||
const uint Tbl_autoScrollBars = 0x0000000C;
|
||||
|
||||
const uint Tbl_clipCellPainting = 0x00000100;
|
||||
const uint Tbl_cutCellsV = 0x00000200;
|
||||
const uint Tbl_cutCellsH = 0x00000400;
|
||||
const uint Tbl_cutCells = 0x00000600;
|
||||
|
||||
const uint Tbl_scrollLastHCell = 0x00000800;
|
||||
const uint Tbl_scrollLastVCell = 0x00001000;
|
||||
const uint Tbl_scrollLastCell = 0x00001800;
|
||||
|
||||
const uint Tbl_smoothHScrolling = 0x00002000;
|
||||
const uint Tbl_smoothVScrolling = 0x00004000;
|
||||
const uint Tbl_smoothScrolling = 0x00006000;
|
||||
|
||||
const uint Tbl_snapToHGrid = 0x00008000;
|
||||
const uint Tbl_snapToVGrid = 0x00010000;
|
||||
const uint Tbl_snapToGrid = 0x00018000;
|
||||
|
||||
|
||||
inline int QtTableView::numRows() const
|
||||
{ return nRows; }
|
||||
|
||||
inline int QtTableView::numCols() const
|
||||
{ return nCols; }
|
||||
|
||||
inline int QtTableView::topCell() const
|
||||
{ return yCellOffs; }
|
||||
|
||||
inline int QtTableView::leftCell() const
|
||||
{ return xCellOffs; }
|
||||
|
||||
inline int QtTableView::xOffset() const
|
||||
{ return xOffs; }
|
||||
|
||||
inline int QtTableView::yOffset() const
|
||||
{ return yOffs; }
|
||||
|
||||
inline int QtTableView::cellHeight() const
|
||||
{ return cellH; }
|
||||
|
||||
inline int QtTableView::cellWidth() const
|
||||
{ return cellW; }
|
||||
|
||||
inline uint QtTableView::tableFlags() const
|
||||
{ return tFlags; }
|
||||
|
||||
inline bool QtTableView::testTableFlags( uint f ) const
|
||||
{ return (tFlags & f) != 0; }
|
||||
|
||||
inline QRect QtTableView::cellUpdateRect() const
|
||||
{ return cellUpdateR; }
|
||||
|
||||
inline bool QtTableView::autoUpdate() const
|
||||
{ return isUpdatesEnabled(); }
|
||||
|
||||
inline void QtTableView::repaint( bool erase )
|
||||
{ repaint( 0, 0, width(), height(), erase ); }
|
||||
|
||||
inline void QtTableView::repaint( const QRect &r, bool erase )
|
||||
{ repaint( r.x(), r.y(), r.width(), r.height(), erase ); }
|
||||
|
||||
inline void QtTableView::updateScrollBars()
|
||||
{ updateScrollBars( 0 ); }
|
||||
|
||||
|
||||
#endif // QT_NO_QTTABLEVIEW
|
||||
|
||||
#endif // QTTABLEVIEW_H
|
|
@ -472,10 +472,9 @@ E char *sprintf();
|
|||
|
||||
#ifndef __SASC_60
|
||||
#ifdef NEED_VARARGS
|
||||
# if defined(USE_STDARG) || defined(USE_VARARGS)
|
||||
# if !defined(SVR4) && !defined(apollo)
|
||||
# if !(defined(ULTRIX_PROTO) && defined(__GNUC__))
|
||||
# if !(defined(SUNOS4) && defined(__STDC__)) /* Solaris unbundled cc (acc) */
|
||||
# if !defined(SVR4) && !defined(apollo)
|
||||
# if !(defined(ULTRIX_PROTO) && defined(__GNUC__))
|
||||
# if !(defined(SUNOS4) && defined(__STDC__)) /* Solaris unbundled cc (acc) */
|
||||
|
||||
E int FDECL(vfprintf, (FILE *, const char *, va_list));
|
||||
E int FDECL(vprintf, (const char *, va_list));
|
||||
|
@ -484,13 +483,8 @@ E int FDECL(vprintf, (const char *, va_list));
|
|||
E int FDECL(vsprintf, (char *, const char *, va_list));
|
||||
#endif
|
||||
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# define vprintf printf
|
||||
# define vfprintf fprintf
|
||||
# define vsprintf sprintf
|
||||
# endif
|
||||
#endif /* NEED_VARARGS */
|
||||
#endif
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/* SCCS Id: @(#)tile2x11.h 3.4 1995/01/25 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef TILE2X11_H
|
||||
#define TILE2X11_H
|
||||
|
||||
/*
|
||||
* Header for the x11 tile map.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned long version;
|
||||
unsigned long ncolors;
|
||||
unsigned long tile_width;
|
||||
unsigned long tile_height;
|
||||
unsigned long ntiles;
|
||||
unsigned long per_row;
|
||||
} x11_header;
|
||||
|
||||
/* how wide each row in the tile file is, in tiles */
|
||||
#define TILES_PER_ROW (40)
|
||||
|
||||
#endif /* TILE2X11_H */
|
|
@ -1,86 +0,0 @@
|
|||
/* SCCS Id: @(#)tosconf.h 3.2 90/02/22 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifdef TOS
|
||||
#ifndef TOSCONF_H
|
||||
#define TOSCONF_H
|
||||
|
||||
#define MICRO /* must be defined to allow some inclusions */
|
||||
|
||||
/*
|
||||
Adjust these options to suit your compiler. The default here is for
|
||||
GNU C with the MiNT library.
|
||||
*/
|
||||
|
||||
/*#define NO_SIGNAL /* library doesn't support signals */
|
||||
/*#define NO_FSTAT /* library doesn't have fstat() call */
|
||||
#define MINT /* library supports MiNT extensions to TOS */
|
||||
|
||||
#ifdef __MINT__
|
||||
#define MINT
|
||||
#endif
|
||||
|
||||
#ifdef O_BINARY
|
||||
#define FCMASK O_BINARY
|
||||
#else
|
||||
#define FCMASK 0660
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
#ifdef UNIXDEBUG
|
||||
#define remove(x) unlink(x)
|
||||
#endif
|
||||
|
||||
/* configurable options */
|
||||
#define MFLOPPY /* floppy support */
|
||||
#define RANDOM /* improved random numbers */
|
||||
#define SHELL /* allow spawning of shell */
|
||||
#define TERMLIB /* use termcap */
|
||||
#define TEXTCOLOR /* allow color */
|
||||
#define MAIL /* enable the fake maildemon */
|
||||
#ifdef MINT
|
||||
#define SUSPEND /* allow suspending the game */
|
||||
#endif
|
||||
|
||||
#ifndef TERMLIB
|
||||
#define ANSI_DEFAULT /* use vt52 by default */
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__MINT__)
|
||||
/* actually, only more recent GNU C libraries have strcmpi
|
||||
* on the other hand, they're free -- if yours is out of
|
||||
* date, grab the most recent from atari.archive.umich.edu
|
||||
*/
|
||||
#define STRNCMPI
|
||||
#undef strcmpi
|
||||
extern int FDECL(strcmpi,(const char *, const char *));
|
||||
extern int FDECL(strncmpi,(const char *, const char *, size_t));
|
||||
#endif
|
||||
|
||||
#include <termcap.h>
|
||||
#include <unistd.h>
|
||||
/* instead of including system.h from pcconf.h */
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <types.h>
|
||||
#define SIG_RET_TYPE __Sigfunc
|
||||
#define SYSTEM_H
|
||||
|
||||
#ifndef MICRO_H
|
||||
#include "micro.h"
|
||||
#endif
|
||||
#ifndef PCCONF_H
|
||||
#include "pcconf.h" /* remainder of stuff is same as the PC */
|
||||
#endif
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
extern boolean colors_changed; /* in tos.c */
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define GCC_BUG /* correct a gcc bug involving double for loops */
|
||||
#endif
|
||||
|
||||
#endif /* TOSCONF_H */
|
||||
#endif /* TOS */
|
|
@ -42,29 +42,6 @@
|
|||
* Makes substitutes for compatibility with the old C standard.
|
||||
*/
|
||||
|
||||
/* Decide how to handle variable parameter lists:
|
||||
* USE_STDARG means use the ANSI <stdarg.h> facilities (only ANSI compilers
|
||||
* should do this, and only if the library supports it).
|
||||
* USE_VARARGS means use the <varargs.h> facilities. Again, this should only
|
||||
* be done if the library supports it. ANSI is *not* required for this.
|
||||
* Otherwise, the kludgy old methods are used.
|
||||
* The defaults are USE_STDARG for ANSI compilers, and USE_OLDARGS for
|
||||
* others.
|
||||
*/
|
||||
|
||||
/* #define USE_VARARGS */ /* use <varargs.h> instead of <stdarg.h> */
|
||||
/* #define USE_OLDARGS */ /* don't use any variable argument facilites */
|
||||
|
||||
#if defined(apollo) /* Apollos have stdarg(3) but not stdarg.h */
|
||||
# define USE_VARARGS
|
||||
#endif
|
||||
|
||||
#if defined(NHSTDC) || defined(ULTRIX_PROTO) || defined(MAC)
|
||||
# if !defined(USE_VARARGS) && !defined(USE_OLDARGS) && !defined(USE_STDARG)
|
||||
# define USE_STDARG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_VARARGS /* only define these if necessary */
|
||||
/*
|
||||
* These have changed since 3.4.3. VA_END() now provides an explicit
|
||||
|
@ -85,42 +62,17 @@ void foo VA_DECL(int, arg) --macro expansion has a hidden opening brace
|
|||
* potentially trickier, but nethack uses it in a straightforward manner.
|
||||
*/
|
||||
|
||||
#ifdef USE_STDARG
|
||||
#include <stdarg.h>
|
||||
# define VA_DECL(typ1,var1) (typ1 var1, ...) { va_list the_args;
|
||||
# define VA_DECL2(typ1,var1,typ2,var2) \
|
||||
#define VA_DECL(typ1,var1) (typ1 var1, ...) { va_list the_args;
|
||||
#define VA_DECL2(typ1,var1,typ2,var2) \
|
||||
(typ1 var1, typ2 var2, ...) { va_list the_args;
|
||||
# define VA_INIT(var1,typ1)
|
||||
# define VA_NEXT(var1,typ1) var1 = va_arg(the_args, typ1)
|
||||
# define VA_ARGS the_args
|
||||
# define VA_START(x) va_start(the_args, x)
|
||||
# define VA_END() va_end(the_args); }
|
||||
# if defined(ULTRIX_PROTO) && !defined(_VA_LIST_)
|
||||
# define _VA_LIST_ /* prevents multiple def in stdio.h */
|
||||
# endif
|
||||
#else
|
||||
# ifdef USE_VARARGS
|
||||
#include <varargs.h>
|
||||
# define VA_DECL(typ1,var1) (va_alist) va_dcl {\
|
||||
va_list the_args; typ1 var1;
|
||||
# define VA_DECL2(typ1,var1,typ2,var2) (va_alist) va_dcl {\
|
||||
va_list the_args; typ1 var1; typ2 var2;
|
||||
# define VA_ARGS the_args
|
||||
# define VA_START(x) va_start(the_args)
|
||||
# define VA_INIT(var1,typ1) var1 = va_arg(the_args, typ1)
|
||||
# define VA_NEXT(var1,typ1) var1 = va_arg(the_args,typ1)
|
||||
# define VA_END() va_end(the_args); }
|
||||
# else
|
||||
# define VA_ARGS arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9
|
||||
# define VA_DECL(typ1,var1) (var1,VA_ARGS) typ1 var1; \
|
||||
char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
|
||||
# define VA_DECL2(typ1,var1,typ2,var2) (var1,var2,VA_ARGS) \
|
||||
typ1 var1; typ2 var2;\
|
||||
char *arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8,*arg9; {
|
||||
# define VA_START(x)
|
||||
# define VA_INIT(var1,typ1)
|
||||
# define VA_END() }
|
||||
# endif
|
||||
#define VA_INIT(var1,typ1)
|
||||
#define VA_NEXT(var1,typ1) var1 = va_arg(the_args, typ1)
|
||||
#define VA_ARGS the_args
|
||||
#define VA_START(x) va_start(the_args, x)
|
||||
#define VA_END() va_end(the_args); }
|
||||
#if defined(ULTRIX_PROTO) && !defined(_VA_LIST_)
|
||||
# define _VA_LIST_ /* prevents multiple def in stdio.h */
|
||||
#endif
|
||||
|
||||
#endif /* NEED_VARARGS */
|
||||
|
@ -143,11 +95,7 @@ void foo VA_DECL(int, arg) --macro expansion has a hidden opening brace
|
|||
|
||||
# define FDECL(f,p) f p
|
||||
|
||||
# if defined(MSDOS) || defined(USE_STDARG)
|
||||
# define VDECL(f,p) f p
|
||||
# else
|
||||
# define VDECL(f,p) f()
|
||||
# endif
|
||||
# define VDECL(f,p) f p
|
||||
|
||||
/* generic pointer, always a macro; genericptr_t is usually a typedef */
|
||||
# define genericptr void *
|
||||
|
|
|
@ -1,265 +0,0 @@
|
|||
/* SCCS Id: @(#)vmsconf.h 3.4 2003/05/19 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifdef VMS
|
||||
#ifndef VMSCONF_H
|
||||
#define VMSCONF_H
|
||||
|
||||
/*
|
||||
* Edit these to choose values appropriate for your site.
|
||||
* WIZARD is the username allowed to use the debug option of nethack; no harm
|
||||
* is done by leaving it as a username that doesn't exist at your site.
|
||||
* HACKDIR can be overridden at run-time with the logical name HACKDIR, as in
|
||||
* $ define hackdir disk$users:[games.nethack]
|
||||
* Trailing NULs are present in the default values in order to make some
|
||||
* extra room for patching longer values into an existing executable.
|
||||
*/
|
||||
#define Local_WIZARD "NHWIZARD\0\0\0\0"
|
||||
#define Local_HACKDIR "DISK$USERS:[GAMES.NETHACK.3_4_X.PLAY]\0\0\0\0\0\0\0\0"
|
||||
|
||||
/*
|
||||
* This section cleans up the stuff done in config.h so that it
|
||||
* shouldn't need to be modified. It's conservative so that if
|
||||
* config.h is actually edited, the changes won't impact us.
|
||||
*/
|
||||
#ifdef UNIX
|
||||
# undef UNIX
|
||||
#endif
|
||||
#ifdef HACKDIR
|
||||
# undef HACKDIR
|
||||
#endif
|
||||
#ifdef WIZARD
|
||||
# undef WIZARD
|
||||
#endif
|
||||
#ifdef WIZARD_NAME
|
||||
# undef WIZARD_NAME
|
||||
#endif
|
||||
#define HACKDIR Local_HACKDIR
|
||||
#ifndef KR1ED
|
||||
# define WIZARD Local_WIZARD
|
||||
# define WIZARD_NAME WIZARD
|
||||
#else
|
||||
# define WIZARD 1
|
||||
# define WIZARD_NAME Local_WIZARD
|
||||
#endif
|
||||
|
||||
/* filenames require punctuation to avoid redirection via logical names */
|
||||
#undef RECORD
|
||||
#define RECORD "record;1" /* scoreboard file (retains high scores) */
|
||||
#undef LOGFILE
|
||||
#define LOGFILE "logfile;0" /* optional file (records all games) */
|
||||
|
||||
#define HLOCK "perm;1" /* an empty file used for locking purposes */
|
||||
|
||||
/* want compression--for level & save files--performed within NetHack itself */
|
||||
#ifdef COMPRESS
|
||||
# undef COMPRESS
|
||||
#endif
|
||||
#ifndef INTERNAL_COMP
|
||||
# define INTERNAL_COMP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If nethack.exe will be installed with privilege so that the playground
|
||||
* won't need to be left unprotected, define SECURE to suppress a couple
|
||||
* of file protection fixups (protection of bones files and ownership of
|
||||
* save files).
|
||||
*/
|
||||
/* #define SECURE */
|
||||
|
||||
/*
|
||||
* Put the readonly data files into a single container rather than into
|
||||
* separate files in the playground directory.
|
||||
*/
|
||||
#define DLB /* use data librarian code */
|
||||
|
||||
/*
|
||||
* You may define TEXTCOLOR if your system has any terminals that recognize
|
||||
* ANSI color sequences of the form ``<ESCAPE>[#;#m'', where the first # is
|
||||
* a number between 40 and 47 represented background color, and the second
|
||||
* # is a number between 30 and 37 representing the foreground color.
|
||||
* GIGI terminals and DECterm windows on color VAXstations support these
|
||||
* color escape sequences, as do some 3rd party terminals and many micro
|
||||
* computers.
|
||||
*/
|
||||
/* #define TEXTCOLOR */
|
||||
|
||||
/*
|
||||
* If you define USE_QIO_INPUT, then you'll get raw characters from the
|
||||
* keyboard, not unlike those of the unix version of Nethack. This will
|
||||
* allow you to use the Escape key in normal gameplay, and the appropriate
|
||||
* control characters in Wizard mode. It will work most like the unix version.
|
||||
* It will also avoid "<interrupt>" being displayed when ^Y is pressed.
|
||||
*
|
||||
* Otherwise, the VMS SMG calls will be used. These calls block use of
|
||||
* the escape key, as well as certain control keys, so gameplay is not
|
||||
* the same, although the differences are fairly negligible. You must
|
||||
* then use a VTxxx function key or two <escape>s to give an ESC response.
|
||||
*/
|
||||
#define USE_QIO_INPUT /* use SYS$QIOW instead of SMG$READ_KEYSTROKE */
|
||||
|
||||
/*
|
||||
* Allow the user to decide whether to pause via timer or excess screen
|
||||
* output for various display effects like explosions and moving objects.
|
||||
*/
|
||||
#define TIMED_DELAY /* enable the `timed_delay' run-time option */
|
||||
|
||||
/*
|
||||
* If you define MAIL, then NetHack will capture incoming broadcast
|
||||
* messages such as "New mail from so-and-so" and "Print job completed,"
|
||||
* and then deliver them to the player. For mail and phone broadcasts
|
||||
* a scroll of mail will be created, which when read will cause NetHack
|
||||
* to prompt the player for a command to spawn in order to respond. The
|
||||
* latter capability will not be available if SHELL is disabled below.
|
||||
* If you undefine MAIL, broadcasts will go straight to the terminal,
|
||||
* resulting in disruption of the screen display; use <ctrl/R> to redraw.
|
||||
*/
|
||||
#define MAIL /* enable broadcast trapping */
|
||||
|
||||
/*
|
||||
* SHELL enables the player to 'escape' into a spawned subprocess via
|
||||
* the '!' command. Logout or attach back to the parent to resume play.
|
||||
* If the player attaches back to NetHack, then a subsequent escape will
|
||||
* re-attach to the existing subprocess. Any such subprocess left over
|
||||
* at game exit will be deleted by an exit handler.
|
||||
* SUSPEND enables someone running NetHack in a subprocess to reconnect
|
||||
* to the parent process with the <ctrl/Z> command; this is not very
|
||||
* close to Unix job control, but it's better than nothing.
|
||||
*/
|
||||
#define SHELL /* do not delete the '!' command */
|
||||
#define SUSPEND /* don't delete the ^Z command, such as it is */
|
||||
|
||||
#define RANDOM /* use sys/share/random.c instead of vaxcrtl rand */
|
||||
|
||||
#define FCMASK 0660 /* file creation mask */
|
||||
|
||||
|
||||
/*
|
||||
* The remainder of the file should not need to be changed.
|
||||
*/
|
||||
|
||||
/* data librarian defs */
|
||||
#ifdef DLB
|
||||
# define DLBFILE "nh-data.dlb"
|
||||
/*
|
||||
* Since we can do without case insensitive filename comparison,
|
||||
* avoid enabling it because that requires compiling and linking
|
||||
* src/hacklib into util/dlb_main.
|
||||
*/
|
||||
/* # define FILENAME_CMP strcmpi */ /* case insensitive */
|
||||
#endif
|
||||
|
||||
#if defined(VAXC) && !defined(ANCIENT_VAXC)
|
||||
# ifdef volatile
|
||||
# undef volatile
|
||||
# endif
|
||||
# ifdef const
|
||||
# undef const
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __DECC
|
||||
# define STRICT_REF_DEF /* used in lev_main.c */
|
||||
#endif
|
||||
#ifdef STRICT_REF_DEF
|
||||
# define DEFINE_OSPEED
|
||||
#endif
|
||||
|
||||
#ifndef alloca
|
||||
/* bison generated foo_yacc.c might try to use alloca() */
|
||||
# ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
# else
|
||||
# define ALLOCA_HACK /* used in util/panic.c */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _DECC_V4_SOURCE
|
||||
/* <types.h> excludes some necessary typedefs when _DECC_V4_SOURCE is defined */
|
||||
#include <types.h>
|
||||
# ifndef __PID_T
|
||||
# define __PID_T
|
||||
typedef __pid_t pid_t;
|
||||
# endif
|
||||
# ifndef __UID_T
|
||||
# define __UID_T
|
||||
typedef __uid_t uid_t;
|
||||
# endif
|
||||
# ifndef __GID_T
|
||||
# define __GID_T
|
||||
typedef __gid_t gid_t;
|
||||
# endif
|
||||
# ifndef __MODE_T
|
||||
# define __MODE_T
|
||||
typedef __mode_t mode_t;
|
||||
# endif
|
||||
#endif /* _DECC_V4_SOURCE */
|
||||
|
||||
#include <time.h>
|
||||
#if 0 /* <file.h> is missing for old gcc versions; skip it to save time */
|
||||
#include <file.h>
|
||||
#else /* values needed from missing include file */
|
||||
# define O_RDONLY 0
|
||||
# define O_WRONLY 1
|
||||
# define O_RDWR 2
|
||||
# define O_CREAT 0x200
|
||||
# define O_TRUNC 0x400
|
||||
#endif
|
||||
|
||||
#ifndef REDO
|
||||
# define Getchar nhgetch
|
||||
#endif
|
||||
#define tgetch vms_getchar
|
||||
|
||||
#include "system.h"
|
||||
|
||||
#define index strchr
|
||||
#define rindex strrchr
|
||||
|
||||
/* Use the high quality random number routines. */
|
||||
#if defined(RANDOM)
|
||||
#define Rand() random()
|
||||
/* VMS V7 adds these entry points to DECC$SHR; stick with the nethack-supplied
|
||||
code to avoid having to deal with version-specific conditionalized builds */
|
||||
#define random nh_random
|
||||
#define srandom nh_srandom
|
||||
#define initstate nh_initstate
|
||||
#define setstate nh_setstate
|
||||
#else
|
||||
#define Rand() rand()
|
||||
#endif
|
||||
|
||||
#ifndef __GNUC__
|
||||
# ifndef bcopy
|
||||
#define bcopy(s,d,n) memcpy((d),(s),(n)) /* vaxcrtl */
|
||||
# endif
|
||||
#endif
|
||||
#define abort() vms_abort() /* vmsmisc.c */
|
||||
#define creat(f,m) vms_creat(f,m) /* vmsfiles.c */
|
||||
#define exit(sts) vms_exit(sts) /* vmsmisc.c */
|
||||
#define getuid() vms_getuid() /* vmsunix.c */
|
||||
#define link(f1,f2) vms_link(f1,f2) /* vmsfiles.c */
|
||||
#define open(f,k,m) vms_open(f,k,m) /* vmsfiles.c */
|
||||
/* #define unlink(f0) vms_unlink(f0) /* vmsfiles.c */
|
||||
#ifdef VERYOLD_VMS
|
||||
#define unlink(f0) delete(f0) /* vaxcrtl */
|
||||
#else
|
||||
#define unlink(f0) remove(f0) /* vaxcrtl, decc$shr */
|
||||
#endif
|
||||
#define C$$TRANSLATE(n) c__translate(n) /* vmsfiles.c */
|
||||
|
||||
/* VMS global names are case insensitive... */
|
||||
#define An vms_an
|
||||
#define The vms_the
|
||||
#define Shk_Your vms_shk_your
|
||||
|
||||
/* avoid global symbol in Alpha/VMS V1.5 STARLET library (link trouble) */
|
||||
#define ospeed vms_ospeed
|
||||
|
||||
/* used in several files which don't #include "extern.h" */
|
||||
extern void FDECL(vms_exit, (int));
|
||||
extern int FDECL(vms_open, (const char *,int,unsigned));
|
||||
|
||||
#endif /* VMSCONF_H */
|
||||
#endif /* VMS */
|
|
@ -1,354 +0,0 @@
|
|||
/* Copyright (C) 2001 by Alex Kompel <shurikk@pacbell.net> */
|
||||
/* Copyright (c) NetHack PC Development Team 1993, 1994. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef WCECONF_H
|
||||
#define WCECONF_H
|
||||
|
||||
#pragma warning(disable:4142) /* benign redefinition of type */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
/* Detect the targe device */
|
||||
#if defined(WIN32_PLATFORM_PSPC)
|
||||
# if _WIN32_WCE >= 300
|
||||
# define WIN_CE_POCKETPC
|
||||
# else
|
||||
# define WIN_CE_PS2xx
|
||||
# endif
|
||||
#elif defined(WIN32_PLATFORM_HPCPRO)
|
||||
# define WIN_CE_HPCPRO
|
||||
#elif defined(WIN32_PLATFORM_WFSP)
|
||||
# define WIN_CE_SMARTPHONE
|
||||
#else
|
||||
# error "Unsupported Windows CE platform"
|
||||
#endif
|
||||
|
||||
/* #define SHELL /* nt use of pcsys routines caused a hang */
|
||||
|
||||
#define RANDOM /* have Berkeley random(3) */
|
||||
#define TEXTCOLOR /* Color text */
|
||||
|
||||
#define EXEPATH /* Allow .exe location to be used as HACKDIR */
|
||||
#define TRADITIONAL_GLYPHMAP /* Store glyph mappings at level change time */
|
||||
|
||||
#define PC_LOCKING /* Prevent overwrites of aborted or in-progress games */
|
||||
/* without first receiving confirmation. */
|
||||
|
||||
#define SELF_RECOVER /* Allow the game itself to recover from an aborted game */
|
||||
|
||||
#define NOTSTDC /* no strerror() */
|
||||
|
||||
#define USER_SOUNDS
|
||||
|
||||
#define AUTOPICKUP_EXCEPTIONS
|
||||
|
||||
/*
|
||||
* -----------------------------------------------------------------
|
||||
* The remaining code shouldn't need modification.
|
||||
* -----------------------------------------------------------------
|
||||
*/
|
||||
/* #define SHORT_FILENAMES /* All NT filesystems support long names now */
|
||||
|
||||
#ifdef MICRO
|
||||
#undef MICRO /* never define this! */
|
||||
#endif
|
||||
|
||||
#define NOCWD_ASSUMPTIONS /* Always define this. There are assumptions that
|
||||
it is defined for WIN32.
|
||||
Allow paths to be specified for HACKDIR,
|
||||
LEVELDIR, SAVEDIR, BONESDIR, DATADIR,
|
||||
SCOREDIR, LOCKDIR, CONFIGDIR, and TROUBLEDIR */
|
||||
#define NO_TERMS
|
||||
#define ASCIIGRAPH
|
||||
|
||||
#ifdef OPTIONS_USED
|
||||
#undef OPTIONS_USED
|
||||
#endif
|
||||
#ifdef MSWIN_GRAPHICS
|
||||
#define OPTIONS_USED "guioptions"
|
||||
#else
|
||||
#define OPTIONS_USED "ttyoptions"
|
||||
#endif
|
||||
#define OPTIONS_FILE OPTIONS_USED
|
||||
|
||||
#define PORT_HELP "porthelp"
|
||||
|
||||
#if defined(WIN_CE_POCKETPC)
|
||||
# define PORT_CE_PLATFORM "Pocket PC"
|
||||
#elif defined(WIN_CE_PS2xx)
|
||||
# define PORT_CE_PLATFORM "Palm-size PC 2.11"
|
||||
#elif defined(WIN_CE_HPCPRO)
|
||||
# define PORT_CE_PLATFORM "H/PC Pro 2.11"
|
||||
#elif defined(WIN_CE_SMARTPHONE)
|
||||
# define PORT_CE_PLATFORM "Smartphone 2002"
|
||||
#endif
|
||||
|
||||
#if defined(ARM)
|
||||
# define PORT_CE_CPU "ARM"
|
||||
#elif defined(PPC)
|
||||
# define PORT_CE_CPU "PPC"
|
||||
#elif defined(ALPHA)
|
||||
# define PORT_CE_CPU "ALPHA"
|
||||
#elif defined(SH3)
|
||||
# define PORT_CE_CPU "SH3"
|
||||
#elif defined(SH4)
|
||||
# define PORT_CE_CPU "SH4"
|
||||
#elif defined(MIPS)
|
||||
# define PORT_CE_CPU "MIPS"
|
||||
#elif defined(X86) || defined(_X86_)
|
||||
# define PORT_CE_CPU "X86"
|
||||
#else
|
||||
# error Only ARM, PPC, ALPHA, SH3, SH4, MIPS and X86 supported
|
||||
#endif
|
||||
|
||||
#define RUNTIME_PORT_ID /* trigger run-time port identification since
|
||||
Makedefs is bootstrapped on a cross-platform. */
|
||||
|
||||
#include <string.h> /* Provides prototypes of strncmpi(), etc. */
|
||||
#ifdef STRNCMPI
|
||||
#define strncmpi(a,b,c) _strnicmp(a,b,c)
|
||||
#endif
|
||||
|
||||
#ifdef STRCMPI
|
||||
#define strcmpi(a,b) _stricmp(a,b)
|
||||
#define stricmp(a,b) _stricmp(a,b)
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define PATHLEN BUFSZ /* maximum pathlength */
|
||||
#define FILENAME BUFSZ /* maximum filename length (conservative) */
|
||||
|
||||
#if defined(_MAX_PATH) && defined(_MAX_FNAME)
|
||||
# if (_MAX_PATH < BUFSZ) && (_MAX_FNAME < BUFSZ)
|
||||
#undef PATHLEN
|
||||
#undef FILENAME
|
||||
#define PATHLEN _MAX_PATH
|
||||
#define FILENAME _MAX_FNAME
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#define NO_SIGNAL
|
||||
#define index strchr
|
||||
#define rindex strrchr
|
||||
#define USE_STDARG
|
||||
#ifdef RANDOM
|
||||
/* Use the high quality random number routines. */
|
||||
#define Rand() random()
|
||||
#else
|
||||
#define Rand() rand()
|
||||
#endif
|
||||
|
||||
#define FCMASK 0660 /* file creation mask */
|
||||
#define regularize nt_regularize
|
||||
#define HLOCK "NHPERM"
|
||||
|
||||
#ifndef M
|
||||
#define M(c) ((char) (0x80 | (c)))
|
||||
/* #define M(c) ((c) - 128) */
|
||||
#endif
|
||||
|
||||
#ifndef C
|
||||
#define C(c) (0x1f & (c))
|
||||
#endif
|
||||
|
||||
#if defined(DLB)
|
||||
#define FILENAME_CMP _stricmp /* case insensitive */
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
extern char levels[], bones[], permbones[],
|
||||
#endif /* 0 */
|
||||
|
||||
/* this was part of the MICRO stuff in the past */
|
||||
extern const char *alllevels, *allbones;
|
||||
extern char hackdir[];
|
||||
#define ABORT C('a')
|
||||
#define getuid() 1
|
||||
#define getlogin() ((char *)0)
|
||||
extern void NDECL(win32_abort);
|
||||
#ifdef WIN32CON
|
||||
extern void FDECL(nttty_preference_update, (const char *));
|
||||
extern void NDECL(toggle_mouse_support);
|
||||
#endif
|
||||
|
||||
#ifndef alloca
|
||||
#define ALLOCA_HACK /* used in util/panic.c */
|
||||
#endif
|
||||
|
||||
#ifndef REDO
|
||||
#undef Getchar
|
||||
#define Getchar nhgetch
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if 0
|
||||
#pragma warning(disable:4018) /* signed/unsigned mismatch */
|
||||
#pragma warning(disable:4305) /* init, conv from 'const int' to 'char' */
|
||||
#endif
|
||||
#pragma warning(disable:4761) /* integral size mismatch in arg; conv supp*/
|
||||
#ifdef YYPREFIX
|
||||
#pragma warning(disable:4102) /* unreferenced label */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* UNICODE stuff */
|
||||
#define NHSTR_BUFSIZE 512
|
||||
#ifdef UNICODE
|
||||
#define NH_W2A(w, a, cb) ( WideCharToMultiByte( \
|
||||
CP_ACP, \
|
||||
0, \
|
||||
(w), \
|
||||
-1, \
|
||||
(a), \
|
||||
(cb), \
|
||||
NULL, \
|
||||
NULL), (a) )
|
||||
|
||||
#define NH_A2W(a, w, cb) ( MultiByteToWideChar( \
|
||||
CP_ACP, \
|
||||
0, \
|
||||
(a), \
|
||||
-1, \
|
||||
(w), \
|
||||
(cb)), (w) )
|
||||
#else
|
||||
#define NH_W2A(w, a, cb) (strncpy((a), (w), (cb)))
|
||||
|
||||
#define NH_A2W(a, w, cb) (strncpy((w), (a), (cb)))
|
||||
#endif
|
||||
|
||||
extern int FDECL(set_win32_option, (const char *, const char *));
|
||||
|
||||
/*
|
||||
* 3.4.3 addition - Stuff to help the user with some common, yet significant errors
|
||||
* Let's make it NOP for now
|
||||
*/
|
||||
#define interject_assistance(_1,_2,_3,_4)
|
||||
#define interject(_1)
|
||||
|
||||
/* Missing definitions */
|
||||
extern int mswin_have_input();
|
||||
#define kbhit mswin_have_input
|
||||
|
||||
#define getenv(a) ((char*)NULL)
|
||||
|
||||
/* __stdio.h__ */
|
||||
#define perror(a)
|
||||
#define freopen(a, b, c) fopen(a, b)
|
||||
extern int isatty(int);
|
||||
|
||||
/* __time.h___ */
|
||||
#ifndef _TIME_T_DEFINED
|
||||
typedef __int64 time_t; /* time value */
|
||||
#define _TIME_T_DEFINED /* avoid multiple def's of time_t */
|
||||
#endif
|
||||
|
||||
#ifndef _TM_DEFINED
|
||||
struct tm {
|
||||
int tm_sec; /* seconds after the minute - [0,59] */
|
||||
int tm_min; /* minutes after the hour - [0,59] */
|
||||
int tm_hour; /* hours since midnight - [0,23] */
|
||||
int tm_mday; /* day of the month - [1,31] */
|
||||
int tm_mon; /* months since January - [0,11] */
|
||||
int tm_year; /* years since 1900 */
|
||||
int tm_wday; /* days since Sunday - [0,6] */
|
||||
int tm_yday; /* days since January 1 - [0,365] */
|
||||
int tm_isdst; /* daylight savings time flag - - NOT IMPLEMENTED */
|
||||
};
|
||||
#define _TM_DEFINED
|
||||
#endif
|
||||
|
||||
extern struct tm * __cdecl localtime(const time_t *);
|
||||
extern time_t __cdecl time(time_t *);
|
||||
|
||||
/* __stdio.h__ */
|
||||
#ifndef BUFSIZ
|
||||
#define BUFSIZ 255
|
||||
#endif
|
||||
|
||||
#define rewind(stream) (void)fseek( stream, 0L, SEEK_SET )
|
||||
|
||||
/* __io.h__ */
|
||||
typedef long off_t;
|
||||
|
||||
extern int __cdecl close(int);
|
||||
extern int __cdecl creat(const char *, int);
|
||||
extern int __cdecl eof(int);
|
||||
extern long __cdecl lseek(int, long, int);
|
||||
extern int __cdecl open(const char *, int, ...);
|
||||
extern int __cdecl read(int, void *, unsigned int);
|
||||
extern int __cdecl unlink(const char *);
|
||||
extern int __cdecl write(int, const void *, unsigned int);
|
||||
extern int __cdecl rename(const char *, const char *);
|
||||
extern int __cdecl access(const char *, int);
|
||||
|
||||
#ifdef DeleteFile
|
||||
#undef DeleteFile
|
||||
#endif
|
||||
#define DeleteFile(a) unlink(a)
|
||||
|
||||
int chdir( const char *dirname );
|
||||
extern char *getcwd( char *buffer, int maxlen );
|
||||
|
||||
/* __stdlib.h__ */
|
||||
#define abort() (void)TerminateProcess(GetCurrentProcess(), 0)
|
||||
#ifndef strdup
|
||||
#define strdup _strdup
|
||||
#endif
|
||||
|
||||
/* sys/stat.h */
|
||||
#define S_IWRITE GENERIC_WRITE
|
||||
#define S_IREAD GENERIC_READ
|
||||
|
||||
|
||||
/* CE 2.xx is missing even more stuff */
|
||||
#if defined(WIN_CE_PS2xx) || defined(WIN32_PLATFORM_HPCPRO)
|
||||
#define ZeroMemory(p, s) memset((p), 0, (s))
|
||||
|
||||
extern int __cdecl isupper(int c);
|
||||
extern int __cdecl isdigit(int c);
|
||||
extern int __cdecl isspace(int c);
|
||||
extern int __cdecl isprint(int c);
|
||||
|
||||
extern char* __cdecl _strdup(const char* s);
|
||||
extern char* __cdecl strrchr( const char *string, int c );
|
||||
extern int __cdecl _stricmp(const char* a, const char* b);
|
||||
|
||||
extern FILE * __cdecl fopen(const char* filename, const char *mode);
|
||||
extern int __cdecl fscanf(FILE *f , const char *format, ...);
|
||||
extern int __cdecl fprintf(FILE *f , const char *format, ...);
|
||||
extern int __cdecl vfprintf(FILE* f, const char *format, va_list args);
|
||||
extern int __cdecl fgetc(FILE * f);
|
||||
extern char * __cdecl fgets(char *s, int size, FILE *f);
|
||||
extern int __cdecl printf(const char *format, ...);
|
||||
extern int __cdecl vprintf(const char *format, va_list args);
|
||||
extern int __cdecl puts(const char * s);
|
||||
extern FILE* __cdecl _getstdfilex(int desc);
|
||||
extern int __cdecl fclose(FILE * f);
|
||||
extern size_t __cdecl fread(void *p, size_t size, size_t count, FILE *f);
|
||||
extern size_t __cdecl fwrite(const void *p, size_t size, size_t count, FILE * f);
|
||||
extern int __cdecl fflush(FILE *f);
|
||||
extern int __cdecl feof(FILE *f);
|
||||
extern int __cdecl fseek(FILE *f, long offset, int from);
|
||||
extern long __cdecl ftell(FILE * f);
|
||||
|
||||
#endif
|
||||
|
||||
/* ARM - the processor; avoids conflict with ARM in hack.h */
|
||||
# ifdef ARM
|
||||
# undef ARM
|
||||
# endif
|
||||
|
||||
/* leave - Windows CE defines leave as part of exception handling (__leave)
|
||||
It confilicts with existing sources and since we don't use exceptions it is safe
|
||||
to undefine it */
|
||||
# ifdef leave
|
||||
# undef leave
|
||||
# endif
|
||||
|
||||
#endif /* WCECONF_H */
|
|
@ -1,18 +0,0 @@
|
|||
/* SCCS Id: @(#)winGnome.h 3.4. 2000/07/16 */
|
||||
/* Copyright (C) 1998 by Erik Andersen <andersee@debian.org> */
|
||||
/* Copyright (C) 1998 by Anthony Taylor <tonyt@ptialaska.net> */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef WINGNOME_H
|
||||
#define WINGNOME_H
|
||||
|
||||
#define E extern
|
||||
|
||||
E struct window_procs Gnome_procs;
|
||||
|
||||
#undef E
|
||||
|
||||
#define NHW_WORN 6
|
||||
extern winid WIN_WORN;
|
||||
|
||||
#endif /* WINGNOME_H */
|
411
include/winX.h
411
include/winX.h
|
@ -1,411 +0,0 @@
|
|||
/* SCCS Id: @(#)winX.h 3.4 1996/08/18 */
|
||||
/* Copyright (c) Dean Luick, 1992 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
/*
|
||||
* Definitions for the X11 window-port. See doc/window.doc for details on
|
||||
* the window interface.
|
||||
*/
|
||||
#ifndef WINX_H
|
||||
#define WINX_H
|
||||
|
||||
#ifndef E
|
||||
#define E extern
|
||||
#endif
|
||||
|
||||
#if defined(BOS) || defined(NHSTDC)
|
||||
#define DIMENSION_P int
|
||||
#else
|
||||
# ifdef WIDENED_PROTOTYPES
|
||||
#define DIMENSION_P unsigned int
|
||||
# else
|
||||
#define DIMENSION_P Dimension
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generic text buffer.
|
||||
*/
|
||||
#define START_SIZE 512 /* starting text buffer size */
|
||||
struct text_buffer {
|
||||
char *text;
|
||||
int text_size;
|
||||
int text_last;
|
||||
int num_lines;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Information specific to a map window.
|
||||
*/
|
||||
struct text_map_info_t {
|
||||
unsigned char text[ROWNO][COLNO]; /* Actual displayed screen. */
|
||||
#ifdef TEXTCOLOR
|
||||
unsigned char colors[ROWNO][COLNO]; /* Color of each character. */
|
||||
GC color_gcs[CLR_MAX], /* GC for each color */
|
||||
inv_color_gcs[CLR_MAX]; /* GC for each inverse color */
|
||||
#define copy_gc color_gcs[NO_COLOR]
|
||||
#define inv_copy_gc inv_color_gcs[NO_COLOR]
|
||||
#else
|
||||
GC copy_gc, /* Drawing GC */
|
||||
inv_copy_gc; /* Inverse drawing GC */
|
||||
#endif
|
||||
};
|
||||
|
||||
struct tile_map_info_t {
|
||||
unsigned short glyphs[ROWNO][COLNO]; /* Saved glyph numbers. */
|
||||
GC white_gc;
|
||||
GC black_gc;
|
||||
unsigned long image_width; /* dimensions of tile image */
|
||||
unsigned long image_height;
|
||||
};
|
||||
|
||||
struct map_info_t {
|
||||
Dimension viewport_width, /* Saved viewport size, so we can */
|
||||
viewport_height; /* clip to cursor on a resize. */
|
||||
unsigned char t_start[ROWNO], /* Starting column for new info. */
|
||||
t_stop[ROWNO]; /* Ending column for new info. */
|
||||
int square_width, /* Saved font/tile information so */
|
||||
square_height, /* we can calculate the correct */
|
||||
square_ascent, /* placement of changes. */
|
||||
square_lbearing;
|
||||
boolean is_tile;
|
||||
union {
|
||||
struct text_map_info_t *text_map;
|
||||
struct tile_map_info_t *tile_map;
|
||||
} mtype;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Information specific to a message window.
|
||||
*/
|
||||
struct line_element {
|
||||
struct line_element *next;
|
||||
char *line; /* char buffer */
|
||||
int buf_length; /* length of buffer */
|
||||
int str_length; /* length of string in buffer */
|
||||
};
|
||||
|
||||
struct mesg_info_t {
|
||||
XFontStruct *fs; /* Font for the window. */
|
||||
int num_lines; /* line count */
|
||||
struct line_element *head; /* head of circular line queue */
|
||||
struct line_element *line_here;/* current drawn line position */
|
||||
struct line_element *last_pause;/* point to the line after the prev */
|
||||
/* bottom of screen */
|
||||
struct line_element *last_pause_head;/* pointer to head of previous */
|
||||
/* turn */
|
||||
GC gc; /* GC for text drawing */
|
||||
int char_width, /* Saved font information so we can */
|
||||
char_height, /* calculate the correct placement */
|
||||
char_ascent, /* of changes. */
|
||||
char_lbearing;
|
||||
Dimension viewport_width, /* Saved viewport size, so we can adjust */
|
||||
viewport_height;/* the slider on a resize. */
|
||||
Boolean dirty; /* Lines have been added to the window. */
|
||||
};
|
||||
|
||||
/*
|
||||
* Information specific to a "text" status window.
|
||||
*/
|
||||
struct status_info_t {
|
||||
struct text_buffer text; /* Just a text buffer. */
|
||||
};
|
||||
|
||||
/*
|
||||
* Information specific to a menu window. First a structure for each
|
||||
* menu entry, then the structure for each menu window.
|
||||
*/
|
||||
typedef struct x11_mi {
|
||||
struct x11_mi *next;
|
||||
anything identifier; /* Opaque type to identify this selection */
|
||||
long pick_count; /* specific selection count; -1 if none */
|
||||
char *str; /* The text of the item. */
|
||||
int attr; /* Attribute for the line. */
|
||||
boolean selected; /* Been selected? */
|
||||
char selector; /* Char used to select this entry. */
|
||||
char gselector; /* Group selector. */
|
||||
} x11_menu_item;
|
||||
|
||||
struct menu {
|
||||
x11_menu_item *base; /* Starting pointer for item list. */
|
||||
x11_menu_item *last; /* End pointer for item list. */
|
||||
const char *query; /* Query string. */
|
||||
const char *gacc; /* Group accelerators. */
|
||||
int count; /* Number of strings. */
|
||||
String *list_pointer;/* String list. */
|
||||
Boolean *sensitive; /* Active list. */
|
||||
char curr_selector;/* Next keyboard accelerator to assign, */
|
||||
/* if 0, then we're out. */
|
||||
};
|
||||
|
||||
struct menu_info_t {
|
||||
struct menu curr_menu; /* Menu being displayed. */
|
||||
struct menu new_menu; /* New menu being built. */
|
||||
|
||||
XFontStruct *fs; /* Font for the window. */
|
||||
long menu_count; /* number entered by user */
|
||||
Dimension line_height; /* Total height of a line of text. */
|
||||
Dimension internal_height; /* Internal height between widget & border */
|
||||
Dimension internal_width; /* Internal width between widget & border */
|
||||
short how; /* Menu mode PICK_NONE, PICK_ONE, PICK_ANY */
|
||||
boolean valid_widgets; /* TRUE if widgets have been created. */
|
||||
boolean is_menu; /* Has been confirmed to being a menu window. */
|
||||
boolean is_active; /* TRUE when waiting for user input. */
|
||||
boolean is_up; /* TRUE when window is popped-up. */
|
||||
boolean cancelled; /* Menu has been explicitly cancelled. */
|
||||
boolean counting; /* true when menu_count has a valid value */
|
||||
};
|
||||
|
||||
/*
|
||||
* Information specific to a text window.
|
||||
*/
|
||||
struct text_info_t {
|
||||
struct text_buffer text;
|
||||
XFontStruct *fs; /* Font for the text window. */
|
||||
int max_width; /* Width of widest line so far. */
|
||||
int extra_width, /* Sum of left and right border widths. */
|
||||
extra_height; /* Sum of top and bottom border widths. */
|
||||
boolean blocked; /* */
|
||||
boolean destroy_on_ack; /* Destroy this window when acknowleged. */
|
||||
#ifdef GRAPHIC_TOMBSTONE
|
||||
boolean is_rip; /* This window needs a tombstone. */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Basic window structure.
|
||||
*/
|
||||
struct xwindow {
|
||||
int type; /* type of nethack window */
|
||||
Widget popup; /* direct parent of widget w or viewport */
|
||||
Widget w; /* the widget that does things */
|
||||
Dimension pixel_width; /* window size, in pixels */
|
||||
Dimension pixel_height;
|
||||
int prevx, cursx; /* Cursor position, only used by */
|
||||
int prevy, cursy; /* map and "plain" status windows.*/
|
||||
|
||||
union {
|
||||
struct map_info_t *Map_info; /* map window info */
|
||||
struct mesg_info_t *Mesg_info; /* message window info */
|
||||
struct status_info_t *Status_info; /* status window info */
|
||||
struct menu_info_t *Menu_info; /* menu window info */
|
||||
struct text_info_t *Text_info; /* menu window info */
|
||||
} Win_info;
|
||||
boolean keep_window;
|
||||
};
|
||||
|
||||
/* Defines to use for the window information union. */
|
||||
#define map_information Win_info.Map_info
|
||||
#define mesg_information Win_info.Mesg_info
|
||||
#define status_information Win_info.Status_info
|
||||
#define menu_information Win_info.Menu_info
|
||||
#define text_information Win_info.Text_info
|
||||
|
||||
|
||||
#define MAX_WINDOWS 20 /* max number of open windows */
|
||||
|
||||
#define NHW_NONE 0 /* Unallocated window type. Must be */
|
||||
/* different from any other NHW_* type. */
|
||||
|
||||
#define NO_CLICK 0 /* No click occured on the map window. Must */
|
||||
/* be different than CLICK_1 and CLICK_2. */
|
||||
|
||||
#define DEFAULT_MESSAGE_WIDTH 60/* width in chars of the message window */
|
||||
|
||||
#define DISPLAY_FILE_SIZE 35 /* Max number of lines in the default */
|
||||
/* file display window. */
|
||||
|
||||
#define MAX_KEY_STRING 64 /* String size for converting a keypress */
|
||||
/* event into a character(s) */
|
||||
|
||||
#define DEFAULT_LINES_DISPLAYED 12 /* # of lines displayed message window */
|
||||
#define MAX_HISTORY 60 /* max history saved on message window */
|
||||
|
||||
|
||||
/* Window variables (winX.c). */
|
||||
E struct xwindow window_list[MAX_WINDOWS];
|
||||
E XtAppContext app_context; /* context of application */
|
||||
E Widget toplevel; /* toplevel widget */
|
||||
E Atom wm_delete_window; /* delete window protocol */
|
||||
E boolean exit_x_event; /* exit condition for event loop */
|
||||
#define EXIT_ON_KEY_PRESS 0 /* valid values for exit_x_event */
|
||||
#define EXIT_ON_KEY_OR_BUTTON_PRESS 1
|
||||
#define EXIT_ON_EXIT 2
|
||||
#define EXIT_ON_SENT_EVENT 3
|
||||
E int click_x, click_y, click_button, updated_inventory;
|
||||
|
||||
typedef struct {
|
||||
Boolean slow;
|
||||
Boolean autofocus;
|
||||
Boolean message_line;
|
||||
Boolean double_tile_size; /* double tile size */
|
||||
String tile_file; /* name of file to open for tiles */
|
||||
String icon; /* name of desired icon */
|
||||
int message_lines; /* number of lines to attempt to show */
|
||||
String pet_mark_bitmap; /* X11 bitmap file used to mark pets */
|
||||
Pixel pet_mark_color; /* color of pet mark */
|
||||
#ifdef GRAPHIC_TOMBSTONE
|
||||
String tombstone; /* name of XPM file for tombstone */
|
||||
int tombtext_x; /* x-coord of center of first tombstone text */
|
||||
int tombtext_y; /* y-coord of center of first tombstone text */
|
||||
int tombtext_dx; /* x-displacement between tombstone line */
|
||||
int tombtext_dy; /* y-displacement between tombstone line */
|
||||
#endif
|
||||
} AppResources;
|
||||
|
||||
E AppResources appResources;
|
||||
E void (*input_func)();
|
||||
|
||||
extern struct window_procs X11_procs;
|
||||
|
||||
/* Check for an invalid window id. */
|
||||
#define check_winid(window) \
|
||||
if ((window) < 0 || (window) >= MAX_WINDOWS) { \
|
||||
panic("illegal windid [%d] in %s at line %d", \
|
||||
window, __FILE__, __LINE__); \
|
||||
}
|
||||
|
||||
|
||||
/* ### dialogs.c ### */
|
||||
E Widget FDECL(CreateDialog, (Widget, String, XtCallbackProc, XtCallbackProc));
|
||||
E void FDECL(SetDialogPrompt,(Widget, String));
|
||||
E String FDECL(GetDialogResponse,(Widget));
|
||||
E void FDECL(SetDialogResponse,(Widget, String));
|
||||
E void FDECL(positionpopup,(Widget,BOOLEAN_P));
|
||||
|
||||
/* ### winX.c ### */
|
||||
E struct xwindow *FDECL(find_widget,(Widget));
|
||||
E Boolean FDECL(nhApproxColor,(Screen*, Colormap, char*, XColor*));
|
||||
E Dimension FDECL(nhFontHeight,(Widget));
|
||||
E char FDECL(key_event_to_char,(XKeyEvent*));
|
||||
E void FDECL(msgkey, (Widget, XtPointer, XEvent*));
|
||||
E void FDECL(nh_XtPopup, (Widget, int, Widget));
|
||||
E void FDECL(nh_XtPopdown, (Widget));
|
||||
E void NDECL(win_X11_init);
|
||||
E void FDECL(nh_keyscroll, (Widget, XEvent*, String*, Cardinal*));
|
||||
|
||||
/* ### winmesg.c ### */
|
||||
E void FDECL(set_message_slider, (struct xwindow*));
|
||||
E void FDECL(create_message_window,(struct xwindow*, BOOLEAN_P, Widget));
|
||||
E void FDECL(destroy_message_window,(struct xwindow*));
|
||||
E void FDECL(display_message_window, (struct xwindow*));
|
||||
E void FDECL(append_message,(struct xwindow*, const char*));
|
||||
E void FDECL(set_last_pause, (struct xwindow*));
|
||||
|
||||
/* ### winmap.c ### */
|
||||
E void NDECL(post_process_tiles);
|
||||
E void FDECL(check_cursor_visibility,(struct xwindow*));
|
||||
E void FDECL(display_map_window,(struct xwindow*));
|
||||
E void FDECL(clear_map_window,(struct xwindow*));
|
||||
E void FDECL(map_input, (Widget, XEvent*, String*, Cardinal*));
|
||||
E void FDECL(set_map_size,(struct xwindow*, DIMENSION_P, DIMENSION_P));
|
||||
E void FDECL(create_map_window,(struct xwindow*, BOOLEAN_P, Widget));
|
||||
E void FDECL(destroy_map_window,(struct xwindow*));
|
||||
E int FDECL(x_event,(int));
|
||||
|
||||
/* ### winmenu.c ### */
|
||||
E void FDECL(menu_delete, (Widget, XEvent*, String*, Cardinal*));
|
||||
E void FDECL(menu_key,(Widget, XEvent*, String*, Cardinal*));
|
||||
E void FDECL(create_menu_window,(struct xwindow*));
|
||||
E void FDECL(destroy_menu_window,(struct xwindow*));
|
||||
|
||||
/* ### winmisc.c ### */
|
||||
E void FDECL(ps_key,(Widget, XEvent*, String*, Cardinal*)); /* player selection action */
|
||||
E void FDECL(race_key,(Widget, XEvent*, String*, Cardinal*)); /* race selection action */
|
||||
E void FDECL(gend_key, (Widget,XEvent *,String *,Cardinal *)); /* gender */
|
||||
E void FDECL(algn_key, (Widget,XEvent *,String *,Cardinal *)); /* alignment */
|
||||
E void FDECL(ec_delete, (Widget, XEvent*, String*, Cardinal*));
|
||||
E void FDECL(ec_key,(Widget, XEvent*, String*, Cardinal*)); /* extended command action */
|
||||
|
||||
/* ### winstatus.c ### */
|
||||
E void FDECL(create_status_window,(struct xwindow*, BOOLEAN_P, Widget));
|
||||
E void FDECL(destroy_status_window,(struct xwindow*));
|
||||
E void FDECL(adjust_status,(struct xwindow*, const char*));
|
||||
E void NDECL(null_out_status);
|
||||
E void NDECL(check_turn_events);
|
||||
|
||||
/* ### wintext.c ### */
|
||||
E void FDECL(delete_text, (Widget, XEvent*, String*, Cardinal*));
|
||||
E void FDECL(dismiss_text,(Widget, XEvent*, String*, Cardinal*));
|
||||
E void FDECL(key_dismiss_text,(Widget, XEvent*, String*, Cardinal*));
|
||||
#ifdef GRAPHIC_TOMBSTONE
|
||||
E void FDECL(rip_dismiss_text,(Widget, XEvent*, String*, Cardinal*));
|
||||
#endif
|
||||
E void FDECL(add_to_text_window,(struct xwindow*, int, const char*));
|
||||
E void FDECL(display_text_window,(struct xwindow*, BOOLEAN_P));
|
||||
E void FDECL(create_text_window,(struct xwindow*));
|
||||
E void FDECL(destroy_text_window,(struct xwindow*));
|
||||
E void FDECL(clear_text_window,(struct xwindow*));
|
||||
E void FDECL(append_text_buffer,(struct text_buffer*, const char*, BOOLEAN_P)); /* text buffer routines */
|
||||
E void FDECL(init_text_buffer,(struct text_buffer*));
|
||||
E void FDECL(clear_text_buffer,(struct text_buffer*));
|
||||
E void FDECL(free_text_buffer,(struct text_buffer*));
|
||||
#ifdef GRAPHIC_TOMBSTONE
|
||||
E void FDECL(calculate_rip_text, (int));
|
||||
#endif
|
||||
|
||||
|
||||
/* ### winval.c ### */
|
||||
E Widget FDECL(create_value,(Widget, const char*));
|
||||
E void FDECL(set_name,(Widget, char*));
|
||||
E void FDECL(set_name_width,(Widget, int));
|
||||
E int FDECL(get_name_width,(Widget));
|
||||
E void FDECL(set_value,(Widget, const char*));
|
||||
E void FDECL(set_value_width,(Widget, int));
|
||||
E int FDECL(get_value_width,(Widget));
|
||||
E void FDECL(hilight_value,(Widget));
|
||||
E void FDECL(swap_fg_bg,(Widget));
|
||||
|
||||
/* external declarations */
|
||||
E void FDECL(X11_init_nhwindows, (int *, char **));
|
||||
E void NDECL(X11_player_selection);
|
||||
E void NDECL(X11_askname);
|
||||
E void NDECL(X11_get_nh_event) ;
|
||||
E void FDECL(X11_exit_nhwindows, (const char *));
|
||||
E void FDECL(X11_suspend_nhwindows, (const char *));
|
||||
E void NDECL(X11_resume_nhwindows);
|
||||
E winid FDECL(X11_create_nhwindow, (int));
|
||||
E void FDECL(X11_clear_nhwindow, (winid));
|
||||
E void FDECL(X11_display_nhwindow, (winid, BOOLEAN_P));
|
||||
E void FDECL(X11_destroy_nhwindow, (winid));
|
||||
E void FDECL(X11_curs, (winid,int,int));
|
||||
E void FDECL(X11_putstr, (winid, int, const char *));
|
||||
E void FDECL(X11_display_file, (const char *, BOOLEAN_P));
|
||||
E void FDECL(X11_start_menu, (winid));
|
||||
E void FDECL(X11_add_menu, (winid,int,const ANY_P *,
|
||||
CHAR_P, CHAR_P, int, const char *, BOOLEAN_P));
|
||||
E void FDECL(X11_end_menu, (winid, const char *));
|
||||
E int FDECL(X11_select_menu, (winid, int, MENU_ITEM_P **));
|
||||
E void NDECL(X11_update_inventory);
|
||||
E void NDECL(X11_mark_synch);
|
||||
E void NDECL(X11_wait_synch);
|
||||
#ifdef CLIPPING
|
||||
E void FDECL(X11_cliparound, (int, int));
|
||||
#endif
|
||||
E void FDECL(X11_print_glyph, (winid,XCHAR_P,XCHAR_P,int));
|
||||
E void FDECL(X11_raw_print, (const char *));
|
||||
E void FDECL(X11_raw_print_bold, (const char *));
|
||||
E int NDECL(X11_nhgetch);
|
||||
E int FDECL(X11_nh_poskey, (int *, int *, int *));
|
||||
E void NDECL(X11_nhbell);
|
||||
E int NDECL(X11_doprev_message);
|
||||
E char FDECL(X11_yn_function, (const char *, const char *, CHAR_P));
|
||||
E void FDECL(X11_getlin, (const char *,char *));
|
||||
E int NDECL(X11_get_ext_cmd);
|
||||
E void FDECL(X11_number_pad, (int));
|
||||
E void FDECL(X11_delay_output, (int));
|
||||
|
||||
/* other defs that really should go away (they're tty specific) */
|
||||
E void NDECL(X11_start_screen);
|
||||
E void NDECL(X11_end_screen);
|
||||
|
||||
#ifdef GRAPHIC_TOMBSTONE
|
||||
E void FDECL(X11_outrip, (winid,int));
|
||||
#else
|
||||
E void FDECL(genl_outrip, (winid,int));
|
||||
#endif
|
||||
|
||||
#endif /* WINX_H */
|
112
include/wingem.h
112
include/wingem.h
|
@ -1,112 +0,0 @@
|
|||
/* SCCS Id: @(#)wingem.h 3.4 1999/12/10 */
|
||||
/* Copyright (c) Christian Bressler, 1999 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef WINGEM_H
|
||||
#define WINGEM_H
|
||||
|
||||
#define E extern
|
||||
|
||||
/* menu structure */
|
||||
typedef struct Gmi{
|
||||
struct Gmi *Gmi_next;
|
||||
int Gmi_glyph;
|
||||
long Gmi_identifier;
|
||||
char Gmi_accelerator, Gmi_groupacc;
|
||||
int Gmi_attr;
|
||||
char *Gmi_str;
|
||||
long Gmi_count;
|
||||
int Gmi_selected;
|
||||
} Gem_menu_item;
|
||||
|
||||
#define MAXWIN 20 /* maximum number of windows, cop-out */
|
||||
|
||||
extern struct window_procs Gem_procs;
|
||||
|
||||
/* ### wingem1.c ### */
|
||||
#ifdef CLIPPING
|
||||
E void NDECL(setclipped);
|
||||
#endif
|
||||
E void FDECL(docorner, (int, int));
|
||||
E void NDECL(end_glyphout);
|
||||
E void FDECL(g_putch, (int));
|
||||
E void NDECL(win_Gem_init);
|
||||
E int NDECL(mar_gem_init);
|
||||
E char NDECL(mar_ask_class);
|
||||
E char * NDECL(mar_ask_name);
|
||||
E int FDECL(mar_create_window, (int));
|
||||
E void FDECL(mar_destroy_nhwindow, (int));
|
||||
E void FDECL(mar_print_glyph, (int, int, int, int));
|
||||
E void FDECL(mar_print_line, (int, int, int, char *));
|
||||
E void FDECL(mar_set_message, (char *, char *, char *));
|
||||
E Gem_menu_item *NDECL(mar_hol_inv);
|
||||
E void FDECL(mar_set_menu_type,(int));
|
||||
E void NDECL(mar_reverse_menu);
|
||||
E void FDECL(mar_set_menu_title, (const char *));
|
||||
E void NDECL(mar_set_accelerators);
|
||||
E void FDECL(mar_add_menu, (winid, Gem_menu_item *));
|
||||
E void FDECL(mar_change_menu_2_text, (winid));
|
||||
E void FDECL(mar_add_message, (const char *));
|
||||
E void NDECL(mar_status_dirty);
|
||||
E int FDECL(mar_hol_win_type, (int));
|
||||
E void NDECL(mar_clear_messagewin);
|
||||
E void FDECL(mar_set_no_glyph, (int));
|
||||
E void NDECL(mar_map_curs_weiter);
|
||||
|
||||
/* external declarations */
|
||||
E void FDECL(Gem_init_nhwindows, (int *, char **));
|
||||
E void NDECL(Gem_player_selection);
|
||||
E void NDECL(Gem_askname);
|
||||
E void NDECL(Gem_get_nh_event) ;
|
||||
E void FDECL(Gem_exit_nhwindows, (const char *));
|
||||
E void FDECL(Gem_suspend_nhwindows, (const char *));
|
||||
E void NDECL(Gem_resume_nhwindows);
|
||||
E winid FDECL(Gem_create_nhwindow, (int));
|
||||
E void FDECL(Gem_clear_nhwindow, (winid));
|
||||
E void FDECL(Gem_display_nhwindow, (winid, BOOLEAN_P));
|
||||
E void FDECL(Gem_dismiss_nhwindow, (winid));
|
||||
E void FDECL(Gem_destroy_nhwindow, (winid));
|
||||
E void FDECL(Gem_curs, (winid,int,int));
|
||||
E void FDECL(Gem_putstr, (winid, int, const char *));
|
||||
E void FDECL(Gem_display_file, (const char *, BOOLEAN_P));
|
||||
E void FDECL(Gem_start_menu, (winid));
|
||||
E void FDECL(Gem_add_menu, (winid,int,const ANY_P *,
|
||||
CHAR_P,CHAR_P,int,const char *, BOOLEAN_P));
|
||||
E void FDECL(Gem_end_menu, (winid, const char *));
|
||||
E int FDECL(Gem_select_menu, (winid, int, MENU_ITEM_P **));
|
||||
E char FDECL(Gem_message_menu, (CHAR_P,int,const char *));
|
||||
E void NDECL(Gem_update_inventory);
|
||||
E void NDECL(Gem_mark_synch);
|
||||
E void NDECL(Gem_wait_synch);
|
||||
#ifdef CLIPPING
|
||||
E void FDECL(Gem_cliparound, (int, int));
|
||||
#endif
|
||||
#ifdef POSITIONBAR
|
||||
E void FDECL(Gem_update_positionbar, (char *));
|
||||
#endif
|
||||
E void FDECL(Gem_print_glyph, (winid,XCHAR_P,XCHAR_P,int));
|
||||
E void FDECL(Gem_raw_print, (const char *));
|
||||
E void FDECL(Gem_raw_print_bold, (const char *));
|
||||
E int NDECL(Gem_nhgetch);
|
||||
E int FDECL(Gem_nh_poskey, (int *, int *, int *));
|
||||
E void NDECL(Gem_nhbell);
|
||||
E int NDECL(Gem_doprev_message);
|
||||
E char FDECL(Gem_yn_function, (const char *, const char *, CHAR_P));
|
||||
E void FDECL(Gem_getlin, (const char *,char *));
|
||||
E int NDECL(Gem_get_ext_cmd);
|
||||
E void FDECL(Gem_number_pad, (int));
|
||||
E void FDECL(Gem_delay_output, (int));
|
||||
#ifdef CHANGE_COLOR
|
||||
E void FDECL(Gem_change_color,(int color,long rgb,int reverse));
|
||||
E char * NDECL(Gem_get_color_string);
|
||||
#endif
|
||||
|
||||
/* other defs that really should go away (they're tty specific) */
|
||||
E void NDECL(Gem_start_screen);
|
||||
E void NDECL(Gem_end_screen);
|
||||
|
||||
E void FDECL(genl_outrip, (winid,int));
|
||||
|
||||
#undef E
|
||||
|
||||
#endif /* WINGEM_H */
|
|
@ -1,95 +0,0 @@
|
|||
/* SCCS Id: @(#)xwindow.h 3.4 1992/03/07 */
|
||||
/* Copyright (c) Dean Luick, 1992 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef _xwindow_h
|
||||
#define _xwindow_h
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Window widget
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
/* Resources:
|
||||
|
||||
Name Class RepType Default Value
|
||||
---- ----- ------- -------------
|
||||
background Background Pixel XtDefaultBackground
|
||||
border BorderColor Pixel XtDefaultForeground
|
||||
borderWidth BorderWidth Dimension 1
|
||||
destroyCallback Callback Pointer NULL
|
||||
height Height Dimension 0
|
||||
mappedWhenManaged MappedWhenManaged Boolean True
|
||||
sensitive Sensitive Boolean True
|
||||
width Width Dimension 0
|
||||
x Position Position 0
|
||||
y Position Position 0
|
||||
|
||||
rows Width Dimension 21
|
||||
columns Height Dimension 80
|
||||
foreground Color Pixel XtDefaultForeground
|
||||
|
||||
black Color Pixel "black"
|
||||
red Color Pixel "red"
|
||||
green Color Pixel "pale green"
|
||||
brown Color Pixel "brown"
|
||||
blue Color Pixel "blue"
|
||||
magenta Color Pixel "magenta"
|
||||
cyan Color Pixel "light cyan"
|
||||
gray Color Pixel "gray"
|
||||
//no color//
|
||||
orange Color Pixel "orange"
|
||||
bright_green Color Pixel "green"
|
||||
yellow Color Pixel "yellow"
|
||||
bright_blue Color Pixel "royal blue"
|
||||
bright_magenta Color Pixel "violet"
|
||||
bright_cyan Color Pixel "cyan"
|
||||
white Color Pixel "white"
|
||||
|
||||
font Font XFontStruct* XtDefaultFont
|
||||
exposeCallback Callback Callback NULL
|
||||
callback Callback Callback NULL
|
||||
resizeCallback Callback Callback NULL
|
||||
*/
|
||||
|
||||
/* define any special resource names here that are not in <X11/StringDefs.h> */
|
||||
|
||||
#define XtNrows "rows"
|
||||
#define XtNcolumns "columns"
|
||||
#define XtNblack "black"
|
||||
#define XtNred "red"
|
||||
#define XtNgreen "green"
|
||||
#define XtNbrown "brown"
|
||||
#define XtNblue "blue"
|
||||
#define XtNmagenta "magenta"
|
||||
#define XtNcyan "cyan"
|
||||
#define XtNgray "gray"
|
||||
#define XtNorange "orange"
|
||||
#define XtNbright_green "bright_green"
|
||||
#define XtNyellow "yellow"
|
||||
#define XtNbright_blue "bright_blue"
|
||||
#define XtNbright_magenta "bright_magenta"
|
||||
#define XtNbright_cyan "bright_cyan"
|
||||
#define XtNwhite "white"
|
||||
#define XtNexposeCallback "exposeCallback"
|
||||
#define XtNresizeCallback "resizeCallback"
|
||||
|
||||
|
||||
extern XFontStruct *WindowFontStruct(/* Widget */);
|
||||
extern Font WindowFont(/* Widget */);
|
||||
|
||||
#define XtCWindowResource "WindowResource"
|
||||
#define XtCRows "Rows"
|
||||
#define XtCColumns "Columns"
|
||||
|
||||
/* declare specific WindowWidget class and instance datatypes */
|
||||
|
||||
typedef struct _WindowClassRec *WindowWidgetClass;
|
||||
typedef struct _WindowRec *WindowWidget;
|
||||
|
||||
/* declare the class constant */
|
||||
|
||||
extern WidgetClass windowWidgetClass;
|
||||
|
||||
#endif /* _xwindow_h */
|
|
@ -1,72 +0,0 @@
|
|||
/* SCCS Id: @(#)xwindowp.h 3.4 1992/03/07 */
|
||||
/* Copyright (c) Dean Luick, 1992 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef _xwindowp_h
|
||||
#define _xwindowp_h
|
||||
|
||||
#include "xwindow.h"
|
||||
|
||||
#ifndef SYSV
|
||||
#define PRESERVE_NO_SYSV /* X11 include files may define SYSV */
|
||||
#endif
|
||||
|
||||
/* include superclass private header file */
|
||||
#include <X11/CoreP.h>
|
||||
|
||||
#ifdef PRESERVE_NO_SYSV
|
||||
# ifdef SYSV
|
||||
# undef SYSV
|
||||
# endif
|
||||
# undef PRESERVE_NO_SYSV
|
||||
#endif
|
||||
|
||||
/* define unique representation types not found in <X11/StringDefs.h> */
|
||||
|
||||
#define XtRWindowResource "WindowResource"
|
||||
|
||||
typedef struct {
|
||||
int empty;
|
||||
} WindowClassPart;
|
||||
|
||||
typedef struct _WindowClassRec {
|
||||
CoreClassPart core_class;
|
||||
WindowClassPart window_class;
|
||||
} WindowClassRec;
|
||||
|
||||
extern WindowClassRec windowClassRec;
|
||||
|
||||
typedef struct {
|
||||
/* resources */
|
||||
Dimension rows;
|
||||
Dimension columns;
|
||||
Pixel foreground;
|
||||
Pixel black;
|
||||
Pixel red;
|
||||
Pixel green;
|
||||
Pixel brown;
|
||||
Pixel blue;
|
||||
Pixel magenta;
|
||||
Pixel cyan;
|
||||
Pixel gray;
|
||||
Pixel orange;
|
||||
Pixel bright_green;
|
||||
Pixel yellow;
|
||||
Pixel bright_blue;
|
||||
Pixel bright_magenta;
|
||||
Pixel bright_cyan;
|
||||
Pixel white;
|
||||
XFontStruct *font;
|
||||
XtCallbackList expose_callback;
|
||||
XtCallbackList input_callback;
|
||||
XtCallbackList resize_callback;
|
||||
/* private state */
|
||||
/* (none) */
|
||||
} WindowPart;
|
||||
|
||||
typedef struct _WindowRec {
|
||||
CorePart core;
|
||||
WindowPart window;
|
||||
} WindowRec;
|
||||
|
||||
#endif /* _xwindowp_h */
|
31
src/pline.c
31
src/pline.c
|
@ -94,7 +94,6 @@ msgpline_type(msg)
|
|||
*/
|
||||
const char * FDECL(replace, (const char *, const char *, const char *));
|
||||
|
||||
#if defined(USE_STDARG) || defined(USE_VARARGS)
|
||||
static void FDECL(vpline, (const char *, va_list));
|
||||
|
||||
void
|
||||
|
@ -108,25 +107,11 @@ pline VA_DECL(const char *, line)
|
|||
|
||||
char prevmsg[BUFSZ];
|
||||
|
||||
# ifdef USE_STDARG
|
||||
static void
|
||||
vpline(const char *line, va_list the_args) {
|
||||
# else
|
||||
static void
|
||||
vpline(line, the_args) const char *line; va_list the_args; {
|
||||
# endif
|
||||
|
||||
#else /* USE_STDARG | USE_VARARG */
|
||||
|
||||
#define vpline pline
|
||||
|
||||
void
|
||||
pline VA_DECL(const char *, line)
|
||||
#endif /* USE_STDARG | USE_VARARG */
|
||||
|
||||
char pbuf[BUFSZ];
|
||||
int typ;
|
||||
/* Do NOT use VA_START and VA_END in here... see above */
|
||||
/* Do NOT use VA_START and VA_END in here... see above */
|
||||
|
||||
if (!line || !*line) return;
|
||||
if (index(line, '%')) {
|
||||
|
@ -308,7 +293,6 @@ verbalize VA_DECL(const char *,line)
|
|||
* of the variable argument handling stuff in "tradstdc.h"
|
||||
*/
|
||||
|
||||
#if defined(USE_STDARG) || defined(USE_VARARGS)
|
||||
static void FDECL(vraw_printf,(const char *,va_list));
|
||||
|
||||
void
|
||||
|
@ -320,20 +304,9 @@ raw_printf VA_DECL(const char *, line)
|
|||
VA_END();
|
||||
}
|
||||
|
||||
# ifdef USE_STDARG
|
||||
static void
|
||||
vraw_printf(const char *line, va_list the_args) {
|
||||
# else
|
||||
static void
|
||||
vraw_printf(line, the_args) const char *line; va_list the_args; {
|
||||
# endif
|
||||
|
||||
#else /* USE_STDARG | USE_VARARG */
|
||||
|
||||
void
|
||||
raw_printf VA_DECL(const char *, line)
|
||||
#endif
|
||||
/* Do NOT use VA_START and VA_END in here... see above */
|
||||
/* Do NOT use VA_START and VA_END in here... see above */
|
||||
|
||||
if(!index(line, '%'))
|
||||
raw_print(line);
|
||||
|
|
|
@ -528,11 +528,7 @@ wd_message()
|
|||
#ifdef WIZARD
|
||||
if (wiz_error_flag) {
|
||||
pline("Only user \"%s\" may access debug (wizard) mode.",
|
||||
# ifndef KR1ED
|
||||
WIZARD);
|
||||
# else
|
||||
WIZARD_NAME);
|
||||
# endif
|
||||
pline("Entering discovery mode instead.");
|
||||
} else
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue