📄 p_spec.h
字号:
// Emacs style mode select -*- C++ -*- //-----------------------------------------------------------------------------//// $Id: p_spec.h,v 1.12 2001/03/21 18:24:38 stroggonmeth Exp $//// Copyright (C) 1993-1996 by id Software, Inc.// Portions Copyright (C) 1998-2000 by DooM Legacy Team.//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License// as published by the Free Software Foundation; either version 2// of the License, or (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.////// $Log: p_spec.h,v $// Revision 1.12 2001/03/21 18:24:38 stroggonmeth// Misc changes and fixes. Code cleanup//// Revision 1.11 2001/02/24 13:35:20 bpereira// no message//// Revision 1.10 2001/01/25 22:15:44 bpereira// added heretic support//// Revision 1.9 2000/11/11 13:59:46 bpereira// no message//// Revision 1.8 2000/11/02 17:50:08 stroggonmeth// Big 3Dfloors & FraggleScript commit!!//// Revision 1.7 2000/10/21 08:43:30 bpereira// no message//// Revision 1.6 2000/04/16 18:38:07 bpereira// no message//// Revision 1.5 2000/04/07 18:48:56 hurdler// AnyKey doesn't seem to compile under Linux, now renamed to AnyKey_//// Revision 1.4 2000/04/06 20:54:28 hurdler// Mostly remove warnings under windows//// Revision 1.3 2000/04/04 00:32:47 stroggonmeth// Initial Boom compatability plus few misc changes all around.//// Revision 1.2 2000/02/27 00:42:10 hurdler// fix CR+LF problem//// Revision 1.1.1.1 2000/02/22 20:32:32 hurdler// Initial import into CVS (v1.29 pr3)////// DESCRIPTION:// Implements special effects:// Texture animation, height or lighting changes// according to adjacent sectors, respective// utility functions, etc.////-----------------------------------------------------------------------------#ifndef __P_SPEC__#define __P_SPEC__// Define values for map objects#define MO_TELEPORTMAN 14// at game startvoid P_InitPicAnims (void);// at map load (sectors)void P_SetupLevelFlatAnims (void);// at map loadvoid P_SpawnSpecials (void);// every ticvoid P_UpdateSpecials (void);// when neededbooleanP_UseSpecialLine( mobj_t* thing, line_t* line, int side );voidP_ShootSpecialLine( mobj_t* thing, line_t* line );voidP_CrossSpecialLine( int linenum, int side, mobj_t* thing );voidP_ActivateCrossedLine( line_t* line, int side, mobj_t* thing);void P_PlayerInSpecialSector (player_t* player);inttwoSided( int sector, int line );sector_t*getSector( int currentSector, int line, int side );side_t*getSide( int currentSector, int line, int side );fixed_t P_FindLowestFloorSurrounding(sector_t* sec);fixed_t P_FindHighestFloorSurrounding(sector_t* sec);fixed_tP_FindNextHighestFloor( sector_t* sec, int currentheight );//SoM: 3/6/2000fixed_t P_FindNextLowestFloor( sector_t* sec, int currentheight );fixed_t P_FindLowestCeilingSurrounding(sector_t* sec);fixed_t P_FindHighestCeilingSurrounding(sector_t* sec);intP_FindSectorFromLineTag( line_t* line, int start );intP_FindSectorFromTag( int tag, int start );int P_FindLineFromLineTag(const line_t *line, int start); //SoM: 3/16/2000intP_FindMinSurroundingLight( sector_t* sector, int max );sector_t*getNextSector( line_t* line, sector_t* sec );//SoM: 3/6/2000sector_t* P_FindModelFloorSector( fixed_t floordestheight, int secnum );//SoM: 3/15/2000fixed_t P_FindNextHighestCeiling(sector_t *sec, int currentheight);fixed_t P_FindNextLowestCeiling(sector_t *sec, int currentheight);fixed_t P_FindShortestUpperAround(int secnum);fixed_t P_FindShortestTextureAround(int secnum);sector_t *P_FindModelCeilingSector(fixed_t ceildestheight,int secnum);boolean P_CanUnlockGenDoor( line_t* line, player_t* player);int P_CheckTag(line_t *line);//// SPECIAL//int EV_DoDonut(line_t* line);//// P_LIGHTS//typedef struct{ thinker_t thinker; sector_t* sector; int count; int maxlight; int minlight;} fireflicker_t;typedef struct{ thinker_t thinker; sector_t* sector; int count; int maxlight; int minlight; int maxtime; int mintime;} lightflash_t;typedef struct{ thinker_t thinker; sector_t* sector; int count; int minlight; int maxlight; int darktime; int brighttime;} strobe_t;typedef struct{ thinker_t thinker; sector_t* sector; int minlight; int maxlight; int direction;} glow_t;//SoM: thinker struct for fading lights. ToDo: Add effects for light// transitiontypedef struct{ thinker_t thinker; sector_t *sector; int destlevel; int speed;} lightlevel_t;#define GLOWSPEED 8#define STROBEBRIGHT 5#define FASTDARK 15#define SLOWDARK 35void T_FireFlicker (fireflicker_t* flick);void P_SpawnFireFlicker (sector_t* sector);void T_LightFlash (lightflash_t* flash);void P_SpawnLightFlash (sector_t* sector);void T_StrobeFlash (strobe_t* flash);voidP_SpawnStrobeFlash( sector_t* sector, int fastOrSlow, int inSync );int EV_StartLightStrobing(line_t* line);int EV_TurnTagLightsOff(line_t* line);intEV_LightTurnOn( line_t* line, int bright );void T_Glow(glow_t* g);void P_SpawnGlowingLight(sector_t* sector);void P_FadeLight(int tag, int destvalue, int speed);void T_LightFade(lightlevel_t *ll);//// P_SWITCH//#pragma pack(1) //Hurdler: 04/04/2000: I think pragma is more portabletypedef struct{ char name1[9]; char name2[9]; short episode;} switchlist_t; //} __attribute__ ((packed)) switchlist_t; //SoM: 3/22/2000: Packed to read from memory.#pragma pack()typedef enum{ top, middle, bottom} bwhere_e;typedef struct{ line_t* line; bwhere_e where; int btexture; int btimer; mobj_t* soundorg;} button_t; // max # of wall switches in a level#define MAXSWITCHES 50 // 4 players, 4 buttons each at once, max. // added 19-1-98 16->MAXPLAYERS*4#define MAXBUTTONS (MAXPLAYERS*4) //16 // 1 second, in ticks.#define BUTTONTIME 35extern button_t buttonlist[MAXBUTTONS];voidP_ChangeSwitchTexture( line_t* line, int useAgain );void P_InitSwitchList(void);// SoM: 3/4/2000: Misc Boom stuff for thinkers that can share sectors, and some other stufftypedef enum{ floor_special, ceiling_special, lighting_special,} special_e;//SoM: 3/6/2000int P_SectorActive( special_e t, sector_t* s );typedef enum{ trigChangeOnly, numChangeOnly,} change_e;//// P_PLATS//typedef enum{ up, down, waiting, in_stasis} plat_e;typedef enum{ perpetualRaise, downWaitUpStay, raiseAndChange, raiseToNearestAndChange, blazeDWUS, //SoM:3/4/2000: Added boom stuffs genLift, //General stuff genPerpetual, toggleUpDn, //Instant toggle of stuff.} plattype_e;typedef struct{ thinker_t thinker; sector_t* sector; fixed_t speed; fixed_t low; fixed_t high; int wait; int count; plat_e status; plat_e oldstatus; boolean crush; int tag; plattype_e type; struct platlist *list; //SoM: 3/6/2000: Boom's improved code without limits.} plat_t;//SoM: 3/6/2000: Boom's improved code without limits.typedef struct platlist { plat_t *plat; struct platlist *next,**prev;} platlist_t;void P_RemoveAllActivePlats(void); //SoM: 3/9/2000#define PLATWAIT 3#define PLATSPEED (FRACUNIT/NEWTICRATERATIO)#define MAXPLATS 30extern platlist_t *activeplats;void T_PlatRaise(plat_t* plat);intEV_DoPlat( line_t* line, plattype_e type, int amount );void P_AddActivePlat(plat_t* plat);void P_RemoveActivePlat(plat_t* plat);int EV_StopPlat(line_t* line);void P_ActivateInStasis(int tag);//// P_DOORS//typedef enum{ normalDoor, close30ThenOpen, doorclose, dooropen, raiseIn5Mins, blazeRaise, blazeOpen, blazeClose, //SoM: 3/4/2000: General door types... genRaise, genBlazeRaise, genOpen, genBlazeOpen, genClose, genBlazeClose, genCdO, genBlazeCdO,} vldoor_e;typedef struct{ thinker_t thinker; vldoor_e type; sector_t* sector; fixed_t topheight; fixed_t speed; // 1 = up, 0 = waiting at top, -1 = down int direction; // tics to wait at the top int topwait; // (keep in case a door going down is reset) // when it reaches 0, start going down int topcountdown; //SoM: 3/6/2000: the line that triggered the door. line_t *line;} vldoor_t;#define VDOORSPEED (FRACUNIT*2/NEWTICRATERATIO)#define VDOORWAIT 150int //SoM: 3/6/2000: boom supportEV_VerticalDoor( line_t* line, mobj_t* thing );intEV_DoDoor( line_t* line, vldoor_e type, fixed_t speed);void EV_OpenDoor(int sectag, int speed, int wait_time);void EV_CloseDoor(int sectag, int speed);intEV_DoLockedDoor( line_t* line, vldoor_e type, mobj_t* thing, fixed_t speed );void T_VerticalDoor (vldoor_t* door);void P_SpawnDoorCloseIn30 (sector_t* sec);voidP_SpawnDoorRaiseIn5Mins( sector_t* sec, int secnum );#if 0 // UNUSED//// Sliding doors...//typedef enum{ sd_opening, sd_waiting, sd_closing} sd_e;typedef enum{ sdt_openOnly, sdt_closeOnly, sdt_openAndClose} sdt_e;typedef struct{ thinker_t thinker; sdt_e type; line_t* line; int frame; int whichDoorIndex; int timer; sector_t* frontsector; sector_t* backsector; sd_e status;} slidedoor_t;typedef struct{ char frontFrame1[9]; char frontFrame2[9]; char frontFrame3[9]; char frontFrame4[9]; char backFrame1[9]; char backFrame2[9]; char backFrame3[9]; char backFrame4[9];} slidename_t;typedef struct{ int frontFrames[4]; int backFrames[4];} slideframe_t;// how many frames of animation#define SNUMFRAMES 4#define SDOORWAIT (35*3)#define SWAITTICS 4// how many diff. types of anims#define MAXSLIDEDOORS 5void P_InitSlidingDoorFrames(void);voidEV_SlidingDoor( line_t* line, mobj_t* thing );#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -