Annotation of doom/p_spec.h, revision 1.1.1.2

1.1.1.2 ! root        1: 
        !             2: // P_spec.h
1.1       root        3: 
                      4: /*
                      5: ===============================================================================
                      6: 
                      7:                                                        P_SPEC
                      8: 
                      9: ===============================================================================
                     10: */
                     11: 
1.1.1.2 ! root       12: //
        !            13: //     Animating textures and planes
        !            14: //
1.1       root       15: typedef struct
                     16: {
                     17:        boolean istexture;
                     18:        int             picnum;
                     19:        int             basepic;
                     20:        int             numpics;
1.1.1.2 ! root       21:        int             speed;
1.1       root       22: } anim_t;
                     23: 
1.1.1.2 ! root       24: //
        !            25: //     source animation definition
        !            26: //
1.1       root       27: typedef struct
                     28: {
1.1.1.2 ! root       29:        boolean istexture;              // if false, it's a flat
1.1       root       30:        char    endname[9];
                     31:        char    startname[9];
                     32:        int             speed;
                     33: } animdef_t;
                     34: 
                     35: #define        MAXANIMS                32
                     36: 
                     37: extern anim_t  anims[MAXANIMS], *lastanim;
1.1.1.2 ! root       38: extern int *TerrainTypes;
1.1       root       39: 
1.1.1.2 ! root       40: //
        !            41: //     Animating line specials
        !            42: //
1.1       root       43: #define        MAXLINEANIMS            64
1.1.1.2 ! root       44: extern short   numlinespecials;
1.1       root       45: extern line_t  *linespeciallist[MAXLINEANIMS];
                     46: 
1.1.1.2 ! root       47: //     Define values for map objects
1.1       root       48: #define        MO_TELEPORTMAN          14
                     49: 
1.1.1.2 ! root       50: // at game start
        !            51: void P_InitPicAnims(void);
        !            52: void P_InitTerrainTypes(void);
        !            53: void P_InitLava(void);
        !            54: 
        !            55: // at map load
        !            56: void P_SpawnSpecials(void);
        !            57: void P_InitAmbientSound(void);
        !            58: void P_AddAmbientSfx(int sequence);
        !            59: 
        !            60: // every tic
        !            61: void P_UpdateSpecials(void);
        !            62: void P_AmbientSound(void);
1.1       root       63: 
1.1.1.2 ! root       64: // when needed
1.1       root       65: boolean        P_UseSpecialLine ( mobj_t *thing, line_t *line);
                     66: void   P_ShootSpecialLine ( mobj_t *thing, line_t *line);
1.1.1.2 ! root       67: void   P_CrossSpecialLine (int linenum, int side, mobj_t *thing);
1.1       root       68: 
                     69: void   P_PlayerInSpecialSector (player_t *player);
                     70: 
                     71: int            twoSided(int sector,int line);
                     72: sector_t *getSector(int currentSector,int line,int side);
                     73: side_t *getSide(int currentSector,int line, int side);
                     74: fixed_t        P_FindLowestFloorSurrounding(sector_t *sec);
                     75: fixed_t        P_FindHighestFloorSurrounding(sector_t *sec);
                     76: fixed_t        P_FindNextHighestFloor(sector_t *sec,int currentheight);
                     77: fixed_t        P_FindLowestCeilingSurrounding(sector_t *sec);
                     78: fixed_t        P_FindHighestCeilingSurrounding(sector_t *sec);
                     79: int            P_FindSectorFromLineTag(line_t  *line,int start);
                     80: int            P_FindMinSurroundingLight(sector_t *sector,int max);
                     81: sector_t *getNextSector(line_t *line,sector_t *sec);
                     82: 
1.1.1.2 ! root       83: //
        !            84: //     SPECIAL
        !            85: //
1.1       root       86: int EV_DoDonut(line_t *line);
                     87: 
                     88: /*
                     89: ===============================================================================
                     90: 
                     91:                                                        P_LIGHTS
                     92: 
                     93: ===============================================================================
                     94: */
                     95: typedef struct
                     96: {
                     97:        thinker_t       thinker;
                     98:        sector_t        *sector;
                     99:        int                     count;
                    100:        int                     maxlight;
                    101:        int                     minlight;
                    102:        int                     maxtime;
                    103:        int                     mintime;
                    104: } lightflash_t;
                    105: 
                    106: typedef struct
                    107: {
                    108:        thinker_t       thinker;
                    109:        sector_t        *sector;
                    110:        int                     count;
                    111:        int                     minlight;
                    112:        int                     maxlight;
                    113:        int                     darktime;
                    114:        int                     brighttime;
                    115: } strobe_t;
                    116: 
                    117: typedef struct
                    118: {
                    119:        thinker_t       thinker;
                    120:        sector_t        *sector;
                    121:        int                     minlight;
                    122:        int                     maxlight;
                    123:        int                     direction;
                    124: } glow_t;
                    125: 
