1 //
2 // Copyright(C) 1993-1996 Id Software, Inc.
3 // Copyright(C) 1993-2008 Raven Software
4 // Copyright(C) 2005-2014 Simon Howard
5 //
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 
17 // DoomDef.h
18 
19 #ifndef __DOOMDEF__
20 #define __DOOMDEF__
21 #include <stdio.h>
22 #include <string.h>
23 //haleyjd: removed WATCOMC
24 #include <limits.h>
25 
26 #define HERETIC_VERSION 130
27 #define HERETIC_VERSION_TEXT "v1.3"
28 
29 // if rangecheck is undefined, most parameter validation debugging code
30 // will not be compiled
31 //#define RANGECHECK
32 
33 // all external data is defined here
34 #include "doomdata.h"
35 
36 // all important printed strings
37 #include "dstrings.h"
38 
39 // header generated by multigen utility
40 #include "info.h"
41 
42 // WAD file access
43 #include "w_wad.h"
44 
45 // fixed_t
46 #include "m_fixed.h"
47 
48 // angle_t
49 #include "tables.h"
50 
51 // events
52 #include "d_event.h"
53 
54 // gamemode/mission
55 #include "d_mode.h"
56 
57 // ticcmd_t
58 #include "d_ticcmd.h"
59 
60 #include "d_loop.h"
61 
62 #define	SAVEGAMENAME "hticsav"
63 
64 /*
65 ===============================================================================
66 
67 						GLOBAL TYPES
68 
69 ===============================================================================
70 */
71 
72 #define NUMARTIFCTS	28
73 #define MAXPLAYERS	4
74 
75 #define	BT_ATTACK		1
76 #define	BT_USE			2
77 #define	BT_CHANGE		4       // if true, the next 3 bits hold weapon num
78 #define	BT_WEAPONMASK	(8+16+32)
79 #define	BT_WEAPONSHIFT	3
80 
81 #define BT_SPECIAL		128     // game events, not really buttons
82 #define	BTS_SAVEMASK	(4+8+16)
83 #define	BTS_SAVESHIFT	2
84 #define	BT_SPECIALMASK	3
85 #define	BTS_PAUSE		1       // pause the game
86 #define	BTS_SAVEGAME	2       // save the game at each console
87 // savegame slot numbers occupy the second byte of buttons
88 
89 typedef enum
90 {
91     GS_LEVEL,
92     GS_INTERMISSION,
93     GS_FINALE,
94     GS_DEMOSCREEN
95 } gamestate_t;
96 
97 typedef enum
98 {
99     ga_nothing,
100     ga_loadlevel,
101     ga_newgame,
102     ga_loadgame,
103     ga_savegame,
104     ga_playdemo,
105     ga_completed,
106     ga_victory,
107     ga_worlddone,
108     ga_screenshot
109 } gameaction_t;
110 
111 typedef enum
112 {
113     wipe_0,
114     wipe_1,
115     wipe_2,
116     wipe_3,
117     wipe_4,
118     NUMWIPES,
119     wipe_random
120 } wipe_t;
121 
122 /*
123 ===============================================================================
124 
125 							MAPOBJ DATA
126 
127 ===============================================================================
128 */
129 
130 // think_t is a function pointer to a routine to handle an actor
131 typedef void (*think_t) ();
132 
133 typedef struct thinker_s
134 {
135     struct thinker_s *prev, *next;
136     think_t function;
137 } thinker_t;
138 
139 typedef union
140 {
141     int i;
142     struct mobj_s *m;
143 } specialval_t;
144 
145 struct player_s;
146 
147 typedef struct mobj_s
148 {
149     thinker_t thinker;          // thinker links
150 
151 // info for drawing
152     fixed_t x, y, z;
153     struct mobj_s *snext, *sprev;       // links in sector (if needed)
154     angle_t angle;
155     spritenum_t sprite;         // used to find patch_t and flip value
156     int frame;                  // might be ord with FF_FULLBRIGHT
157 
158 // interaction info
159     struct mobj_s *bnext, *bprev;       // links in blocks (if needed)
160     struct subsector_s *subsector;
161     fixed_t floorz, ceilingz;   // closest together of contacted secs
162     fixed_t radius, height;     // for movement checking
163     fixed_t momx, momy, momz;   // momentums
164 
165     int validcount;             // if == validcount, already checked
166 
167     mobjtype_t type;
168     mobjinfo_t *info;           // &mobjinfo[mobj->type]
169     int tics;                   // state tic counter
170     state_t *state;
171     int damage;                 // For missiles
172     int flags;
173     int flags2;                 // Heretic flags
174     specialval_t special1;      // Special info
175     specialval_t special2;      // Special info
176     int health;
177     int movedir;                // 0-7
178     int movecount;              // when 0, select a new dir
179     struct mobj_s *target;      // thing being chased/attacked (or NULL)
180     // also the originator for missiles
181     int reactiontime;           // if non 0, don't attack yet
182     // used by player to freeze a bit after
183     // teleporting
184     int threshold;              // if >0, the target will be chased
185     // no matter what (even if shot)
186     struct player_s *player;    // only valid if type == MT_PLAYER
187     int lastlook;               // player number last looked for
188 
189     mapthing_t spawnpoint;      // for nightmare respawn
190 } mobj_t;
191 
192 // each sector has a degenmobj_t in it's center for sound origin purposes
193 typedef struct
194 {
195     thinker_t thinker;          // not used for anything
196     fixed_t x, y, z;
197 } degenmobj_t;
198 
199 //
200 // frame flags
201 //
202 #define	FF_FULLBRIGHT	0x8000  // flag in thing->frame
203 #define FF_FRAMEMASK	0x7fff
204 
205 // --- mobj.flags ---
206 
207 #define	MF_SPECIAL	1         // call P_SpecialThing when touched
208 #define	MF_SOLID	2
209 #define	MF_SHOOTABLE	4
210 #define	MF_NOSECTOR	8         // don't use the sector links
211                                   // (invisible but touchable)
212 #define	MF_NOBLOCKMAP	16        // don't use the blocklinks
213                                   // (inert but displayable)
214 #define	MF_AMBUSH	32
215 #define	MF_JUSTHIT	64        // try to attack right back
216 #define	MF_JUSTATTACKED	128       // take at least one step before attacking
217 #define	MF_SPAWNCEILING	256       // hang from ceiling instead of floor
218 #define	MF_NOGRAVITY	512       // don't apply gravity every tic
219 
220 // movement flags
221 #define	MF_DROPOFF	0x400     // allow jumps from high places
222 #define	MF_PICKUP	0x800     // for players to pick up items
223 #define	MF_NOCLIP	0x1000    // player cheat
224 #define	MF_SLIDE	0x2000    // keep info about sliding along walls
225 #define	MF_FLOAT	0x4000    // allow moves to any height, no gravity
226 #define	MF_TELEPORT	0x8000    // don't cross lines or look at heights
227 #define MF_MISSILE	0x10000   // don't hit same species, explode on block
228 
229 #define	MF_DROPPED	0x20000   // dropped by a demon, not level spawned
230 #define	MF_SHADOW	0x40000   // use translucent draw (shadow demons / invis)
231 #define	MF_NOBLOOD	0x80000   // don't bleed when shot (use puff)
232 #define	MF_CORPSE	0x100000  // don't stop moving halfway off a step
233 #define	MF_INFLOAT	0x200000  // floating to a height for a move, don't
234                                   // auto float to target's height
235 
236 #define	MF_COUNTKILL	0x400000  // count towards intermission kill total
237 #define	MF_COUNTITEM	0x800000  // count towards intermission item total
238 
239 #define	MF_SKULLFLY	0x1000000 // skull in flight
240 #define	MF_NOTDMATCH	0x2000000 // don't spawn in death match (key cards)
241 
242 #define	MF_TRANSLATION	0xc000000 // if 0x4 0x8 or 0xc, use a translation
243 #define	MF_TRANSSHIFT	26      // table for player colormaps
244 
245 // --- mobj.flags2 ---
246 
247 #define MF2_LOGRAV		0x00000001  // alternate gravity setting
248 #define MF2_WINDTHRUST		0x00000002  // gets pushed around by the wind
249                                             // specials
250 #define MF2_FLOORBOUNCE		0x00000004  // bounces off the floor
251 #define MF2_THRUGHOST		0x00000008  // missile will pass through ghosts
252 #define MF2_FLY			0x00000010  // fly mode is active
253 #define MF2_FOOTCLIP		0x00000020  // if feet are allowed to be clipped
254 #define MF2_SPAWNFLOAT		0x00000040  // spawn random float z
255 #define MF2_NOTELEPORT		0x00000080  // does not teleport
256 #define MF2_RIP			0x00000100  // missile rips through solid
257                                             // targets
258 #define MF2_PUSHABLE		0x00000200  // can be pushed by other moving
259                                             // mobjs
260 #define MF2_SLIDE		0x00000400  // slides against walls
261 #define MF2_ONMOBJ		0x00000800  // mobj is resting on top of another
262                                             // mobj
263 #define MF2_PASSMOBJ		0x00001000  // Enable z block checking.  If on,
264                                             // this flag will allow the mobj to
265                                             // pass over/under other mobjs.
266 #define MF2_CANNOTPUSH		0x00002000  // cannot push other pushable mobjs
267 #define MF2_FEETARECLIPPED	0x00004000  // a mobj's feet are now being cut
268 #define MF2_BOSS		0x00008000  // mobj is a major boss
269 #define MF2_FIREDAMAGE		0x00010000  // does fire damage
270 #define MF2_NODMGTHRUST		0x00020000  // does not thrust target when
271                                             // damaging
272 #define MF2_TELESTOMP		0x00040000  // mobj can stomp another
273 #define MF2_FLOATBOB		0x00080000  // use float bobbing z movement
274 #define MF2_DONTDRAW		0X00100000  // don't generate a vissprite
275 
276 //=============================================================================
277 typedef enum
278 {
279     PST_LIVE,                   // playing
280     PST_DEAD,                   // dead on the ground
281     PST_REBORN                  // ready to restart
282 } playerstate_t;
283 
284 // psprites are scaled shapes directly on the view screen
285 // coordinates are given for a 320*200 view screen
286 typedef enum
287 {
288     ps_weapon,
289     ps_flash,
290     NUMPSPRITES
291 } psprnum_t;
292 
293 typedef struct
294 {
295     state_t *state;             // a NULL state means not active
296     int tics;
297     fixed_t sx, sy;
298 } pspdef_t;
299 
300 typedef enum
301 {
302     key_yellow,
303     key_green,
304     key_blue,
305     NUMKEYS
306 } keytype_t;
307 
308 typedef enum
309 {
310     wp_staff,
311     wp_goldwand,
312     wp_crossbow,
313     wp_blaster,
314     wp_skullrod,
315     wp_phoenixrod,
316     wp_mace,
317     wp_gauntlets,
318     wp_beak,
319     NUMWEAPONS,
320     wp_nochange
321 } weapontype_t;
322 
323 #define AMMO_GWND_WIMPY 10
324 #define AMMO_GWND_HEFTY 50
325 #define AMMO_CBOW_WIMPY 5
326 #define AMMO_CBOW_HEFTY 20
327 #define AMMO_BLSR_WIMPY 10
328 #define AMMO_BLSR_HEFTY 25
329 #define AMMO_SKRD_WIMPY 20
330 #define AMMO_SKRD_HEFTY 100
331 #define AMMO_PHRD_WIMPY 1
332 #define AMMO_PHRD_HEFTY 10
333 #define AMMO_MACE_WIMPY 20
334 #define AMMO_MACE_HEFTY 100
335 
336 typedef enum
337 {
338     am_goldwand,
339     am_crossbow,
340     am_blaster,
341     am_skullrod,
342     am_phoenixrod,
343     am_mace,
344     NUMAMMO,
345     am_noammo                   // staff, gauntlets
346 } ammotype_t;
347 
348 typedef struct
349 {
350     ammotype_t ammo;
351     int upstate;
352     int downstate;
353     int readystate;
354     int atkstate;
355     int holdatkstate;
356     int flashstate;
357 } weaponinfo_t;
358 
359 extern weaponinfo_t wpnlev1info[NUMWEAPONS];
360 extern weaponinfo_t wpnlev2info[NUMWEAPONS];
361 
362 typedef enum
363 {
364     arti_none,
365     arti_invulnerability,
366     arti_invisibility,
367     arti_health,
368     arti_superhealth,
369     arti_tomeofpower,
370     arti_torch,
371     arti_firebomb,
372     arti_egg,
373     arti_fly,
374     arti_teleport,
375     NUMARTIFACTS
376 } artitype_t;
377 
378 typedef enum
379 {
380     pw_None,
381     pw_invulnerability,
382     pw_invisibility,
383     pw_allmap,
384     pw_infrared,
385     pw_weaponlevel2,
386     pw_flight,
387     pw_shield,
388     pw_health2,
389     NUMPOWERS
390 } powertype_t;
391 
392 #define	INVULNTICS (30*35)
393 #define	INVISTICS (60*35)
394 #define	INFRATICS (120*35)
395 #define	IRONTICS (60*35)
396 #define WPNLEV2TICS (40*35)
397 #define FLIGHTTICS (60*35)
398 
399 #define CHICKENTICS (40*35)
400 
401 #define MESSAGETICS (4*35)
402 #define BLINKTHRESHOLD (4*32)
403 
404 #define NUMINVENTORYSLOTS	14
405 typedef struct
406 {
407     int type;
408     int count;
409 } inventory_t;
410 
411 /*
412 ================
413 =
414 = player_t
415 =
416 ================
417 */
418 
419 typedef struct player_s
420 {
421     mobj_t *mo;
422     playerstate_t playerstate;
423     ticcmd_t cmd;
424 
425     fixed_t viewz;              // focal origin above r.z
426     fixed_t viewheight;         // base height above floor for viewz
427     fixed_t deltaviewheight;    // squat speed
428     fixed_t bob;                // bounded/scaled total momentum
429 
430     int flyheight;
431     int lookdir;
432     boolean centering;
433     int health;                 // only used between levels, mo->health
434     // is used during levels
435     int armorpoints, armortype; // armor type is 0-2
436 
437     inventory_t inventory[NUMINVENTORYSLOTS];
438     artitype_t readyArtifact;
439     int artifactCount;
440     int inventorySlotNum;
441     int powers[NUMPOWERS];
442     boolean keys[NUMKEYS];
443     boolean backpack;
444     signed int frags[MAXPLAYERS];       // kills of other players
445     weapontype_t readyweapon;
446     weapontype_t pendingweapon; // wp_nochange if not changing
447     boolean weaponowned[NUMWEAPONS];
448     int ammo[NUMAMMO];
449     int maxammo[NUMAMMO];
450     int attackdown, usedown;    // true if button down last tic
451     int cheats;                 // bit flags
452 
453     int refire;                 // refired shots are less accurate
454 
455     int killcount, itemcount, secretcount;      // for intermission
456     char *message;              // hint messages
457     int messageTics;            // counter for showing messages
458     int damagecount, bonuscount;        // for screen flashing
459     int flamecount;             // for flame thrower duration
460     mobj_t *attacker;           // who did damage (NULL for floors)
461     int extralight;             // so gun flashes light up areas
462     int fixedcolormap;          // can be set to REDCOLORMAP, etc
463     int colormap;               // 0-3 for which color to draw player
464     pspdef_t psprites[NUMPSPRITES];     // view sprites (gun, etc)
465     boolean didsecret;          // true if secret level has been done
466     int chickenTics;            // player is a chicken if > 0
467     int chickenPeck;            // chicken peck countdown
468     mobj_t *rain1;              // active rain maker 1
469     mobj_t *rain2;              // active rain maker 2
470 } player_t;
471 
472 #define CF_NOCLIP		1
473 #define	CF_GODMODE		2
474 #define	CF_NOMOMENTUM	4       // not really a cheat, just a debug aid
475 
476 #define	SBARHEIGHT	42      // status bar height at bottom of screen
477 
478 
479 /*
480 ===============================================================================
481 
482 					GLOBAL VARIABLES
483 
484 ===============================================================================
485 */
486 
487 #define TELEFOGHEIGHT (32*FRACUNIT)
488 
489 extern gameaction_t gameaction;
490 
491 extern boolean paused;
492 
493 extern GameMode_t gamemode;
494 
495 extern boolean ExtendedWAD;     // true if main WAD is the extended version
496 
497 extern boolean nomonsters;      // checkparm of -nomonsters
498 
499 extern boolean respawnparm;     // checkparm of -respawn
500 
501 extern boolean debugmode;       // checkparm of -debug
502 
503 extern boolean usergame;        // ok to save / end game
504 
505 extern boolean ravpic;          // checkparm of -ravpic
506 
507 extern boolean altpal;          // checkparm to use an alternate palette routine
508 
509 extern boolean cdrom;           // true if cd-rom mode active ("-cdrom")
510 
511 extern boolean deathmatch;      // only if started as net death
512 
513 extern boolean netgame;         // only true if >1 player
514 
515 extern boolean playeringame[MAXPLAYERS];
516 
517 extern int consoleplayer;       // player taking events and displaying
518 
519 extern int displayplayer;
520 
521 extern int viewangleoffset;     // ANG90 = left side, ANG270 = right
522 
523 extern player_t players[MAXPLAYERS];
524 
525 extern boolean DebugSound;      // debug flag for displaying sound info
526 
527 extern int GetWeaponAmmo[NUMWEAPONS];
528 
529 extern boolean demorecording;
530 extern boolean demoplayback;
531 extern boolean demoextend;      // allow demos to persist through exit/respawn
532 extern int skytexture;
533 
534 // Truncate angleturn in ticcmds to nearest 256.
535 // Used when recording Vanilla demos in netgames.
536 extern boolean lowres_turn;
537 
538 extern gamestate_t gamestate;
539 extern skill_t gameskill;
540 extern boolean respawnmonsters;
541 extern int gameepisode;
542 extern int gamemap;
543 extern int prevmap;
544 extern int totalkills, totalitems, totalsecret; // for intermission
545 extern int levelstarttic;       // gametic at level start
546 extern int leveltime;           // tics in game play for par
547 
548 extern ticcmd_t *netcmds;
549 
550 #define SAVEGAMESIZE 0x30000
551 #define SAVESTRINGSIZE 24
552 
553 extern mapthing_t *deathmatch_p;
554 extern mapthing_t deathmatchstarts[10];
555 extern mapthing_t playerstarts[MAXPLAYERS];
556 
557 extern int mouseSensitivity;
558 
559 extern boolean precache;        // if true, load all graphics at level load
560 
561 extern boolean singledemo;      // quit after playing a demo from cmdline
562 
563 extern int bodyqueslot;
564 extern skill_t startskill;
565 extern int startepisode;
566 extern int startmap;
567 extern boolean autostart;
568 
569 extern boolean testcontrols;
570 extern int testcontrols_mousespeed;
571 
572 extern int vanilla_savegame_limit;
573 extern int vanilla_demo_limit;
574 
575 /*
576 ===============================================================================
577 
578 					GLOBAL FUNCTIONS
579 
580 ===============================================================================
581 */
582 
583 #include "z_zone.h"
584 
585 //----------
586 //BASE LEVEL
587 //----------
588 void D_DoomMain(void);
589 void IncThermo(void);
590 void InitThermo(int max);
591 void tprintf(char *string, int initflag);
592 // not a globally visible function, just included for source reference
593 // calls all startup code
594 // parses command line options
595 // if not overrided, calls N_AdvanceDemo
596 
597 void D_DoomLoop(void);
598 // not a globally visible function, just included for source reference
599 // called by D_DoomMain, never exits
600 // manages timing and IO
601 // calls all ?_Responder, ?_Ticker, and ?_Drawer functions
602 // calls I_GetTime, I_StartFrame, and I_StartTic
603 
604 //---------
605 //SYSTEM IO
606 //---------
607 byte *I_AllocLow(int length);
608 // allocates from low memory under dos, just mallocs under unix
609 
610 // haleyjd: was WATCOMC, preserved for historical interest.
611 // This is similar to the -control structure in DOOM v1.4 and Strife.
612 #if 0
613 extern boolean useexterndriver;
614 
615 #define EBT_FIRE			1
616 #define EBT_OPENDOOR 		2
617 #define EBT_SPEED			4
618 #define EBT_STRAFE			8
619 #define EBT_MAP				0x10
620 #define EBT_INVENTORYLEFT 	0x20
621 #define EBT_INVENTORYRIGHT 	0x40
622 #define EBT_USEARTIFACT		0x80
623 #define EBT_FLYDROP			0x100
624 #define EBT_CENTERVIEW		0x200
625 #define EBT_PAUSE			0x400
626 #define EBT_WEAPONCYCLE 	0x800
627 
628 typedef struct
629 {
630     short vector;               // Interrupt vector
631 
632     signed char moveForward;    // forward/backward (maxes at 50)
633     signed char moveSideways;   // strafe (maxes at 24)
634     short angleTurn;            // turning speed (640 [slow] 1280 [fast])
635     short angleHead;            // head angle (+2080 [left] : 0 [center] : -2048 [right])
636     signed char pitch;          // look up/down (-110 : +90)
637     signed char flyDirection;   // flyheight (+1/-1)
638     unsigned short buttons;     // EBT_* flags
639 } externdata_t;
640 #endif
641 
642 //----
643 //GAME
644 //----
645 
646 void G_DeathMatchSpawnPlayer(int playernum);
647 
648 void G_InitNew(skill_t skill, int episode, int map);
649 
650 void G_DeferedInitNew(skill_t skill, int episode, int map);
651 // can be called by the startup code or M_Responder
652 // a normal game starts at map 1, but a warp test can start elsewhere
653 
654 void G_DeferedPlayDemo(char *demo);
655 
656 void G_LoadGame(char *name);
657 // can be called by the startup code or M_Responder
658 // calls P_SetupLevel or W_EnterWorld
659 void G_DoLoadGame(void);
660 
661 void G_SaveGame(int slot, char *description);
662 // called by M_Responder
663 
664 #define SAVE_GAME_TERMINATOR 0x1d
665 // Support routines for saving games
666 char *SV_Filename(int slot);
667 void SV_Open(char *fileName);
668 void SV_OpenRead(char *fileName);
669 void SV_Close(char *fileName);
670 void SV_Write(void *buffer, int size);
671 void SV_WriteByte(byte val);
672 void SV_WriteWord(unsigned short val);
673 void SV_WriteLong(unsigned int val);
674 void SV_Read(void *buffer, int size);
675 byte SV_ReadByte(void);
676 uint16_t SV_ReadWord(void);
677 uint32_t SV_ReadLong(void);
678 
679 extern char *savegamedir;
680 
681 void G_RecordDemo(skill_t skill, int numplayers, int episode, int map,
682                   char *name);
683 // only called by startup code
684 
685 void G_PlayDemo(char *name);
686 void G_TimeDemo(char *name);
687 
688 void G_ExitLevel(void);
689 void G_SecretExitLevel(void);
690 
691 void G_WorldDone(void);
692 
693 void G_Ticker(void);
694 boolean G_Responder(event_t * ev);
695 
696 void G_ScreenShot(void);
697 
698 //-----
699 //PLAY
700 //-----
701 
702 void P_Ticker(void);
703 // called by C_Ticker
704 // can call G_PlayerExited
705 // carries out all thinking of monsters and players
706 
707 void P_SetupLevel(int episode, int map, int playermask, skill_t skill);
708 // called by W_Ticker
709 
710 void P_Init(void);
711 // called by startup code
712 
713 void P_ArchivePlayers(void);
714 void P_UnArchivePlayers(void);
715 void P_ArchiveWorld(void);
716 void P_UnArchiveWorld(void);
717 void P_ArchiveThinkers(void);
718 void P_UnArchiveThinkers(void);
719 void P_ArchiveSpecials(void);
720 void P_UnArchiveSpecials(void);
721 // load / save game routines
722 
723 
724 //-------
725 //REFRESH
726 //-------
727 
728 extern boolean setsizeneeded;
729 
730 extern boolean BorderNeedRefresh;
731 extern boolean BorderTopRefresh;
732 
733 extern int UpdateState;
734 // define the different areas for the dirty map
735 #define I_NOUPDATE	0
736 #define I_FULLVIEW	1
737 #define I_STATBAR	2
738 #define I_MESSAGES	4
739 #define I_FULLSCRN	8
740 
741 void R_RenderPlayerView(player_t * player);
742 // called by G_Drawer
743 
744 void R_Init(void);
745 // called by startup code
746 
747 void R_DrawViewBorder(void);
748 void R_DrawTopBorder(void);
749 // if the view size is not full screen, draws a border around it
750 
751 void R_SetViewSize(int blocks, int detail);
752 // called by M_Responder
753 
754 int R_FlatNumForName(char *name);
755 
756 int R_TextureNumForName(char *name);
757 int R_CheckTextureNumForName(char *name);
758 // called by P_Ticker for switches and animations
759 // returns the texture number for the texture name
760 
761 
762 //----
763 //MISC
764 //----
765 // returns the position of the given parameter in the arg list (0 if not found)
766 
767 int M_DrawText(int x, int y, boolean direct, char *string);
768 
769 //----------------------
770 // Interlude (IN_lude.c)
771 //----------------------
772 
773 extern boolean intermission;
774 
775 void IN_Start(void);
776 void IN_Ticker(void);
777 void IN_Drawer(void);
778 
779 //----------------------
780 // Chat mode (CT_chat.c)
781 //----------------------
782 
783 void CT_Init(void);
784 void CT_Drawer(void);
785 boolean CT_Responder(event_t * ev);
786 void CT_Ticker(void);
787 char CT_dequeueChatChar(void);
788 
789 extern boolean chatmodeon;
790 extern boolean ultimatemsg;
791 
792 //--------------------
793 // Finale (F_finale.c)
794 //--------------------
795 
796 void F_Drawer(void);
797 void F_Ticker(void);
798 void F_StartFinale(void);
799 
800 //----------------------
801 // STATUS BAR (SB_bar.c)
802 //----------------------
803 
804 void SB_Init(void);
805 boolean SB_Responder(event_t * event);
806 void SB_Ticker(void);
807 void SB_Drawer(void);
808 
809 //-----------------
810 // MENU (MN_menu.c)
811 //-----------------
812 
813 extern boolean MenuActive;
814 
815 void MN_Init(void);
816 void MN_ActivateMenu(void);
817 void MN_DeactivateMenu(void);
818 boolean MN_Responder(event_t * event);
819 void MN_Ticker(void);
820 void MN_Drawer(void);
821 void MN_DrTextA(char *text, int x, int y);
822 int MN_TextAWidth(char *text);
823 void MN_DrTextB(char *text, int x, int y);
824 int MN_TextBWidth(char *text);
825 
826 #include "sounds.h"
827 
828 #endif // __DOOMDEF__
829