]> icculus.org git repositories - theoddone33/hhexen.git/blob - include/h2def.h
Round 3: Some minor cross-platform compatibility changes (FreeBSD), still may not...
[theoddone33/hhexen.git] / include / h2def.h
1
2 //**************************************************************************
3 //**
4 //** h2def.h : Heretic 2 : Raven Software, Corp.
5 //**
6 //** $RCSfile$
7 //** $Revision$
8 //** $Date$
9 //** $Author$
10 //**
11 //**************************************************************************
12
13 #ifndef __H2DEF__
14 #define __H2DEF__
15 #include <config.h>
16 #include <stdio.h>
17 #include <string.h>
18 #include <stdlib.h>
19 #include "st_start.h"
20 #ifdef __linux
21 #include <sys/types.h>
22 #endif
23
24 #define VERSION 110
25 #define VERSION_TEXT "v1.1"
26
27 #if defined(__linux)
28 #define VERSION_PLATFORM "Linux"
29 #elif defined (__FreeBSD__)
30 #define VERSION_PLATFORM "FreeBSD"
31 #elif defined (WIN32)
32 #define VERSION_PLATFORM "Windows"
33 #else
34 #define VERSION_PLATFORM "Unknown"
35 #endif
36 #define VERSION_MAJ 1
37 #define VERSION_MIN 4
38
39 // Uncomment, to enable all timebomb stuff
40 //#define TIMEBOMB
41 #define TIMEBOMB_YEAR   95              // years since 1900
42 #define TIMEBOMB_STARTDATE      268     // initial date (9/26)
43 #define TIMEBOMB_ENDDATE        301     // end date (10/29)
44
45 // if rangecheck is undefined, most parameter validation debugging code
46 // will not be compiled
47 #ifndef NORANGECHECKING
48 #define RANGECHECK
49 #endif
50
51 // Past distributions
52 #ifndef VER_ID
53 #define VER_ID "DVL"
54 #endif
55 //#define VERSIONTEXT "ID V1.2"
56 //#define VERSIONTEXT "RETAIL STORE BETA"               // 9/26/95
57 //#define VERSIONTEXT "DVL BETA 10 05 95" // Used for GT for testing
58 //#define VERSIONTEXT "DVL BETA 10 07 95" // Just an update for Romero
59 //#define VERSIONTEXT "FINAL 1.0 (10 13 95)" // Just an update for Romero
60 #ifdef __linux
61 #ifdef RANGECHECK
62 #define VERSIONTEXT "Version 1.3 +R "__DATE__" (BCP)"
63 #else
64 #define VERSIONTEXT "Version 1.3 "__DATE__" (BCP)"
65 #endif
66 #else
67 #ifdef RANGECHECK
68 #define VERSIONTEXT "Version 1.3 +R "__DATE__" ("VER_ID")"
69 #else
70 #define VERSIONTEXT "Version 1.3 "__DATE__" ("VER_ID")"
71 #endif
72 #endif
73
74 // all exterior data is defined here
75 #include "xddefs.h"
76
77 // all important printed strings
78 #include "textdefs.h"
79
80 // header generated by multigen utility
81 #include "info.h"
82
83 extern byte *destview, *destscreen;     // PC direct to screen pointers
84
85 //
86 // most key data are simple ascii (uppercased)
87 //
88 #define KEY_RIGHTARROW          0xae
89 #define KEY_LEFTARROW           0xac
90 #define KEY_UPARROW                     0xad
91 #define KEY_DOWNARROW           0xaf
92 #define KEY_ESCAPE                      27
93 #define KEY_ENTER                       13
94 #define KEY_F1                          (0x80+0x3b)
95 #define KEY_F2                          (0x80+0x3c)
96 #define KEY_F3                          (0x80+0x3d)
97 #define KEY_F4                          (0x80+0x3e)
98 #define KEY_F5                          (0x80+0x3f)
99 #define KEY_F6                          (0x80+0x40)
100 #define KEY_F7                          (0x80+0x41)
101 #define KEY_F8                          (0x80+0x42)
102 #define KEY_F9                          (0x80+0x43)
103 #define KEY_F10                         (0x80+0x44)
104 #define KEY_F11                         (0x80+0x57)
105 #define KEY_F12                         (0x80+0x58)
106
107 #define KEY_BACKSPACE           127
108 #define KEY_PAUSE                       0xff
109
110 #define KEY_EQUALS                      0x3d
111 #define KEY_MINUS                       0x2d
112
113 #define KEY_RSHIFT                      (0x80+0x36)
114 #define KEY_RCTRL                       (0x80+0x1d)
115 #define KEY_RALT                        (0x80+0x38)
116
117 #define KEY_LALT                        KEY_RALT
118
119 #define KEY_FIVE                        0x35
120 #define KEY_SIX                         0x36
121 #define KEY_SEVEN                       0x37
122 #define KEY_EIGHT                       0x38
123 #define KEY_NINE                        0x39
124 #define KEY_ZERO                        0x30
125 #define KEY_BACKSLASH           0x5C
126
127
128 #define MAXCHAR ((char)0x7f)
129 #define MAXSHORT ((short)0x7fff)
130 #define MAXINT  ((int)0x7fffffff)       /* max pos 32-bit int */
131 #define MAXLONG ((long)0x7fffffff)
132
133 #define MINCHAR ((char)0x80)
134 #define MINSHORT ((short)0x8000)
135 #define MININT  ((int)0x80000000)       /* max negative 32-bit integer */
136 #define MINLONG ((long)0x80000000)
137
138 #define FINEANGLES                      8192
139 #define FINEMASK                        (FINEANGLES-1)
140 #define ANGLETOFINESHIFT        19      // 0x100000000 to 0x2000
141
142 /*
143 ===============================================================================
144
145                                                 GLOBAL TYPES
146
147 ===============================================================================
148 */
149
150 //#define NUMARTIFCTS   28
151 #define MAXPLAYERS      8
152 #define TICRATE         35                      // number of tics / second
153 #define TICSPERSEC      35
154
155 #define MINIMUM_HEAP_SIZE       0x800000                //  8 meg
156 #define MAXIMUM_HEAP_SIZE       0x2000000               // 32 meg
157
158 #define FRACBITS                16
159 #define FRACUNIT                (1<<FRACBITS)
160 typedef int fixed_t;
161
162 #ifndef __linux
163 typedef unsigned int uint;
164 #endif
165
166 //#define ANGLE_1               0x01000000
167 #define ANGLE_45        0x20000000
168 #define ANGLE_90        0x40000000
169 #define ANGLE_180       0x80000000
170 #define ANGLE_MAX       0xffffffff
171 #define ANGLE_1         (ANGLE_45/45)
172 #define ANGLE_60        (ANGLE_180/3)
173
174 #define ANG45   0x20000000
175 #define ANG90   0x40000000
176 #define ANG180  0x80000000
177 #define ANG270  0xc0000000
178
179 typedef unsigned angle_t;
180
181 typedef enum
182 {
183         sk_baby,
184         sk_easy,
185         sk_medium,
186         sk_hard,
187         sk_nightmare
188 } skill_t;
189
190 typedef enum
191 {
192         ev_keydown,
193         ev_keyup,
194         ev_mouse,
195         ev_joystick
196 } evtype_t;
197
198 typedef struct
199 {
200         evtype_t        type;
201         int                     data1;          // keys / mouse/joystick buttons
202         int                     data2;          // mouse/joystick x move
203         int                     data3;          // mouse/joystick y move
204 } event_t;
205
206 typedef struct
207 {
208         char            forwardmove;            // *2048 for move
209         char            sidemove;                       // *2048 for move
210         short           angleturn;                      // <<16 for angle delta
211         short           consistancy;            // checks for net game
212         byte            chatchar;
213         byte            buttons;
214         byte            lookfly;                        // look/fly up/down/centering
215         byte            arti;                           // artitype_t to use
216 } ticcmd_t;
217
218 #define BT_ATTACK               1
219 #define BT_USE                  2
220 #define BT_CHANGE               4                       // if true, the next 3 bits hold weapon num
221 #define BT_WEAPONMASK   (8+16+32)
222 #define BT_WEAPONSHIFT  3
223
224 #define BT_SPECIAL              128                     // game events, not really buttons
225 #define BTS_SAVEMASK    (4+8+16)
226 #define BTS_SAVESHIFT   2
227 #define BT_SPECIALMASK  3
228 #define BTS_PAUSE               1                       // pause the game
229 #define BTS_SAVEGAME    2                       // save the game at each console
230 // savegame slot numbers occupy the second byte of buttons
231
232 // The top 3 bits of the artifact field in the ticcmd_t struct are used
233 //              as additional flags 
234 #define AFLAG_MASK                      0x3F
235 #define AFLAG_SUICIDE           0x40
236 #define AFLAG_JUMP                      0x80
237
238 typedef enum
239 {
240         GS_LEVEL,
241         GS_INTERMISSION,
242         GS_FINALE,
243         GS_DEMOSCREEN
244 } gamestate_t;
245
246 typedef enum
247 {
248         ga_nothing,
249         ga_loadlevel,
250         ga_initnew,
251         ga_newgame,
252         ga_loadgame,
253         ga_savegame,
254         ga_playdemo,
255         ga_completed,
256         ga_leavemap,
257         ga_singlereborn,
258         ga_victory,
259         ga_worlddone,
260         ga_screenshot
261 } gameaction_t;
262
263 typedef enum
264 {
265         wipe_0,
266         wipe_1,
267         wipe_2,
268         wipe_3,
269         wipe_4,
270         NUMWIPES,
271         wipe_random
272 } wipe_t;
273
274 typedef struct
275 {
276         char    *name;
277         int     *location;
278         int     defaultvalue;
279         int     scantranslate;      // PC scan code hack
280         int     untranslated;       // lousy hack
281 } default_t;
282 /*
283 ===============================================================================
284
285                                                         MAPOBJ DATA
286
287 ===============================================================================
288 */
289
290 // think_t is a function pointer to a routine to handle an actor
291 typedef void (*think_t) ();
292
293 typedef struct thinker_s
294 {
295         struct          thinker_s       *prev, *next;
296         think_t         function;
297 } thinker_t;
298
299 struct player_s;
300
301 typedef struct mobj_s
302 {
303         thinker_t               thinker;                        // thinker node
304
305 // info for drawing
306         fixed_t                 x,y,z;
307         struct  mobj_s  *snext, *sprev;         // links in sector (if needed)
308         angle_t                 angle;
309         spritenum_t             sprite;                         // used to find patch_t and flip value
310         int                             frame;                          // might be ord with FF_FULLBRIGHT
311
312 // interaction info
313         struct mobj_s   *bnext, *bprev;         // links in blocks (if needed)
314         struct subsector_s      *subsector;
315         fixed_t                 floorz, ceilingz;       // closest together of contacted secs
316         fixed_t                 floorpic;                       // contacted sec floorpic
317         fixed_t                 radius, height;         // for movement checking
318         fixed_t                 momx, momy, momz;       // momentums
319         int                             validcount;                     // if == validcount, already checked
320         mobjtype_t              type;
321         mobjinfo_t              *info;                          // &mobjinfo[mobj->type]
322         int                             tics;                           // state tic counter
323         state_t                 *state;
324         int                             damage;                 // For missiles
325         int                             flags;
326         int                             flags2;                 // Heretic flags
327         int                             special1;               // Special info
328         int                             special2;               // Special info
329         int                             health;
330         int                             movedir;                // 0-7
331         int                             movecount;              // when 0, select a new dir
332         struct mobj_s   *target;                // thing being chased/attacked (or NULL)
333                                                                         // also the originator for missiles
334         int                             reactiontime;   // if non 0, don't attack yet
335                                                                         // used by player to freeze a bit after
336                                                                         // teleporting
337         int                             threshold;              // if > 0, the target will be chased
338                                                                         // no matter what (even if shot)
339         struct player_s *player;                // only valid if type == MT_PLAYER
340         int                             lastlook;               // player number last looked for
341         fixed_t                 floorclip;              // value to use for floor clipping
342         int                             archiveNum;             // Identity during archive
343         short                   tid;                    // thing identifier
344         byte                    special;                // special
345         byte                    args[5];                // special arguments
346 } mobj_t;
347
348 // each sector has a degenmobj_t in it's center for sound origin purposes
349 typedef struct
350 {
351         thinker_t               thinker;                // not used for anything
352         fixed_t                 x,y,z;
353 } degenmobj_t;
354
355 // Most damage defined using HITDICE
356 #define HITDICE(a) ((1+(P_Random()&7))*a)
357
358 //
359 // frame flags
360 //
361 #define FF_FULLBRIGHT   0x8000          // flag in thing->frame
362 #define FF_FRAMEMASK    0x7fff
363
364 // --- mobj.flags ---
365
366 #define MF_SPECIAL              1                       // call P_SpecialThing when touched
367 #define MF_SOLID                2
368 #define MF_SHOOTABLE    4
369 #define MF_NOSECTOR             8                       // don't use the sector links
370                                                                         // (invisible but touchable)
371 #define MF_NOBLOCKMAP   16                      // don't use the blocklinks
372                                                                         // (inert but displayable)
373 #define MF_AMBUSH               32
374 #define MF_JUSTHIT              64                      // try to attack right back
375 #define MF_JUSTATTACKED 128                     // take at least one step before attacking
376 #define MF_SPAWNCEILING 256                     // hang from ceiling instead of floor
377 #define MF_NOGRAVITY    512                     // don't apply gravity every tic
378
379 // movement flags
380 #define MF_DROPOFF              0x400           // allow jumps from high places
381 #define MF_PICKUP               0x800           // for players to pick up items
382 #define MF_NOCLIP               0x1000          // player cheat
383 #define MF_SLIDE                0x2000          // keep info about sliding along walls
384 #define MF_FLOAT                0x4000          // allow moves to any height, no gravity
385 #define MF_TELEPORT             0x8000          // don't cross lines or look at heights
386 #define MF_MISSILE              0x10000         // don't hit same species, explode on block
387
388 #define MF_ALTSHADOW    0x20000         // alternate fuzzy draw
389 #define MF_SHADOW               0x40000         // use fuzzy draw (shadow demons / invis)
390 #define MF_NOBLOOD              0x80000         // don't bleed when shot (use puff)
391 #define MF_CORPSE               0x100000        // don't stop moving halfway off a step
392 #define MF_INFLOAT              0x200000        // floating to a height for a move, don't
393                                                                         // auto float to target's height
394
395 #define MF_COUNTKILL    0x400000        // count towards intermission kill total
396 #define MF_ICECORPSE    0x800000        // a frozen corpse (for blasting)
397
398 #define MF_SKULLFLY             0x1000000       // skull in flight
399 #define MF_NOTDMATCH    0x2000000       // don't spawn in death match (key cards)
400
401 //#define       MF_TRANSLATION  0xc000000       // if 0x4 0x8 or 0xc, use a translation
402 #define MF_TRANSLATION  0x1c000000      // use a translation table (>>MF_TRANSHIFT)
403 #define MF_TRANSSHIFT   26                      // table for player colormaps
404
405
406 // --- mobj.flags2 ---
407
408 #define MF2_LOGRAV                      0x00000001      // alternate gravity setting
409 #define MF2_WINDTHRUST          0x00000002      // gets pushed around by the wind
410                                                                                 // specials
411 #define MF2_FLOORBOUNCE         0x00000004      // bounces off the floor
412 #define MF2_BLASTED                     0x00000008      // missile will pass through ghosts
413 #define MF2_FLY                         0x00000010      // fly mode is active
414 #define MF2_FLOORCLIP           0x00000020      // if feet are allowed to be clipped
415 #define MF2_SPAWNFLOAT          0x00000040      // spawn random float z
416 #define MF2_NOTELEPORT          0x00000080      // does not teleport
417 #define MF2_RIP                         0x00000100      // missile rips through solid
418                                                                                 // targets
419 #define MF2_PUSHABLE            0x00000200      // can be pushed by other moving
420                                                                                 // mobjs
421 #define MF2_SLIDE                       0x00000400      // slides against walls
422 #define MF2_ONMOBJ                      0x00000800      // mobj is resting on top of another
423                                                                                 // mobj
424 #define MF2_PASSMOBJ            0x00001000      // Enable z block checking.  If on,
425                                                                                 // this flag will allow the mobj to
426                                                                                 // pass over/under other mobjs.
427 #define MF2_CANNOTPUSH          0x00002000      // cannot push other pushable mobjs
428 #define MF2_DROPPED                     0x00004000      // dropped by a demon
429 #define MF2_BOSS                        0x00008000      // mobj is a major boss
430 #define MF2_FIREDAMAGE          0x00010000      // does fire damage
431 #define MF2_NODMGTHRUST         0x00020000      // does not thrust target when
432                                                                                 // damaging
433 #define MF2_TELESTOMP           0x00040000      // mobj can stomp another
434 #define MF2_FLOATBOB            0x00080000      // use float bobbing z movement
435 #define MF2_DONTDRAW            0x00100000      // don't generate a vissprite
436 #define MF2_IMPACT                      0x00200000      // an MF_MISSILE mobj can activate
437                                                                                 // SPAC_IMPACT
438 #define MF2_PUSHWALL            0x00400000      // mobj can push walls
439 #define MF2_MCROSS                      0x00800000      // can activate monster cross lines
440 #define MF2_PCROSS                      0x01000000      // can activate projectile cross lines
441 #define MF2_CANTLEAVEFLOORPIC 0x02000000 // stay within a certain floor type
442 #define MF2_NONSHOOTABLE        0x04000000      // mobj is totally non-shootable, 
443                                                                                 // but still considered solid
444 #define MF2_INVULNERABLE        0x08000000      // mobj is invulnerable
445 #define MF2_DORMANT                     0x10000000      // thing is dormant
446 #define MF2_ICEDAMAGE           0x20000000  // does ice damage
447 #define MF2_SEEKERMISSILE       0x40000000      // is a seeker (for reflection)
448 #define MF2_REFLECTIVE          0x80000000      // reflects missiles
449
450 //=============================================================================
451
452 // ===== Player Class Types =====
453 typedef enum
454 {
455         PCLASS_FIGHTER,
456         PCLASS_CLERIC,
457         PCLASS_MAGE,
458         PCLASS_ASS,
459         PCLASS_PIG,
460         NUMCLASSES
461 } pclass_t;
462
463 typedef enum
464 {
465         PST_LIVE,                       // playing
466         PST_DEAD,                       // dead on the ground
467         PST_REBORN                      // ready to restart
468 } playerstate_t;
469
470 // psprites are scaled shapes directly on the view screen
471 // coordinates are given for a 320*200 view screen
472 typedef enum
473 {
474         ps_weapon,
475         ps_flash,
476         NUMPSPRITES
477 } psprnum_t;
478
479 typedef struct
480 {
481         state_t *state;         // a NULL state means not active
482         int             tics;
483         fixed_t sx, sy;
484 } pspdef_t;
485
486 /* Old Heretic key type
487 typedef enum
488 {
489         key_yellow,
490         key_green,
491         key_blue,
492         NUMKEYS
493 } keytype_t;
494 */
495
496 typedef enum
497 {
498         KEY_1,
499         KEY_2,
500         KEY_3,
501         KEY_4,
502         KEY_5,
503         KEY_6,
504         KEY_7,
505         KEY_8,
506         KEY_9,
507         KEY_A,
508         KEY_B,
509         NUMKEYS
510 } keytype_t;
511
512 typedef enum
513 {
514         ARMOR_ARMOR,
515         ARMOR_SHIELD,
516         ARMOR_HELMET,
517         ARMOR_AMULET,
518         NUMARMOR
519 } armortype_t;
520
521 typedef enum
522 {
523         WP_FIRST,
524         WP_SECOND,
525         WP_THIRD,
526         WP_FOURTH,
527         NUMWEAPONS,
528         WP_NOCHANGE
529 } weapontype_t;
530         
531 typedef enum
532 {
533         MANA_1,
534         MANA_2,
535         NUMMANA,
536         MANA_BOTH,
537         MANA_NONE
538 } manatype_t;
539
540 #define MAX_MANA        200
541
542 #define WPIECE1         1
543 #define WPIECE2         2
544 #define WPIECE3         4
545
546 typedef struct
547 {
548         manatype_t mana;
549         int upstate;
550         int downstate;
551         int readystate;
552         int atkstate;
553         int holdatkstate;
554         int flashstate;
555 } weaponinfo_t;
556
557 extern weaponinfo_t WeaponInfo[NUMWEAPONS][NUMCLASSES];
558
559 typedef enum
560 {
561         arti_none,
562         arti_invulnerability,
563         arti_health,
564         arti_superhealth,
565         arti_healingradius,
566         arti_summon,
567         arti_torch,
568         arti_egg,
569         arti_fly,
570         arti_blastradius,
571         arti_poisonbag,
572         arti_teleportother,
573         arti_speed,
574         arti_boostmana,
575         arti_boostarmor,
576         arti_teleport,
577         // Puzzle artifacts
578         arti_firstpuzzitem,
579         arti_puzzskull = arti_firstpuzzitem,
580         arti_puzzgembig,
581         arti_puzzgemred,
582         arti_puzzgemgreen1,
583         arti_puzzgemgreen2,
584         arti_puzzgemblue1,
585         arti_puzzgemblue2,
586         arti_puzzbook1,
587         arti_puzzbook2,
588         arti_puzzskull2,
589         arti_puzzfweapon,
590         arti_puzzcweapon,
591         arti_puzzmweapon,
592         arti_puzzgear1,
593         arti_puzzgear2,
594         arti_puzzgear3,
595         arti_puzzgear4,
596         NUMARTIFACTS
597 } artitype_t;
598
599 typedef enum
600 {
601         pw_None,
602         pw_invulnerability,
603         pw_allmap,
604         pw_infrared,
605         pw_flight,
606         pw_shield,
607         pw_health2,
608         pw_speed,
609         pw_minotaur,
610         NUMPOWERS
611 } powertype_t;
612
613 #define INVULNTICS (30*35)
614 #define INVISTICS (60*35)
615 #define INFRATICS (120*35)
616 #define IRONTICS (60*35)
617 #define WPNLEV2TICS (40*35)
618 #define FLIGHTTICS (60*35)
619 #define SPEEDTICS (45*35)
620 #define MORPHTICS (40*35)
621 #define MAULATORTICS (25*35)
622
623 #define MESSAGETICS (4*35)
624 #define BLINKTHRESHOLD (4*35)
625
626 #define NUMINVENTORYSLOTS       NUMARTIFACTS
627
628 typedef struct
629 {
630         int type;
631         int count;
632 } inventory_t;
633
634 /*
635 ================
636 =
637 = player_t
638 =
639 ================
640 */
641
642 typedef struct player_s
643 {
644         mobj_t *mo;
645         playerstate_t playerstate;
646         ticcmd_t cmd;
647
648 #if defined( __cplusplus )
649         pclass_t        c_class;                                        // player class type
650 #else
651         pclass_t        class;                                  // player class type
652 #endif
653
654         fixed_t         viewz;                                  // focal origin above r.z
655         fixed_t         viewheight;                             // base height above floor for viewz
656         fixed_t         deltaviewheight;                // squat speed
657         fixed_t         bob;                                    // bounded/scaled total momentum
658
659         int                     flyheight;
660         int                     lookdir;
661         boolean         centering;
662         int                     health;                                 // only used between levels, mo->health
663                                                                                 // is used during levels
664         int     armorpoints[NUMARMOR];
665
666         inventory_t     inventory[NUMINVENTORYSLOTS];
667         artitype_t      readyArtifact;
668         int                     artifactCount;
669         int             inventorySlotNum;
670         int                     powers[NUMPOWERS];
671         int                     keys;
672         int                     pieces;                                 // Fourth Weapon pieces
673         signed int                      frags[MAXPLAYERS];              // kills of other players
674         weapontype_t    readyweapon;
675         weapontype_t    pendingweapon;          // wp_nochange if not changing
676         boolean         weaponowned[NUMWEAPONS];
677         int                     mana[NUMMANA];
678         int                     attackdown, usedown;    // true if button down last tic
679         int                     cheats;                                 // bit flags
680
681         int                     refire;                                 // refired shots are less accurate
682
683         int                     killcount, itemcount, secretcount;              // for intermission
684         char            message[80];                    // hint messages
685         int                     messageTics;                    // counter for showing messages
686         short           ultimateMessage;
687         short           yellowMessage;
688         int                     damagecount, bonuscount;// for screen flashing
689         int                     poisoncount;                    // screen flash for poison damage
690         mobj_t          *poisoner;                              // NULL for non-player mobjs
691         mobj_t          *attacker;                              // who did damage (NULL for floors)
692         int                     extralight;                             // so gun flashes light up areas
693         int                     fixedcolormap;                  // can be set to REDCOLORMAP, etc
694         int                     colormap;                               // 0-3 for which color to draw player
695         pspdef_t        psprites[NUMPSPRITES];  // view sprites (gun, etc)
696         int                     morphTics;                              // player is a pig if > 0
697         uint            jumpTics;                               // delay the next jump for a moment
698         unsigned int worldTimer;                        // total time the player's been playing
699 } player_t;
700
701 #define CF_NOCLIP               1
702 #define CF_GODMODE              2
703 #define CF_NOMOMENTUM   4 // not really a cheat, just a debug aid
704
705
706 #define         BACKUPTICS              12
707
708 typedef struct
709 {
710         unsigned        checksum;                                       // high bit is retransmit request
711         byte            retransmitfrom;                         // only valid if NCMD_RETRANSMIT
712         byte            starttic;
713         byte            player, numtics;
714         ticcmd_t        cmds[BACKUPTICS];
715 } doomdata_t;
716
717 typedef struct
718 {
719         long    id;
720         short   intnum;                 // DOOM executes an int to execute commands
721
722 // communication between DOOM and the driver
723         short   command;                // CMD_SEND or CMD_GET
724         short   remotenode;             // dest for send, set by get (-1 = no packet)
725         short   datalength;             // bytes in doomdata to be sent
726
727 // info common to all nodes
728         short   numnodes;               // console is allways node 0
729         short   ticdup;                 // 1 = no duplication, 2-5 = dup for slow nets
730         short   extratics;              // 1 = send a backup tic in every packet
731         short   deathmatch;             // 1 = deathmatch
732         short   savegame;               // -1 = new game, 0-5 = load savegame
733         short   episode;                // 1-3
734         short   map;                    // 1-9
735         short   skill;                  // 1-5
736
737 // info specific to this node
738         short   consoleplayer;
739         short   numplayers;
740         short   angleoffset;    // 1 = left, 0 = center, -1 = right
741         short   drone;                  // 1 = drone
742
743 // packet data to be sent
744         doomdata_t      data;
745 } doomcom_t;
746
747 #define DOOMCOM_ID              0x12345678l
748
749 extern  doomcom_t               *doomcom;
750 extern  doomdata_t              *netbuffer;             // points inside doomcom
751
752 #define MAXNETNODES             16                      // max computers in a game
753
754 #define CMD_SEND        1
755 #define CMD_GET         2
756 #define CMD_FRAG        3
757
758 #define SBARHEIGHT      39                      // status bar height at bottom of screen
759
760 void NET_SendFrags(player_t *player);
761
762 /*
763 ===============================================================================
764
765                                         GLOBAL VARIABLES
766
767 ===============================================================================
768 */
769
770 #define TELEFOGHEIGHT (32*FRACUNIT)
771
772 #define MAXEVENTS 64
773
774 extern event_t events[MAXEVENTS];
775 extern int eventhead;
776 extern int eventtail;
777
778 extern fixed_t finesine[5*FINEANGLES/4];
779 extern fixed_t *finecosine;
780
781 extern gameaction_t gameaction;
782
783 extern boolean paused;
784
785 extern boolean shareware; // true if other episodes not present
786
787 extern boolean DevMaps; // true = map development mode
788 extern char *DevMapsDir; // development maps directory
789
790 extern boolean nomonsters; // checkparm of -nomonsters
791
792 extern boolean respawnparm; // checkparm of -respawn
793
794 extern boolean randomclass; // checkparm of -randclass
795
796 extern boolean debugmode; // checkparm of -debug
797
798 extern boolean usergame; // ok to save / end game
799
800 extern boolean ravpic; // checkparm of -ravpic
801
802 extern boolean altpal; // checkparm to use an alternate palette routine
803
804 extern boolean cdrom; // true if cd-rom mode active ("-cdrom")
805
806 extern boolean deathmatch; // only if started as net death
807
808 extern boolean netgame; // only true if >1 player
809
810 extern boolean cmdfrag; // true if a CMD_FRAG packet should be sent out every
811                                                 // kill
812
813 extern boolean playeringame[MAXPLAYERS];
814 extern pclass_t PlayerClass[MAXPLAYERS];
815
816 extern int consoleplayer; // player taking events and displaying
817
818 extern int displayplayer;
819
820 extern int viewangleoffset;     // ANG90 = left side, ANG270 = right
821
822 extern player_t players[MAXPLAYERS];
823
824 extern  boolean         singletics;                     // debug flag to cancel adaptiveness
825
826 extern boolean DebugSound; // debug flag for displaying sound info
827
828 extern boolean demoplayback;
829 extern int maxzone;                             // Maximum chunk allocated for zone heap
830
831 extern int Sky1Texture;
832 extern int Sky2Texture;
833
834 extern  gamestate_t     gamestate;
835 extern  skill_t         gameskill;
836 //extern        boolean         respawnmonsters;
837 extern  int                     gameepisode;
838 extern  int                     gamemap;
839 extern  int                     prevmap;
840 extern  int                     levelstarttic;          // gametic at level start
841 extern  int                     leveltime;                      // tics in game play for par
842
843 extern  ticcmd_t        netcmds[MAXPLAYERS][BACKUPTICS];
844 extern int ticdup;
845
846 //#define       MAXNETNODES             8
847
848 extern  ticcmd_t                localcmds[BACKUPTICS];
849 extern int rndindex;
850 extern int gametic, maketic;
851 extern  int             nettics[MAXNETNODES];
852
853 #define MAXDEATHMATCHSTARTS 16
854 extern mapthing_t *deathmatch_p;
855 extern mapthing_t deathmatchstarts[MAXDEATHMATCHSTARTS];
856
857 // Position indicator for cooperative net-play reborn
858 extern int RebornPosition;
859
860 #define MAX_PLAYER_STARTS 8
861 extern mapthing_t playerstarts[MAX_PLAYER_STARTS][MAXPLAYERS];
862
863 extern int viewwindowx;
864 extern int viewwindowy;
865 extern int viewwidth;
866 extern int scaledviewwidth;
867 extern int viewheight;
868
869 extern int mouseSensitivity;
870
871 extern boolean precache; // if true, load all graphics at level load
872
873 extern byte *screen; // off screen work buffer, from V_video.c
874
875 extern boolean singledemo; // quit after playing a demo from cmdline
876
877 extern FILE *debugfile;
878 extern int bodyqueslot;
879 extern skill_t startskill;
880 extern int startepisode;
881 extern int startmap;
882 extern boolean autostart;
883
884
885 /*
886 ===============================================================================
887
888                                         GLOBAL FUNCTIONS
889
890 ===============================================================================
891 */
892
893
894 fixed_t FixedMul (fixed_t a, fixed_t b);
895 fixed_t FixedDiv (fixed_t a, fixed_t b);
896 fixed_t FixedDiv2 (fixed_t a, fixed_t b);
897
898
899 //#ifdef __linux
900 #define FixedMul(fa,fb) ({ int __value, __fb = (fb); \
901 __asm__("imul %%ebx; shrd $16,%%edx,%%eax" \
902         : "=a" (__value) \
903         : "0" (fa), "b" (__fb) \
904         : "edx" ); __value; })
905 #define FixedDiv2(fa,fb) ({ int __value; \
906 __asm__("cdq; shld $16,%%eax,%%edx; sall $16,%%eax; idiv %%ebx" \
907         : "=a" (__value) \
908         : "0" (fa), "b" (fb) \
909         : "edx" ); __value; })
910 //#endif
911
912 #ifdef __BIG_ENDIAN__
913 short ShortSwap(short);
914 long LongSwap(long);
915 #define SHORT(x)        ShortSwap(x)
916 #define LONG(x)         LongSwap(x)
917 #else
918 #define SHORT(x)        (x)
919 #define LONG(x)         (x)
920 #endif
921
922
923 //-----------
924 //MEMORY ZONE
925 //-----------
926 // tags < 100 are not overwritten until freed
927 #define PU_STATIC               1                       // static entire execution time
928 #define PU_SOUND                2                       // static while playing
929 #define PU_MUSIC                3                       // static while playing
930 #define PU_DAVE                 4                       // anything else Dave wants static
931 #define PU_LEVEL                50                      // static until level exited
932 #define PU_LEVSPEC              51                      // a special thinker in a level
933 // tags >= 100 are purgable whenever needed
934 #define PU_PURGELEVEL   100
935 #define PU_CACHE                101
936
937
938 void    Z_Init (void);
939 void    *Z_Malloc (int size, int tag, void *ptr);
940 void    Z_Free (void *ptr);
941 void    Z_FreeTags (int lowtag, int hightag);
942 //void  Z_DumpHeap (int lowtag, int hightag);
943 //void  Z_FileDumpHeap (FILE *f);
944 void    Z_CheckHeap (void);
945 void    Z_ChangeTag2 (void *ptr, int tag);
946 //int   Z_FreeMemory (void);
947
948 typedef struct memblock_s
949 {
950         int                     size;           // including the header and possibly tiny fragments
951         void            **user;         // NULL if a free block
952         int                     tag;            // purgelevel
953         int                     id;                     // should be ZONEID
954         struct memblock_s       *next, *prev;
955 } memblock_t;
956
957 #define Z_ChangeTag(p,t) \
958 { \
959 if (( (memblock_t *)( (byte *)(p) - sizeof(memblock_t)))->id!=0x1d4a11) \
960         I_Error("Z_CT at "__FILE__":%i",__LINE__); \
961 Z_ChangeTag2(p,t); \
962 };
963
964 //-------
965 //WADFILE
966 //-------
967 typedef struct
968 {
969         char            name[8];
970         int                     handle,position,size;
971 } lumpinfo_t;
972
973 extern lumpinfo_t *lumpinfo;
974 extern int numlumps;
975
976 void W_InitMultipleFiles(char **filenames);
977 void W_OpenAuxiliary(char *filename);
978 void W_CloseAuxiliaryFile(void);
979 void W_CloseAuxiliary(void);
980 void W_UsePrimary(void);
981 void W_UseAuxiliary(void);
982 int W_CheckNumForName(char *name);
983 int W_GetNumForName(char *name);
984 int W_LumpLength(int lump);
985 void W_ReadLump(int lump, void *dest);
986 void *W_CacheLumpNum(int lump, int tag);
987 void *W_CacheLumpName(char *name, int tag);
988
989 //----------
990 //BASE LEVEL
991 //----------
992 void H2_Main(void);
993 // not a globally visible function, just included for source reference
994 // calls all startup code
995 // parses command line options
996 // if not overrided, calls N_AdvanceDemo
997
998 void H2_GameLoop(void);
999 // not a globally visible function, just included for source reference
1000 // called by H2_Main, never exits
1001 // manages timing and IO
1002 // calls all ?_Responder, ?_Ticker, and ?_Drawer functions
1003 // calls I_GetTime, I_StartFrame, and I_StartTic
1004
1005 void H2_PostEvent(event_t *ev);
1006 // called by IO functions when input is detected
1007
1008 void NetUpdate (void);
1009 // create any new ticcmds and broadcast to other players
1010
1011 void D_QuitNetGame (void);
1012 // broadcasts special packets to other players to notify of game exit
1013
1014 void TryRunTics (void);
1015
1016 //---------
1017 //SYSTEM IO
1018 //---------
1019 #if 1
1020 #define SCREENWIDTH             320
1021 #define SCREENHEIGHT    200
1022 #else
1023 #define SCREENWIDTH             560
1024 #define SCREENHEIGHT    375
1025 #endif
1026
1027 byte *I_ZoneBase (int *size);
1028 // called by startup code to get the ammount of memory to malloc
1029 // for the zone management
1030
1031 int I_GetTime (void);
1032 // called by H2_GameLoop
1033 // returns current time in tics
1034
1035 void I_StartFrame (void);
1036 // called by H2_GameLoop
1037 // called before processing any tics in a frame (just after displaying a frame)
1038 // time consuming syncronous operations are performed here (joystick reading)
1039 // can call H2_PostEvent
1040
1041 void I_StartTic (void);
1042 // called by H2_GameLoop
1043 // called before processing each tic in a frame
1044 // quick syncronous operations are performed here
1045 // can call H2_PostEvent
1046
1047 // asyncronous interrupt functions should maintain private ques that are
1048 // read by the syncronous functions to be converted into events
1049
1050 void I_Init (void);
1051 // called by H2_Main
1052 // determines the hardware configuration and sets up the video mode
1053
1054 void I_InitGraphics (void);
1055
1056 void I_InitNetwork (void);
1057 void I_NetCmd (void);
1058
1059 void I_CheckExternDriver(void);
1060
1061 void I_Error (char *error, ...);
1062 // called by anything that can generate a terminal error
1063 // bad exit with diagnostic message
1064
1065 void I_Quit (void);
1066 // called by M_Responder when quit is selected
1067 // clean exit, displays sell blurb
1068
1069 void I_SetPalette (byte *palette);
1070 // takes full 8 bit values
1071
1072 void I_Update(void);
1073 // Copy buffer to video
1074
1075 void I_WipeUpdate(wipe_t wipe);
1076 // Copy buffer to video with wipe effect
1077
1078 void I_WaitVBL(int count);
1079 // wait for vertical retrace or pause a bit
1080
1081 void I_BeginRead (void);
1082 void I_EndRead (void);
1083
1084 byte    *I_AllocLow (int length);
1085 // allocates from low memory under dos, just mallocs under unix
1086
1087 void I_Tactile (int on, int off, int total);
1088
1089 #if defined(__linux)
1090 extern boolean useexterndriver;
1091
1092 #define EBT_FIRE                        1
1093 #define EBT_OPENDOOR            2
1094 #define EBT_SPEED                       4
1095 #define EBT_STRAFE                      8
1096 #define EBT_MAP                         0x10
1097 #define EBT_INVENTORYLEFT       0x20
1098 #define EBT_INVENTORYRIGHT      0x40
1099 #define EBT_USEARTIFACT         0x80
1100 #define EBT_FLYDROP                     0x100
1101 #define EBT_CENTERVIEW          0x200
1102 #define EBT_PAUSE                       0x400
1103 #define EBT_WEAPONCYCLE         0x800
1104 #define EBT_JUMP                        0x1000
1105
1106 typedef struct
1107 {
1108         short vector; // Interrupt vector
1109         
1110         signed char moveForward; // forward/backward (maxes at 50)
1111         signed char moveSideways; // strafe (maxes at 24)
1112         short angleTurn; // turning speed (640 [slow] 1280 [fast])
1113         short angleHead; // head angle (+2080 [left] : 0 [center] : -2048 [right])
1114         signed char pitch; // look up/down (-110 : +90)
1115         signed char flyDirection; // flyheight (+1/-1)
1116         unsigned short buttons; // EBT_* flags
1117 } externdata_t;
1118 #endif
1119
1120 //----
1121 //GAME
1122 //----
1123
1124 void G_DeathMatchSpawnPlayer (int playernum);
1125
1126 void G_InitNew (skill_t skill, int episode, int map);
1127
1128 void G_DeferedInitNew (skill_t skill, int episode, int map);
1129 // can be called by the startup code or M_Responder
1130 // a normal game starts at map 1, but a warp test can start elsewhere
1131
1132 void G_DeferredNewGame(skill_t skill);
1133
1134 void G_DeferedPlayDemo (char *demo);
1135
1136 void G_LoadGame(int slot);
1137 // can be called by the startup code or M_Responder
1138 // calls P_SetupLevel or W_EnterWorld
1139 void G_DoLoadGame (void);
1140
1141 void G_SaveGame (int slot, char *description);
1142 // called by M_Responder
1143
1144 void G_RecordDemo (skill_t skill, int numplayers, int episode
1145         , int map, char *name);
1146 // only called by startup code
1147
1148 void G_PlayDemo (char *name);
1149 void G_TimeDemo (char *name);
1150
1151 void G_TeleportNewMap(int map, int position);
1152
1153 void G_Completed(int map, int position);
1154 //void G_ExitLevel (void);
1155 //void G_SecretExitLevel (void);
1156
1157 void G_StartNewGame(skill_t skill);
1158 void G_StartNewInit(void);
1159
1160 void G_WorldDone (void);
1161
1162 void G_Ticker (void);
1163 boolean G_Responder (event_t *ev);
1164
1165 void G_ScreenShot (void);
1166
1167 //-------
1168 //SV_SAVE
1169 //-------
1170
1171 #define HXS_VERSION_TEXT "HXS Ver 2.37"
1172 #define HXS_VERSION_TEXT_LENGTH 16
1173 #define HXS_DESCRIPTION_LENGTH 24
1174
1175 void SV_SaveGame(int slot, char *description);
1176 void SV_SaveMap(boolean savePlayers);
1177 void SV_LoadGame(int slot);
1178 void SV_MapTeleport(int map, int position);
1179 void SV_LoadMap(void);
1180 void SV_InitBaseSlot(void);
1181 void SV_UpdateRebornSlot(void);
1182 void SV_ClearRebornSlot(void);
1183 boolean SV_RebornSlotAvailable(void);
1184 int SV_GetRebornSlot(void);
1185
1186 //-----
1187 //PLAY
1188 //-----
1189
1190 void P_Ticker (void);
1191 // called by C_Ticker
1192 // can call G_PlayerExited
1193 // carries out all thinking of monsters and players
1194
1195 void P_SetupLevel (int episode, int map, int playermask, skill_t skill);
1196 // called by W_Ticker
1197
1198 void P_Init (void);
1199 // called by startup code
1200
1201 int P_GetMapCluster(int map);
1202 int P_TranslateMap(int map);
1203 int P_GetMapCDTrack(int map);
1204 int P_GetMapWarpTrans(int map);
1205 int P_GetMapNextMap(int map);
1206 int P_GetMapSky1Texture(int map);
1207 int P_GetMapSky2Texture(int map);
1208 char *P_GetMapName(int map);
1209 fixed_t P_GetMapSky1ScrollDelta(int map);
1210 fixed_t P_GetMapSky2ScrollDelta(int map);
1211 boolean P_GetMapDoubleSky(int map);
1212 boolean P_GetMapLightning(int map);
1213 boolean P_GetMapFadeTable(int map);
1214 char *P_GetMapSongLump(int map);
1215 void P_PutMapSongLump(int map, char *lumpName);
1216 int P_GetCDStartTrack(void);
1217 int P_GetCDEnd1Track(void);
1218 int P_GetCDEnd2Track(void);
1219 int P_GetCDEnd3Track(void);
1220 int P_GetCDIntermissionTrack(void);
1221 int P_GetCDTitleTrack(void);
1222
1223 //-------
1224 //REFRESH
1225 //-------
1226
1227 extern boolean setsizeneeded;
1228
1229 extern boolean BorderNeedRefresh;
1230 extern boolean BorderTopRefresh;
1231
1232 extern int UpdateState;
1233 // define the different areas for the dirty map
1234 #define I_NOUPDATE      0
1235 #define I_FULLVIEW      1
1236 #define I_STATBAR       2
1237 #define I_MESSAGES      4
1238 #define I_FULLSCRN      8
1239
1240 void R_RenderPlayerView (player_t *player);
1241 // called by G_Drawer
1242
1243 void R_Init (void);
1244 // called by startup code
1245
1246 void R_DrawViewBorder (void);
1247 void R_DrawTopBorder (void);
1248 // if the view size is not full screen, draws a border around it
1249
1250 void R_SetViewSize (int blocks, int detail);
1251 // called by M_Responder
1252
1253 int     R_FlatNumForName (char *name);
1254
1255 int     R_TextureNumForName (char *name);
1256 int     R_CheckTextureNumForName (char *name);
1257 // called by P_Ticker for switches and animations
1258 // returns the texture number for the texture name
1259
1260
1261 //----
1262 //MISC
1263 //----
1264 extern  int             myargc;
1265 extern  char    **myargv;
1266 extern  int             localQuakeHappening[MAXPLAYERS];
1267
1268 int     M_CheckParm(char *check);
1269 // returns the position of the given parameter in the arg list (0 if not found)
1270 boolean M_ParmExists(char *check);
1271
1272 void M_ExtractFileBase(char *path, char *dest);
1273
1274 void M_ForceUppercase(char *text);
1275 // Changes a string to uppercase
1276
1277 int M_Random (void);
1278 // returns a number from 0 to 255
1279
1280 extern unsigned char rndtable[256];
1281 extern int prndindex;
1282 #define P_Random() rndtable[(++prndindex)&0xff]
1283 // as M_Random, but used only by the play simulation
1284
1285 void M_ClearRandom (void);
1286 // fix randoms for demos
1287
1288 void M_FindResponseFile(void);
1289
1290 void M_ClearBox (fixed_t *box);
1291 void M_AddToBox (fixed_t *box, fixed_t x, fixed_t y);
1292 // bounding box functions
1293
1294 boolean M_WriteFile(char const *name, void *source, int length);
1295 int M_ReadFile(char const *name, byte **buffer);
1296 int M_ReadFileCLib(char const *name, byte **buffer);
1297
1298 void M_ScreenShot (void);
1299
1300 void M_LoadDefaults(char *fileName);
1301
1302 void M_SaveDefaults (void);
1303
1304 int M_DrawText (int x, int y, boolean direct, char *string);
1305
1306 //------------------------------
1307 // SC_man.c
1308 //------------------------------
1309
1310 void SC_Open(char *name);
1311 void SC_OpenLump(char *name);
1312 void SC_OpenFile(char *name);
1313 void SC_OpenFileCLib(char *name);
1314 void SC_Close(void);
1315 boolean SC_GetString(void);
1316 void SC_MustGetString(void);
1317 void SC_MustGetStringName(char *name);
1318 boolean SC_GetNumber(void);
1319 void SC_MustGetNumber(void);
1320 void SC_UnGet(void);
1321 //boolean SC_Check(void);
1322 boolean SC_Compare(char *text);
1323 int SC_MatchString(char **strings);
1324 int SC_MustMatchString(char **strings);
1325 void SC_ScriptError(char *message);
1326
1327 extern char *sc_String;
1328 extern int sc_Number;
1329 extern int sc_Line;
1330 extern boolean sc_End;
1331 extern boolean sc_Crossed;
1332 extern boolean sc_FileScripts;
1333 extern char *sc_ScriptsDir;
1334
1335 //------------------------------
1336 // SN_sonix.c
1337 //------------------------------
1338
1339 enum
1340 {
1341         SEQ_PLATFORM,
1342         SEQ_PLATFORM_HEAVY,             // same script as a normal platform
1343         SEQ_PLATFORM_METAL,
1344         SEQ_PLATFORM_CREAK,             // same script as a normal platform
1345         SEQ_PLATFORM_SILENCE,
1346         SEQ_PLATFORM_LAVA,
1347         SEQ_PLATFORM_WATER,
1348         SEQ_PLATFORM_ICE,
1349         SEQ_PLATFORM_EARTH,
1350         SEQ_PLATFORM_METAL2,
1351         SEQ_DOOR_STONE,
1352         SEQ_DOOR_HEAVY,
1353         SEQ_DOOR_METAL,
1354         SEQ_DOOR_CREAK,
1355         SEQ_DOOR_SILENCE,
1356         SEQ_DOOR_LAVA,
1357         SEQ_DOOR_WATER,
1358         SEQ_DOOR_ICE,
1359         SEQ_DOOR_EARTH,
1360         SEQ_DOOR_METAL2,
1361         SEQ_ESOUND_WIND,
1362         SEQ_NUMSEQ
1363 };
1364
1365 typedef enum
1366 {
1367         SEQTYPE_STONE,
1368         SEQTYPE_HEAVY,
1369         SEQTYPE_METAL,
1370         SEQTYPE_CREAK,
1371         SEQTYPE_SILENCE,
1372         SEQTYPE_LAVA,
1373         SEQTYPE_WATER,
1374         SEQTYPE_ICE,
1375         SEQTYPE_EARTH,
1376         SEQTYPE_METAL2,
1377         SEQTYPE_NUMSEQ
1378 } seqtype_t;
1379
1380 void SN_InitSequenceScript(void);
1381 void SN_StartSequence(mobj_t *mobj, int sequence);
1382 void SN_StartSequenceName(mobj_t *mobj, char *name);
1383 void SN_StopSequence(mobj_t *mobj);
1384 void SN_UpdateActiveSequences(void);
1385 void SN_StopAllSequences(void);
1386 int SN_GetSequenceOffset(int sequence, int *sequencePtr);
1387 void SN_ChangeNodeData(int nodeNum, int seqOffset, int delayTics, int volume,
1388         int currentSoundID);
1389
1390
1391 typedef struct seqnode_s seqnode_t;
1392 struct seqnode_s
1393 {
1394         int *sequencePtr;
1395         int     sequence;
1396         mobj_t *mobj;
1397         int currentSoundID;
1398         int delayTics;
1399         int volume;
1400         int stopSound;
1401         seqnode_t *prev;
1402         seqnode_t *next;
1403 };
1404
1405 extern int ActiveSequences;
1406 extern seqnode_t *SequenceListHead;
1407
1408 extern boolean nosound;
1409 extern int mouselook;
1410 extern int globheight;
1411 extern int globwidth; 
1412 extern int lu2sux(int x);
1413 extern int lu2suy(int y);
1414 //----------------------
1415 // Interlude (IN_lude.c)
1416 //----------------------
1417
1418 #define MAX_INTRMSN_MESSAGE_SIZE 1024
1419
1420 extern boolean intermission;
1421 extern char ClusterMessage[MAX_INTRMSN_MESSAGE_SIZE];
1422
1423 void IN_Start(void);
1424 void IN_Ticker(void);
1425 void IN_Drawer(void);
1426
1427 //----------------------
1428 // Chat mode (CT_chat.c)
1429 //----------------------
1430
1431 void CT_Init(void);
1432 void CT_Drawer(void);
1433 boolean CT_Responder(event_t *ev);
1434 void CT_Ticker(void);
1435 char CT_dequeueChatChar(void);
1436
1437 extern boolean chatmodeon;
1438
1439 //--------------------
1440 // Finale (F_finale.c)
1441 //--------------------
1442
1443 void F_Drawer(void);
1444 void F_Ticker(void);
1445 void F_StartFinale(void);
1446
1447 //----------------------
1448 // STATUS BAR (SB_bar.c)
1449 //----------------------
1450
1451 extern int inv_ptr;
1452 extern int curpos;
1453 extern int SB_state;
1454 void SB_Init(void);
1455 void SB_SetClassData(void);
1456 boolean SB_Responder(event_t *event);
1457 void SB_Ticker(void);
1458 void SB_Drawer(void);
1459 void Draw_TeleportIcon(void);
1460 void Draw_SaveIcon(void);
1461 void Draw_LoadIcon(void);
1462
1463 //-----------------
1464 // MENU (MN_menu.c)
1465 //-----------------
1466
1467 void MN_Init(void);
1468 void MN_ActivateMenu(void);
1469 void MN_DeactivateMenu(void);
1470 boolean MN_Responder(event_t *event);
1471 void MN_Ticker(void);
1472 void MN_Drawer(void);
1473 void MN_DrTextA(char *text, int x, int y);
1474 void MN_DrTextAYellow(char *text, int x, int y);
1475 int MN_TextAWidth(char *text);
1476 void MN_DrTextB(char *text, int x, int y);
1477 int MN_TextBWidth(char *text);
1478
1479 //------
1480 // VIDEO
1481 //------
1482
1483 extern int dirtybox[4];
1484 extern byte gammatable[5][256];
1485 extern int usegamma;
1486
1487 void V_Init(void); // Allocates buffer screens, call before R_Init
1488 void V_DrawPatch(int x, int y, patch_t *patch);
1489 void V_DrawFuzzPatch(int x, int y, patch_t *patch);
1490 void V_DrawAltFuzzPatch(int x, int y, patch_t *patch);
1491 void V_DrawShadowedPatch(int x, int y, patch_t *patch);
1492 void V_DrawRawScreen(byte *raw);
1493
1494 #include "sounds.h"
1495
1496 #ifdef RENDER3D
1497 #define FIX2FLT(x)      ((float)((x)>>FRACBITS) + (float)((x)&(FRACUNIT-1)) / (float)(FRACUNIT))
1498 #define Q_FIX2FLT(x)    ((float)((x)>>FRACBITS))
1499 #endif
1500
1501 #endif // __H2DEF__