1.1.1.2 ! root      126: #define GLOWSPEED              8
        !           127: #define        STROBEBRIGHT    5
        !           128: #define        FASTDARK                15
        !           129: #define        SLOWDARK                35
1.1       root      130: 
                    131: void   T_LightFlash (lightflash_t *flash);
                    132: void   P_SpawnLightFlash (sector_t *sector);
                    133: void   T_StrobeFlash (strobe_t *flash);
                    134: void   P_SpawnStrobeFlash (sector_t *sector, int fastOrSlow, int inSync);
                    135: void   EV_StartLightStrobing(line_t *line);
                    136: void   EV_TurnTagLightsOff(line_t      *line);
                    137: void   EV_LightTurnOn(line_t *line, int bright);
                    138: void   T_Glow(glow_t *g);
                    139: void   P_SpawnGlowingLight(sector_t *sector);
                    140: 
                    141: /*
                    142: ===============================================================================
                    143: 
                    144:                                                        P_SWITCH
                    145: 
                    146: ===============================================================================
                    147: */
                    148: typedef struct
                    149: {
                    150:        char    name1[9];
                    151:        char    name2[9];
1.1.1.2 ! root      152:        short   episode;
1.1       root      153: } switchlist_t;
                    154: 
                    155: typedef enum
                    156: {
                    157:        top,
                    158:        middle,
                    159:        bottom
                    160: } bwhere_e;
                    161: 
                    162: typedef struct
                    163: {
                    164:        line_t          *line;
                    165:        bwhere_e        where;
                    166:        int                     btexture;
                    167:        int                     btimer;
                    168:        mobj_t          *soundorg;
                    169: } button_t;
                    170: 
1.1.1.2 ! root      171: #define        MAXSWITCHES     50              // max # of wall switches in a level
        !           172: #define        MAXBUTTONS      16              // 4 players, 4 buttons each at once, max.
        !           173: #define BUTTONTIME     35              // 1 second
1.1       root      174: 
                    175: extern button_t        buttonlist[MAXBUTTONS]; 
                    176: 
                    177: void   P_ChangeSwitchTexture(line_t *line,int useAgain);
                    178: void   P_InitSwitchList(void);
                    179: 
                    180: /*
                    181: ===============================================================================
                    182: 
                    183:                                                        P_PLATS
                    184: 
                    185: ===============================================================================
                    186: */
                    187: typedef enum
                    188: {
                    189:        up,
                    190:        down,
                    191:        waiting,
                    192:        in_stasis
                    193: } plat_e;
                    194: 
                    195: typedef enum
                    196: {
                    197:        perpetualRaise,
                    198:        downWaitUpStay,
                    199:        raiseAndChange,
                    200:        raiseToNearestAndChange
                    201: } plattype_e;
                    202: 
                    203: typedef struct
                    204: {
                    205:        thinker_t       thinker;
                    206:        sector_t        *sector;
                    207:        fixed_t         speed;
                    208:        fixed_t         low;
                    209:        fixed_t         high;
                    210:        int                     wait;
                    211:        int                     count;
                    212:        plat_e          status;
                    213:        plat_e          oldstatus;
                    214:        boolean         crush;
                    215:        int                     tag;
                    216:        plattype_e      type;
                    217: } plat_t;
                    218: 
1.1.1.2 ! root      219: #define        PLATWAIT        3
        !           220: #define        PLATSPEED       FRACUNIT
1.1       root      221: #define        MAXPLATS        30
                    222: 
                    223: extern plat_t  *activeplats[MAXPLATS];
                    224: 
                    225: void   T_PlatRaise(plat_t      *plat);
                    226: int            EV_DoPlat(line_t *line,plattype_e type,int amount);
                    227: void   P_AddActivePlat(plat_t *plat);
                    228: void   P_RemoveActivePlat(plat_t *plat);
                    229: void   EV_StopPlat(line_t *line);
                    230: void   P_ActivateInStasis(int tag);
                    231: 
                    232: /*
                    233: ===============================================================================
                    234: 
                    235:                                                        P_DOORS
                    236: 
                    237: ===============================================================================
                    238: */
                    239: typedef enum
                    240: {
                    241:        normal,
                    242:        close30ThenOpen,
                    243:        close,
                    244:        open,
                    245:        raiseIn5Mins
                    246: } vldoor_e;
                    247: 
                    248: typedef struct
                    249: {
                    250:        thinker_t       thinker;
                    251:        vldoor_e        type;
                    252:        sector_t        *sector;
                    253:        fixed_t         topheight;
                    254:        fixed_t         speed;
1.1.1.2 ! root      255:        int                     direction;              // 1 = up, 0 = waiting at top, -1 = down
        !           256:        int                     topwait;                // tics to wait at the top
        !           257:                                                                // (keep in case a door going down is reset)
        !           258:        int                     topcountdown;   // when it reaches 0, start going down
1.1       root      259: } vldoor_t;
                    260:        
