|
|
1.1 ! root 1: ! 2: //************************************************************************** ! 3: //** ! 4: //** xddefs.h : Heretic 2 : Raven Software, Corp. ! 5: //** ! 6: //** $RCSfile: xddefs.h,v $ ! 7: //** $Revision: 1.4 $ ! 8: //** $Date: 95/08/11 10:22:08 $ ! 9: //** $Author: bgokey $ ! 10: //** ! 11: //************************************************************************** ! 12: ! 13: #ifndef __XDDEFS__ ! 14: #define __XDDEFS__ ! 15: ! 16: #ifndef __BYTEBOOL__ ! 17: #define __BYTEBOOL__ ! 18: typedef enum {false, true} boolean; ! 19: typedef unsigned char byte; ! 20: #endif ! 21: ! 22: //-------------------------------------------------------------------------- ! 23: // ! 24: // Map level types ! 25: // ! 26: //-------------------------------------------------------------------------- ! 27: ! 28: // lump order in a map wad ! 29: enum ! 30: { ! 31: ML_LABEL, ! 32: ML_THINGS, ! 33: ML_LINEDEFS, ! 34: ML_SIDEDEFS, ! 35: ML_VERTEXES, ! 36: ML_SEGS, ! 37: ML_SSECTORS, ! 38: ML_NODES, ! 39: ML_SECTORS, ! 40: ML_REJECT, ! 41: ML_BLOCKMAP, ! 42: ML_BEHAVIOR ! 43: }; ! 44: ! 45: typedef struct ! 46: { ! 47: short x; ! 48: short y; ! 49: } mapvertex_t; ! 50: ! 51: typedef struct ! 52: { ! 53: short textureoffset; ! 54: short rowoffset; ! 55: char toptexture[8]; ! 56: char bottomtexture[8]; ! 57: char midtexture[8]; ! 58: short sector; // on viewer's side ! 59: } mapsidedef_t; ! 60: ! 61: typedef struct ! 62: { ! 63: short v1; ! 64: short v2; ! 65: short flags; ! 66: byte special; ! 67: byte arg1; ! 68: byte arg2; ! 69: byte arg3; ! 70: byte arg4; ! 71: byte arg5; ! 72: short sidenum[2]; // sidenum[1] will be -1 if one sided ! 73: } maplinedef_t; ! 74: ! 75: #define ML_BLOCKING 0x0001 ! 76: #define ML_BLOCKMONSTERS 0x0002 ! 77: #define ML_TWOSIDED 0x0004 ! 78: #define ML_DONTPEGTOP 0x0008 ! 79: #define ML_DONTPEGBOTTOM 0x0010 ! 80: #define ML_SECRET 0x0020 // don't map as two sided: IT'S A SECRET! ! 81: #define ML_SOUNDBLOCK 0x0040 // don't let sound cross two of these ! 82: #define ML_DONTDRAW 0x0080 // don't draw on the automap ! 83: #define ML_MAPPED 0x0100 // set if already drawn in automap ! 84: #define ML_REPEAT_SPECIAL 0x0200 // special is repeatable ! 85: #define ML_SPAC_SHIFT 10 ! 86: #define ML_SPAC_MASK 0x1c00 ! 87: #define GET_SPAC(flags) ((flags&ML_SPAC_MASK)>>ML_SPAC_SHIFT) ! 88: ! 89: // Special activation types ! 90: #define SPAC_CROSS 0 // when player crosses line ! 91: #define SPAC_USE 1 // when player uses line ! 92: #define SPAC_MCROSS 2 // when monster crosses line ! 93: #define SPAC_IMPACT 3 // when projectile hits line ! 94: #define SPAC_PUSH 4 // when player/monster pushes line ! 95: #define SPAC_PCROSS 5 // when projectile crosses line ! 96: ! 97: typedef struct ! 98: { ! 99: short floorheight; ! 100: short ceilingheight; ! 101: char floorpic[8]; ! 102: char ceilingpic[8]; ! 103: short lightlevel; ! 104: short special; ! 105: short tag; ! 106: } mapsector_t; ! 107: ! 108: typedef struct ! 109: { ! 110: short numsegs; ! 111: short firstseg; // segs are stored sequentially ! 112: } mapsubsector_t; ! 113: ! 114: typedef struct ! 115: { ! 116: short v1; ! 117: short v2; ! 118: short angle; ! 119: short linedef; ! 120: short side; ! 121: short offset; ! 122: } mapseg_t; ! 123: ! 124: enum ! 125: { // bbox coordinates ! 126: BOXTOP, ! 127: BOXBOTTOM, ! 128: BOXLEFT, ! 129: BOXRIGHT ! 130: }; ! 131: ! 132: #define NF_SUBSECTOR 0x8000 ! 133: typedef struct ! 134: { ! 135: short x,y,dx,dy; // partition line ! 136: short bbox[2][4]; // bounding box for each child ! 137: unsigned short children[2]; // if NF_SUBSECTOR its a subsector ! 138: } mapnode_t; ! 139: ! 140: typedef struct ! 141: { ! 142: short tid; ! 143: short x; ! 144: short y; ! 145: short height; ! 146: short angle; ! 147: short type; ! 148: short options; ! 149: byte special; ! 150: byte arg1; ! 151: byte arg2; ! 152: byte arg3; ! 153: byte arg4; ! 154: byte arg5; ! 155: } mapthing_t; ! 156: ! 157: #define MTF_EASY 1 ! 158: #define MTF_NORMAL 2 ! 159: #define MTF_HARD 4 ! 160: #define MTF_AMBUSH 8 ! 161: #define MTF_DORMANT 16 ! 162: #define MTF_FIGHTER 32 ! 163: #define MTF_CLERIC 64 ! 164: #define MTF_MAGE 128 ! 165: #define MTF_GSINGLE 256 ! 166: #define MTF_GCOOP 512 ! 167: #define MTF_GDEATHMATCH 1024 ! 168: ! 169: //-------------------------------------------------------------------------- ! 170: // ! 171: // Texture definition ! 172: // ! 173: //-------------------------------------------------------------------------- ! 174: ! 175: typedef struct ! 176: { ! 177: short originx; ! 178: short originy; ! 179: short patch; ! 180: short stepdir; ! 181: short colormap; ! 182: } mappatch_t; ! 183: ! 184: typedef struct ! 185: { ! 186: char name[8]; ! 187: boolean masked; ! 188: short width; ! 189: short height; ! 190: void **columndirectory; // OBSOLETE ! 191: short patchcount; ! 192: mappatch_t patches[1]; ! 193: } maptexture_t; ! 194: ! 195: //-------------------------------------------------------------------------- ! 196: // ! 197: // Graphics ! 198: // ! 199: //-------------------------------------------------------------------------- ! 200: ! 201: // posts are runs of non masked source pixels ! 202: typedef struct ! 203: { ! 204: byte topdelta; // -1 is the last post in a column ! 205: byte length; ! 206: // length data bytes follows ! 207: } post_t; ! 208: ! 209: // column_t is a list of 0 or more post_t, (byte)-1 terminated ! 210: typedef post_t column_t; ! 211: ! 212: // a patch holds one or more columns ! 213: // patches are used for sprites and all masked pictures ! 214: typedef struct ! 215: { ! 216: short width; // bounding box size ! 217: short height; ! 218: short leftoffset; // pixels to the left of origin ! 219: short topoffset; // pixels below the origin ! 220: int columnofs[8]; // only [width] used ! 221: // the [0] is &columnofs[width] ! 222: } patch_t; ! 223: ! 224: // a pic is an unmasked block of pixels ! 225: typedef struct ! 226: { ! 227: byte width,height; ! 228: byte data; ! 229: } pic_t; ! 230: ! 231: #endif // __XDDEFS__
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.