fix remapping behavior. Remapping is only necessary if we are rendering on the workbe...
[AROS-Contrib.git] / Games / Doom / p_spec.h
blob24bf276537303a81243bb70298c3933f926874c9
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id$
5 //
6 // Copyright (C) 1993-1996 by id Software, Inc.
7 //
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
15 // for more details.
17 // DESCRIPTION: none
18 // Implements special effects:
19 // Texture animation, height or lighting changes
20 // according to adjacent sectors, respective
21 // utility functions, etc.
23 //-----------------------------------------------------------------------------
26 #ifndef __P_SPEC__
27 #define __P_SPEC__
29 #ifndef __GNUC__
30 #pragma options align=mac68k
31 #endif
34 // End-level timer (-TIMER option)
36 extern boolean levelTimer;
37 extern int levelTimeCount;
40 // Define values for map objects
41 #define MO_TELEPORTMAN 14
44 // at game start
45 void P_InitPicAnims (void);
47 // at map load
48 void P_SpawnSpecials (void);
50 // every tic
51 void P_UpdateSpecials (void);
53 // when needed
54 boolean
55 P_UseSpecialLine
56 ( mobj_t* thing,
57 line_t* line,
58 int side );
60 void
61 P_ShootSpecialLine
62 ( mobj_t* thing,
63 line_t* line );
65 void
66 P_CrossSpecialLine
67 ( int linenum,
68 int side,
69 mobj_t* thing );
71 void P_PlayerInSpecialSector (player_t* player);
73 int
74 twoSided
75 ( int sector,
76 int line );
78 sector_t*
79 getSector
80 ( int currentSector,
81 int line,
82 int side );
84 side_t*
85 getSide
86 ( int currentSector,
87 int line,
88 int side );
90 fixed_t P_FindLowestFloorSurrounding(sector_t* sec);
91 fixed_t P_FindHighestFloorSurrounding(sector_t* sec);
93 fixed_t
94 P_FindNextHighestFloor
95 ( sector_t* sec,
96 int currentheight );
98 fixed_t P_FindLowestCeilingSurrounding(sector_t* sec);
99 fixed_t P_FindHighestCeilingSurrounding(sector_t* sec);
102 P_FindSectorFromLineTag
103 ( line_t* line,
104 int start );
107 P_FindMinSurroundingLight
108 ( sector_t* sector,
109 int max );
111 sector_t*
112 getNextSector
113 ( line_t* line,
114 sector_t* sec );
118 // SPECIAL
120 int EV_DoDonut(line_t* line);
125 // P_LIGHTS
127 typedef struct
129 thinker_t thinker;
130 sector_t* sector;
131 int count;
132 int maxlight;
133 int minlight;
135 } fireflicker_t;
139 typedef struct
141 thinker_t thinker;
142 sector_t* sector;
143 int count;
144 int maxlight;
145 int minlight;
146 int maxtime;
147 int mintime;
149 } lightflash_t;
153 typedef struct
155 thinker_t thinker;
156 sector_t* sector;
157 int count;
158 int minlight;
159 int maxlight;
160 int darktime;
161 int brighttime;
163 } strobe_t;
168 typedef struct
170 thinker_t thinker;
171 sector_t* sector;
172 int minlight;
173 int maxlight;
174 int direction;
176 } glow_t;
179 #define GLOWSPEED 8
180 #define STROBEBRIGHT 5
181 #define FASTDARK 15
182 #define SLOWDARK 35
184 void P_SpawnFireFlicker (sector_t* sector);
185 void T_LightFlash (lightflash_t* flash);
186 void P_SpawnLightFlash (sector_t* sector);
187 void T_StrobeFlash (strobe_t* flash);
189 void
190 P_SpawnStrobeFlash
191 ( sector_t* sector,
192 int fastOrSlow,
193 int inSync );
195 void EV_StartLightStrobing(line_t* line);
196 void EV_TurnTagLightsOff(line_t* line);
198 void
199 EV_LightTurnOn
200 ( line_t* line,
201 int bright );
203 void T_Glow(glow_t* g);
204 void P_SpawnGlowingLight(sector_t* sector);
210 // P_SWITCH
212 typedef struct
214 char name1[9];
215 char name2[9];
216 short episode;
218 } switchlist_t;
221 typedef enum
223 top,
224 middle,
225 bottom
227 } bwhere_e;
230 typedef struct
232 line_t* line;
233 bwhere_e where;
234 int btexture;
235 int btimer;
236 mobj_t* soundorg;
238 } button_t;
243 // max # of wall switches in a level
244 #define MAXSWITCHES 50
246 // 4 players, 4 buttons each at once, max.
247 #define MAXBUTTONS 16
249 // 1 second, in ticks.
250 #define BUTTONTIME 35
252 extern button_t buttonlist[MAXBUTTONS];
254 void
255 P_ChangeSwitchTexture
256 ( line_t* line,
257 int useAgain );
259 void P_InitSwitchList(void);
263 // P_PLATS
265 typedef enum
268 down,
269 waiting,
270 in_stasis
272 } plat_e;
276 typedef enum
278 perpetualRaise,
279 downWaitUpStay,
280 raiseAndChange,
281 raiseToNearestAndChange,
282 blazeDWUS
284 } plattype_e;
288 typedef struct
290 thinker_t thinker;
291 sector_t* sector;
292 fixed_t speed;
293 fixed_t low;
294 fixed_t high;
295 int wait;
296 int count;
297 plat_e status;
298 plat_e oldstatus;
299 boolean crush;
300 int tag;
301 plattype_e type;
303 } plat_t;
307 #define PLATWAIT 3
308 #define PLATSPEED FRACUNIT
309 #define MAXPLATS 30
312 extern plat_t* activeplats[MAXPLATS];
314 void T_PlatRaise(plat_t* plat);
317 EV_DoPlat
318 ( line_t* line,
319 plattype_e type,
320 int amount );
322 void P_AddActivePlat(plat_t* plat);
323 void P_RemoveActivePlat(plat_t* plat);
324 void EV_StopPlat(line_t* line);
325 void P_ActivateInStasis(int tag);
329 // P_DOORS
331 typedef enum
333 normal,
334 close30ThenOpen,
335 close,
336 open,
337 raiseIn5Mins,
338 blazeRaise,
339 blazeOpen,
340 blazeClose
342 } vldoor_e;
346 typedef struct
348 thinker_t thinker;
349 vldoor_e type;
350 sector_t* sector;
351 fixed_t topheight;
352 fixed_t speed;
354 // 1 = up, 0 = waiting at top, -1 = down
355 int direction;
357 // tics to wait at the top
358 int topwait;
359 // (keep in case a door going down is reset)
360 // when it reaches 0, start going down
361 int topcountdown;
363 } vldoor_t;
367 #define VDOORSPEED FRACUNIT*2
368 #define VDOORWAIT 150
370 void
371 EV_VerticalDoor
372 ( line_t* line,
373 mobj_t* thing );
376 EV_DoDoor
377 ( line_t* line,
378 vldoor_e type );
381 EV_DoLockedDoor
382 ( line_t* line,
383 vldoor_e type,
384 mobj_t* thing );
386 void T_VerticalDoor (vldoor_t* door);
387 void P_SpawnDoorCloseIn30 (sector_t* sec);
389 void
390 P_SpawnDoorRaiseIn5Mins
391 ( sector_t* sec,
392 int secnum );
396 #if 0 // UNUSED
398 // Sliding doors...
400 typedef enum
402 sd_opening,
403 sd_waiting,
404 sd_closing
406 } sd_e;
410 typedef enum
412 sdt_openOnly,
413 sdt_closeOnly,
414 sdt_openAndClose
416 } sdt_e;
421 typedef struct
423 thinker_t thinker;
424 sdt_e type;
425 line_t* line;
426 int frame;
427 int whichDoorIndex;
428 int timer;
429 sector_t* frontsector;
430 sector_t* backsector;
431 sd_e status;
433 } slidedoor_t;
437 typedef struct
439 char frontFrame1[9];
440 char frontFrame2[9];
441 char frontFrame3[9];
442 char frontFrame4[9];
443 char backFrame1[9];
444 char backFrame2[9];
445 char backFrame3[9];
446 char backFrame4[9];
448 } slidename_t;
452 typedef struct
454 int frontFrames[4];
455 int backFrames[4];
457 } slideframe_t;
461 // how many frames of animation
462 #define SNUMFRAMES 4
464 #define SDOORWAIT 35*3
465 #define SWAITTICS 4
467 // how many diff. types of anims
468 #define MAXSLIDEDOORS 5
470 void P_InitSlidingDoorFrames(void);
472 void
473 EV_SlidingDoor
474 ( line_t* line,
475 mobj_t* thing );
476 #endif
481 // P_CEILNG
483 typedef enum
485 lowerToFloor,
486 raiseToHighest,
487 lowerAndCrush,
488 crushAndRaise,
489 fastCrushAndRaise,
490 silentCrushAndRaise
492 } ceiling_e;
496 typedef struct
498 thinker_t thinker;
499 ceiling_e type;
500 sector_t* sector;
501 fixed_t bottomheight;
502 fixed_t topheight;
503 fixed_t speed;
504 boolean crush;
506 // 1 = up, 0 = waiting, -1 = down
507 int direction;
509 // ID
510 int tag;
511 int olddirection;
513 } ceiling_t;
519 #define CEILSPEED FRACUNIT
520 #define CEILWAIT 150
521 #define MAXCEILINGS 30
523 extern ceiling_t* activeceilings[MAXCEILINGS];
526 EV_DoCeiling
527 ( line_t* line,
528 ceiling_e type );
530 void T_MoveCeiling (ceiling_t* ceiling);
531 void P_AddActiveCeiling(ceiling_t* c);
532 void P_RemoveActiveCeiling(ceiling_t* c);
533 int EV_CeilingCrushStop(line_t* line);
534 void P_ActivateInStasisCeiling(line_t* line);
538 // P_FLOOR
540 typedef enum
542 // lower floor to highest surrounding floor
543 lowerFloor,
545 // lower floor to lowest surrounding floor
546 lowerFloorToLowest,
548 // lower floor to highest surrounding floor VERY FAST
549 turboLower,
551 // raise floor to lowest surrounding CEILING
552 raiseFloor,
554 // raise floor to next highest surrounding floor
555 raiseFloorToNearest,
557 // raise floor to shortest height texture around it
558 raiseToTexture,
560 // lower floor to lowest surrounding floor
561 // and change floorpic
562 lowerAndChange,
564 raiseFloor24,
565 raiseFloor24AndChange,
566 raiseFloorCrush,
568 // raise to next highest floor, turbo-speed
569 raiseFloorTurbo,
570 donutRaise,
571 raiseFloor512
573 } floor_e;
578 typedef enum
580 build8, // slowly build by 8
581 turbo16 // quickly build by 16
583 } stair_e;
587 typedef struct
589 thinker_t thinker;
590 floor_e type;
591 boolean crush;
592 sector_t* sector;
593 int direction;
594 int newspecial;
595 short texture;
596 fixed_t floordestheight;
597 fixed_t speed;
599 } floormove_t;
603 #define FLOORSPEED FRACUNIT
605 typedef enum
608 crushed,
609 pastdest
611 } result_e;
613 result_e
614 T_MovePlane
615 ( sector_t* sector,
616 fixed_t speed,
617 fixed_t dest,
618 boolean crush,
619 int floorOrCeiling,
620 int direction );
623 EV_BuildStairs
624 ( line_t* line,
625 stair_e type );
628 EV_DoFloor
629 ( line_t* line,
630 floor_e floortype );
632 void T_MoveFloor( floormove_t* floor);
635 // P_TELEPT
638 EV_Teleport
639 ( line_t* line,
640 int side,
641 mobj_t* thing );
643 #ifndef __GNUC__
644 #pragma options align=power
645 #endif
647 #endif
648 //-----------------------------------------------------------------------------
650 // $Log$
651 // Revision 1.1 2000/02/29 18:21:06 stegerg
652 // Doom port based on ADoomPPC. Read README.AROS!
655 //-----------------------------------------------------------------------------