File: windefs.h

package info (click to toggle)
glhack 1.2-1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 24,604 kB
  • ctags: 18,992
  • sloc: ansic: 208,570; cpp: 13,139; yacc: 2,005; makefile: 1,161; lex: 377; sh: 321; awk: 89; sed: 11
file content (203 lines) | stat: -rw-r--r-- 4,901 bytes parent folder | download | duplicates (23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*    SCCS Id: @(#)windefs.h    3.1    93/04/02 */
/* Copyright (c) Gregg Wonderly, Naperville, Illinois,  1991,1992,1993. */
/* NetHack may be freely redistributed.  See license for details. */

#include <exec/types.h>
#include <exec/memory.h>
#include <exec/io.h>
#if !defined(_DCC) && !defined(__GNUC__)
#include <dos.h>
#endif
#include <exec/alerts.h>
#include <exec/devices.h>
#include <exec/execbase.h>
#include <devices/console.h>
#include <devices/conunit.h>
#include <graphics/gfxbase.h>
#include <intuition/intuition.h>
#include <intuition/intuitionbase.h>
#include <libraries/gadtools.h>
#include <libraries/dosextens.h>
#include <libraries/asl.h>
/* stddef.h is included in the precompiled version of hack.h .  If we include
 * it here normally (through string.h) we'll get an "illegal typedef" later
 * on.  This is the easiest way I can think of to fix it without messing
 * around with the rest of the #includes.  --AMC
 */
#if defined(_DCC) && !defined(HACK_H)
# define ptrdiff_t	ptrdiff_t_
# define size_t		size_t_
# define wchar_t	wchar_t_
#endif
#include <ctype.h>
#undef  strcmpi
#include <string.h>
#include <errno.h>
#if defined(_DCC) && !defined(HACK_H)
# undef ptrdiff_t
# undef size_t
# undef wchar_T
#endif

#ifdef  IDCMP_CLOSEWINDOW
# ifndef	INTUI_NEW_LOOK
#  define	INTUI_NEW_LOOK
# endif
#endif

#ifndef HACK_H
#include "hack.h"
#endif
#include "wintype.h"
#include "winami.h"
#include "func_tab.h"

#ifndef	CLIPPING
CLIPPING must be defined for the AMIGA version
#endif

#undef	LI
#undef	CO

/*#define   TOPL_GETLINE	/* Don't use a window for getlin() */
/*#define   WINDOW_YN		/* Use a window for y/n questions */

#ifdef AZTEC_C
#include <functions.h>
#else
#ifdef _DCC
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <clib/console_protos.h>
#include <clib/layers_protos.h>
#include <clib/diskfont_protos.h>
#include <clib/gadtools_protos.h>
#else
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/console.h>
#include <proto/layers.h>
#include <proto/diskfont.h>
#include <proto/gadtools.h>
#include <proto/asl.h>
#endif

/* kludge - see amirip for why */
# undef red
# undef green
# undef blue
#ifdef _DCC
# include <clib/graphics_protos.h>
#else
# include <proto/graphics.h>
#endif

#ifdef _DCC
# define __asm		/* DICE doesn't like __asm */
#endif

#ifndef __SASC_60
#undef index
# define index strchr
#endif

#ifdef _DCC
#include <clib/intuition_protos.h>
#else
#include <proto/intuition.h>
#endif
#endif

#ifdef	SHAREDLIB
#include "NH:sys/amiga/lib/libmacs.h"
#endif

#ifdef	INTUI_NEW_LOOK
#include <utility/tagitem.h>
#endif

#define	WINVERS_AMII	(strcmp("amii",windowprocs.name)==0)
#define	WINVERS_AMIV	(strcmp("amitile",windowprocs.name)==0)
#define	WINVERS_AMIT	(strcmp("amitty",windowprocs.name)==0)

/* cw->data[x] contains 2 characters worth of special information.  These
 * characters are stored at the offsets as described here.
 */
#define VATTR	  0	/* Video attribute is in this slot */
#define SEL_ITEM  1	/* If this is a select item, slot is 1 else 0 */
#define SOFF	  2	/* The string starts here.  */

#undef NULL
#define NULL 0L

/*
 * Versions we need of various libraries.  We can't use LIBRARY_VERSION
 * as defined in <exec/types.h> because some of the libraries we need
 * don't have that version number in the 1.2 ROM.
 */

#define LIBRARY_FONT_VERSION	34L
#define LIBRARY_TILE_VERSION	37L

/* These values are just sorta suggestions in use, but are minimum requirements
 * in reality...
 */
#define WINDOWHEIGHT	192
#define SCREENHEIGHT	200
#define WIDTH		640

/* This character is a solid block (cursor) in Hack.font */
#define CURSOR_CHAR	0x90

#define FONTHEIGHT	8
#define FONTWIDTH	8
#define FONTBASELINE	8

#define MAPFTWIDTH	8
#define MAPFTHEIGHT	8
#define MAPFTBASELN	6

/* If Compiling with the "New Look", redefine these now */
#ifdef  INTUI_NEW_LOOK
#define NewWindow ExtNewWindow
#define NewScreen ExtNewScreen
#endif

#define         SIZEOF_DISKNAME 8

#define CSI     '\x9b'
#define NO_CHAR     -1
#define RAWHELP     0x5F    /* Rawkey code of the HELP key */


#define C_BLACK		0
#define C_WHITE		1
#define C_BROWN		(WINVERS_AMIV ? 11 : 2)
#define C_CYAN		(WINVERS_AMIV ? 2  : 3)
#define C_GREEN		(WINVERS_AMIV ? 5  : 4)
#define C_MAGENTA	(WINVERS_AMIV ? 10 : 5)
#define C_BLUE		(WINVERS_AMIV ? 4  : 6)
#define C_RED		7
#define C_ORANGE	3
#define C_GREY		6
#define C_LTGREEN	8
#define C_YELLOW	9
#define C_GREYBLUE	12
#define C_LTBROWN	13
#define C_LTGREY	14
#define C_PEACH		15

/* Structure describing tile files */
struct PDAT
{
    long nplanes;		/* Depth of images */
    long pbytes;		/* Bytes in a plane of data */
    long across;		/* Number of tiles across */
    long down;			/* Number of tiles down */
    long npics;			/* Number of pictures in this file */
    long xsize;			/* X-size of a tile */
    long ysize;			/* Y-size of a-tile */
};

#undef	MAXCOLORS
#define	MAXCOLORS	256