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