-
Notifications
You must be signed in to change notification settings - Fork 0
/
Doomdef.h
448 lines (393 loc) · 11.7 KB
/
Doomdef.h
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright(C) 2000 James Haley
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//--------------------------------------------------------------------------
//
// DESCRIPTION:
// Internally used data structures for virtually everything,
// key definitions, lots of other stuff.
//
//-----------------------------------------------------------------------------
#ifndef __DOOMDEF__
#define __DOOMDEF__
// killough 4/25/98: Make gcc extensions mean nothing on other compilers
#ifndef __GNUC__
#define __attribute__(x)
// haleyjd: use MS C's __inline when available
#if !defined(__inline__)
#if defined(_MSC_VER)
#define __inline__ __inline
#else
#define __inline__
#endif
#endif
#endif // __GNUC__
// This must come first, since it redefines malloc(), free(), etc. -- killough:
#include "z_zone.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include "m_swap.h"
#include "version.h"
// Game mode handling - identify IWAD version
// to handle IWAD dependend animations etc.
typedef enum {
shareware, // DOOM 1 shareware, E1, M9
registered, // DOOM 1 registered, E3, M27
commercial, // DOOM 2 retail, E1 M34 (DOOM 2 german edition not handled)
retail, // DOOM 1 retail, E4, M36
indetermined // Well, no IWAD found.
} GameMode_t;
// Mission packs - might be useful for TC stuff?
typedef enum {
doom, // DOOM 1
doom2, // DOOM 2
pack_tnt, // TNT mission pack
pack_plut, // Plutonia pack
chex, // Chex Quest
cod, // Caverns of Darkness,
hacx_reg, // HACX registered,
freedoom,
arctic, // Operation Arctic Wolf (1999 version)
arcticse, // Operation Arctic Wolf Special Edition
none
} GameMission_t;
// Identify language to use, software localization.
typedef enum {
english,
french,
german,
unknown
} Language_t;
//
// For resize of screen, at start of game.
//
#define BASE_WIDTH 320
// It is educational but futile to change this
// scaling e.g. to 2. Drawing of status bar,
// menues etc. is tied to the scale implied
// by the graphics.
#define SCREEN_MUL 1
#define INV_ASPECT_RATIO 0.625 /* 0.75, ideally */
// killough 2/8/98: MAX versions for maximum screen sizes
// allows us to avoid the overhead of dynamic allocation
// when multiple screen sizes are supported
#define MAX_SCREENWIDTH 1280
#define MAX_SCREENHEIGHT 1024
#define SCREENWIDTH 320
#define SCREENHEIGHT 200
// The maximum number of players, multiplayer/networking.
#define MAXPLAYERS 4
// phares 5/14/98:
// DOOM Editor Numbers (aka doomednum in mobj_t)
#define DEN_PLAYER5 4001
#define DEN_PLAYER6 4002
#define DEN_PLAYER7 4003
#define DEN_PLAYER8 4004
// State updates, number of tics / second.
#define TICRATE 35
// The current state of the game: whether we are playing, gazing
// at the intermission screen, the game final animation, or a demo.
typedef enum {
GS_LEVEL,
GS_INTERMISSION,
GS_FINALE,
GS_DEMOSCREEN,
GS_CONSOLE
} gamestate_t;
//
// Difficulty/skill settings/filters.
//
// These are Thing flags
// Skill flags.
#define MTF_EASY 1
#define MTF_NORMAL 2
#define MTF_HARD 4
// Deaf monsters/do not react to sound.
#define MTF_AMBUSH 8
// killough 11/98
#define MTF_NOTSINGLE 16
#define MTF_NOTDM 32
#define MTF_NOTCOOP 64
#define MTF_FRIEND 128
#define MTF_RESERVED 256
// haleyjd
#define MTF_DORMANT 512
// sf: sector flags, not me =)
// kill all sound in sector
#define SF_KILLSOUND 1024
// kill all sounds due to moving
#define SF_KILLMOVESOUND 2048
// a macro to find out whether to make moving sounds in a sector
#define silentmove(s) ((s)->special & SF_KILLMOVESOUND)
typedef enum {
sk_none=-1, //jff 3/24/98 create unpicked skill setting
sk_baby=0,
sk_easy,
sk_medium,
sk_hard,
sk_nightmare
} skill_t;
//
// Key cards.
//
typedef enum {
it_bluecard,
it_yellowcard,
it_redcard,
it_blueskull,
it_yellowskull,
it_redskull,
NUMCARDS
} card_t;
// The defined weapons, including a marker
// indicating user has not changed weapon.
typedef enum {
wp_fist,
wp_pistol,
wp_shotgun,
wp_chaingun,
wp_missile,
wp_plasma,
wp_bfg,
wp_chainsaw,
wp_supershotgun,
wp_grenade, // haleyjd 11/7/99
wp_cross, // joel: Holy Cross
NUMWEAPONS,
wp_nochange, // No pending weapon change.
wp_selfie, // pending change to selfie stick
wp_pogo // pending change to pogo stick
} weapontype_t;
// Ammunition types defined.
typedef enum {
am_clip, // Pistol / chaingun ammo.
am_shell, // Shotgun / double barreled shotgun.
am_cell, // Plasma rifle, BFG.
am_misl, // Missile launcher.
am_gren, // Grenades haleyjd 11/7/99
am_faith, // joel: Holy Cross "ammo"
NUMAMMO,
am_noammo // Unlimited for chainsaw / fist.
} ammotype_t;
// Power up artifacts.
typedef enum {
pw_invulnerability,
pw_strength,
pw_invisibility,
pw_ironfeet,
pw_allmap,
pw_infrared,
pw_totalinvis, // haleyjd : total invisibility
NUMPOWERS
} powertype_t;
// Power up durations (how many seconds till expiration).
typedef enum {
INVULNTICS = (30*TICRATE),
INVISTICS = (60*TICRATE),
INFRATICS = (120*TICRATE),
IRONTICS = (60*TICRATE)
} powerduration_t;
// DOOM keyboard definition.
// This is the stuff configured by Setup.Exe.
// Most key data are simple ascii (uppercased).
#define KEYD_RIGHTARROW 0xae
#define KEYD_LEFTARROW 0xac
#define KEYD_UPARROW 0xad
#define KEYD_DOWNARROW 0xaf
#define KEYD_ESCAPE 27
#define KEYD_ENTER 13
#define KEYD_TAB 9
#define KEYD_F1 (0x80+0x3b)
#define KEYD_F2 (0x80+0x3c)
#define KEYD_F3 (0x80+0x3d)
#define KEYD_F4 (0x80+0x3e)
#define KEYD_F5 (0x80+0x3f)
#define KEYD_F6 (0x80+0x40)
#define KEYD_F7 (0x80+0x41)
#define KEYD_F8 (0x80+0x42)
#define KEYD_F9 (0x80+0x43)
#define KEYD_F10 (0x80+0x44)
#define KEYD_F11 (0x80+0x57)
#define KEYD_F12 (0x80+0x58)
#define KEYD_BACKSPACE 127
#define KEYD_PAUSE 0xff
#define KEYD_EQUALS 0x3d
#define KEYD_MINUS 0x2d
#define KEYD_RSHIFT (0x80+0x36)
#define KEYD_RCTRL (0x80+0x1d)
#define KEYD_RALT (0x80+0x38)
#define KEYD_LALT KEYD_RALT
#define KEYD_CAPSLOCK 0xba // phares
// phares 3/2/98:
#define KEYD_INSERT 0xd2
#define KEYD_HOME 0xc7
#define KEYD_PAGEUP 0xc9
#define KEYD_PAGEDOWN 0xd1
#define KEYD_DEL KEYD_BACKSPACE
#define KEYD_END 0xcf
#define KEYD_SCROLLLOCK 0xc6
#define KEYD_SPACEBAR 0x20
// phares 3/2/98
// sf: console key
#define KEYD_CONSOLE '`'
#define KEYD_NUMLOCK 0xC5 // killough 3/6/98
// haleyjd: virtual keys
#define KEYD_MOUSE1 (0x80 + 0x60)
#define KEYD_MOUSE2 (0x80 + 0x61)
#define KEYD_MOUSE3 (0x80 + 0x62)
#define KEYD_JOY1 (0x80 + 0x63)
#define KEYD_JOY2 (0x80 + 0x64)
#define KEYD_JOY3 (0x80 + 0x65)
#define KEYD_JOY4 (0x80 + 0x66)
// phares 4/19/98:
// Defines Setup Screen groups that config variables appear in.
// Used when resetting the defaults for every item in a Setup group.
typedef enum {
ss_none,
ss_keys,
ss_weap,
ss_stat,
ss_auto,
ss_enem,
ss_mess,
ss_chat,
ss_gen, // killough 10/98
ss_comp, // killough 10/98
ss_max
} ss_types;
// phares 3/20/98:
//
// Player friction is variable, based on controlling
// linedefs. More friction can create mud, sludge,
// magnetized floors, etc. Less friction can create ice.
#define MORE_FRICTION_MOMENTUM 15000 // mud factor based on momentum
#define ORIG_FRICTION 0xE800 // original value
#define ORIG_FRICTION_FACTOR 2048 // original value
#ifdef DEMO11
#define MAXMOVE_19 (30*FRACUNIT)
#define MAXMOVE_11 (50*FRACUNIT)
#else
#define MAXMOVE (30*FRACUNIT)
#endif
// sf: some useful macros
//
// isExMy }
// } for easy testing of level name format
// isMAPxy }
//
#define isnumchar(c) ( (c) >= '0' && (c) <= '9')
#define isExMy(s) ( (s)[0] == 'E' && (s)[2] == 'M' \
&& isnumchar((s)[1]) && isnumchar((s)[3]) \
&& (s)[4] == 0 )
#define isMAPxy(s) ( (s)[0] == 'M' && (s)[1] == 'A' && (s)[2] == 'P' \
&& isnumchar((s)[3]) && isnumchar((s)[4]) && !(s)[5] )
#ifndef DJGPP
#define stricmp strcasecmp
#define strnicmp strncasecmp
#endif
// kind of extra WAD-s the port can autoload
typedef enum {
EXTRA_NONE,
EXTRA_FILTERS,
EXTRA_SELFIE,
EXTRA_WIMAPS,
EXTRA_TAPE,
EXTRA_JUMP,
EXTRA_NERVE,
EXTRA_ARCTIC,
EXTRA_PRESS,
NUM_EXTRAS
} extra_file_t;
#endif // __DOOMDEF__
//----------------------------------------------------------------------------
//
// $Log: doomdef.h,v $
// Revision 1.23 1998/05/14 08:02:00 phares
// Added Player Starts 5-8 (4001-4004)
//
// Revision 1.22 1998/05/05 15:34:48 phares
// Documentation and Reformatting changes
//
// Revision 1.21 1998/05/03 22:39:56 killough
// beautification
//
// Revision 1.20 1998/04/27 01:50:51 killough
// Make gcc's __attribute__ mean nothing on other compilers
//
// Revision 1.19 1998/04/22 13:45:23 phares
// Added Setup screen Reset to Defaults
//
// Revision 1.18 1998/03/24 15:59:13 jim
// Added default_skill parameter to config file
//
// Revision 1.17 1998/03/23 15:23:34 phares
// Changed pushers to linedef control
//
// Revision 1.16 1998/03/20 00:29:34 phares
// Changed friction to linedef control
//
// Revision 1.15 1998/03/12 14:28:36 phares
// friction and IDCLIP changes
//
// Revision 1.14 1998/03/09 18:27:16 phares
// Fixed bug in neighboring variable friction sectors
//
// Revision 1.13 1998/03/09 07:08:30 killough
// Add numlock key scancode
//
// Revision 1.12 1998/03/04 21:26:27 phares
// Repaired syntax error (left-over conflict marker)
//
// Revision 1.11 1998/03/04 21:02:16 phares
// Dynamic HELP screen
//
// Revision 1.10 1998/03/02 11:25:52 killough
// Remove now-dead monster_ai mask idea
//
// Revision 1.9 1998/02/24 08:45:32 phares
// Pushers, recoil, new friction, and over/under work
//
// Revision 1.8 1998/02/23 04:15:50 killough
// New monster AI option mask enums
//
// Revision 1.7 1998/02/15 02:48:06 phares
// User-defined keys
//
// Revision 1.6 1998/02/09 02:52:01 killough
// Make SCREENWIDTH/HEIGHT more flexible
//
// Revision 1.5 1998/02/02 13:22:47 killough
// user new version files
//
// Revision 1.4 1998/01/30 18:48:07 phares
// Changed textspeed and textwait to functions
//
// Revision 1.3 1998/01/30 16:09:06 phares
// Faster end-mission text display
//
// Revision 1.2 1998/01/26 19:26:39 phares
// First rev with no ^Ms
//
// Revision 1.1.1.1 1998/01/19 14:02:51 rand
// Lee's Jan 19 sources
//
//----------------------------------------------------------------------------