1.1.1.2 ! root      261: #define        VDOORSPEED      FRACUNIT*2
        !           262: #define        VDOORWAIT               150
1.1       root      263: 
                    264: void   EV_VerticalDoor (line_t *line, mobj_t *thing);
1.1.1.2 ! root      265: int            EV_DoDoor (line_t *line, vldoor_e type, fixed_t speed);
1.1       root      266: void   T_VerticalDoor (vldoor_t *door);
                    267: void   P_SpawnDoorCloseIn30 (sector_t *sec);
                    268: void   P_SpawnDoorRaiseIn5Mins (sector_t *sec, int secnum);
                    269: 
                    270: /*
                    271: ===============================================================================
                    272: 
                    273:                                                        P_CEILNG
                    274: 
                    275: ===============================================================================
                    276: */
                    277: typedef enum
                    278: {
                    279:        lowerToFloor,
                    280:        raiseToHighest,
                    281:        lowerAndCrush,
                    282:        crushAndRaise,
                    283:        fastCrushAndRaise
                    284: } ceiling_e;
                    285: 
                    286: typedef struct
                    287: {
                    288:        thinker_t       thinker;
                    289:        ceiling_e       type;
                    290:        sector_t        *sector;
                    291:        fixed_t         bottomheight, topheight;
                    292:        fixed_t         speed;
                    293:        boolean         crush;
1.1.1.2 ! root      294:        int                     direction;              // 1 = up, 0 = waiting, -1 = down
        !           295:        int                     tag;                    // ID
1.1       root      296:        int                     olddirection;
                    297: } ceiling_t;
                    298: 
1.1.1.2 ! root      299: #define        CEILSPEED               FRACUNIT
        !           300: #define        CEILWAIT                150
1.1       root      301: #define MAXCEILINGS            30
                    302: 
                    303: extern ceiling_t       *activeceilings[MAXCEILINGS];
                    304: 
                    305: int            EV_DoCeiling (line_t *line, ceiling_e  type);
                    306: void   T_MoveCeiling (ceiling_t *ceiling);
                    307: void   P_AddActiveCeiling(ceiling_t *c);
                    308: void   P_RemoveActiveCeiling(ceiling_t *c);
                    309: int            EV_CeilingCrushStop(line_t      *line);
                    310: void   P_ActivateInStasisCeiling(line_t *line);
                    311: 
                    312: /*
                    313: ===============================================================================
                    314: 
                    315:                                                        P_FLOOR
                    316: 
                    317: ===============================================================================
                    318: */
                    319: typedef enum
                    320: {
1.1.1.2 ! root      321:        lowerFloor,                     // lower floor to highest surrounding floor
        !           322:        lowerFloorToLowest,     // lower floor to lowest surrounding floor
        !           323:        turboLower,                     // lower floor to highest surrounding floor VERY FAST
        !           324:        raiseFloor,                     // raise floor to lowest surrounding CEILING
        !           325:        raiseFloorToNearest,    // raise floor to next highest surrounding floor
        !           326:        raiseToTexture,         // raise floor to shortest height texture around it
        !           327:        lowerAndChange,         // lower floor to lowest surrounding floor and change
        !           328:                                                // floorpic
1.1       root      329:        raiseFloor24,
                    330:        raiseFloor24AndChange,
                    331:        raiseFloorCrush,
1.1.1.2 ! root      332:        donutRaise,
        !           333:        raiseBuildStep          // One step of a staircase
1.1       root      334: } floor_e;
                    335: 
                    336: typedef struct
                    337: {
                    338:        thinker_t       thinker;
                    339:        floor_e         type;
                    340:        boolean         crush;
                    341:        sector_t        *sector;
                    342:        int                     direction;
                    343:        int                     newspecial;
                    344:        short           texture;
                    345:        fixed_t         floordestheight;
                    346:        fixed_t         speed;
                    347: } floormove_t;
                    348: 
1.1.1.2 ! root      349: #define        FLOORSPEED      FRACUNIT
1.1       root      350: 
                    351: typedef enum
                    352: {
                    353:        ok,
                    354:        crushed,
                    355:        pastdest
                    356: } result_e;
                    357: 
                    358: result_e       T_MovePlane(sector_t *sector,fixed_t speed,
                    359:                        fixed_t dest,boolean crush,int floorOrCeiling,int direction);
                    360: 
1.1.1.2 ! root      361: int            EV_BuildStairs(line_t *line, fixed_t stepDelta);
1.1       root      362: int            EV_DoFloor(line_t *line,floor_e floortype);
                    363: void   T_MoveFloor(floormove_t *floor);
                    364: 
                    365: /*
                    366: ===============================================================================
                    367: 
                    368:                                                        P_TELEPT
                    369: 
                    370: ===============================================================================
                    371: */
                    372: 
1.1.1.2 ! root      373: boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, angle_t angle);
        !           374: boolean EV_Teleport(line_t *line, int side, mobj_t *thing);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.