doomdata.h (8067B)
1 /* DoomData.h */ 2 3 /* all external data is defined here */ 4 /* most of the data is loaded into different structures at run time */ 5 6 #ifndef __DOOMDATA__ 7 #define __DOOMDATA__ 8 9 #ifndef __BYTEBOOL__ 10 #define __BYTEBOOL__ 11 typedef enum {false, true} boolean; 12 typedef unsigned char byte; 13 #endif 14 15 /* 16 =============================================================================== 17 18 map level types 19 20 =============================================================================== 21 */ 22 23 /* lump order in a map wad */ 24 enum {ML_LABEL, ML_THINGS, ML_LINEDEFS, ML_SIDEDEFS, ML_VERTEXES, ML_SEGS, 25 ML_SSECTORS, ML_NODES, ML_SECTORS , ML_REJECT, ML_BLOCKMAP, ML_LEAFS, ML_LIGHTS, ML_MACROS, ENDOFWAD 26 }; 27 28 typedef struct 29 { 30 int x, y; // (Psx Doom / Doom 64) 31 } mapvertex_t; 32 33 typedef struct 34 { 35 short textureoffset; 36 short rowoffset; 37 short toptexture, bottomtexture, midtexture; 38 short sector; /* on viewer's side */ 39 } mapsidedef_t; 40 41 typedef struct 42 { 43 short v1, v2; 44 int flags; 45 short special, tag; 46 short sidenum[2]; /* sidenum[1] will be -1 if one sided */ 47 } maplinedef_t; 48 49 #define ML_BLOCKING 1 50 #define ML_BLOCKMONSTERS 2 51 #define ML_TWOSIDED 4 /* backside will not be present at all */ 52 /* if not two sided ???:obsolete */ 53 54 /* if a texture is pegged, the texture will have the end exposed to air held */ 55 /* constant at the top or bottom of the texture (stairs or pulled down things) */ 56 /* and will move with a height change of one of the neighbor sectors */ 57 /* Unpegged textures allways have the first row of the texture at the top */ 58 /* pixel of the line for both top and bottom textures (windows) */ 59 #define ML_DONTPEGTOP 8 60 #define ML_DONTPEGBOTTOM 16 61 62 #define ML_SECRET 32 /* don't map as two sided: IT'S A SECRET! */ 63 #define ML_SOUNDBLOCK 64 /* don't let sound cross two of these */ 64 #define ML_DONTDRAW 128 /* don't draw on the automap */ 65 #define ML_MAPPED 256 /* set if allready drawn in automap */ 66 67 // New Doom 64 Line Flags 68 69 #define ML_DRAWMASKED 0x200 /* Draw middle texture on sidedef */ 70 #define ML_DONTOCCLUDE 0x400 /* Don't add to occlusion buffer */ 71 #define ML_BLOCKPROJECTILES 0x800 /* blocks projectiles */ 72 #define ML_THINGTRIGGER 0x1000 /* Line is triggered by dead thing (flagged as ondeathtrigger) */ 73 #define ML_SWITCHX02 0x2000 /* Switch flag 1 */ 74 #define ML_SWITCHX04 0x4000 /* Switch flag 2 */ 75 #define ML_SWITCHX08 0x8000 /* Switch flag 3 */ 76 #define ML_CHECKFLOORHEIGHT 0x10000 /* if true then check the switch's floor height, else use the ceiling height */ 77 #define ML_SCROLLRIGHT 0x20000 /* scroll texture to the right */ 78 #define ML_SCROLLLEFT 0x40000 /* scroll texture to the left */ 79 #define ML_SCROLLUP 0x80000 /* scroll texture up */ 80 #define ML_SCROLLDOWN 0x100000 /* scroll texture down */ 81 #define ML_BLENDFULLTOP 0x200000 /* do not extend blending for top texture */ 82 #define ML_BLENDFULLBOTTOM 0x400000 /* do not extend blending for bottom texture */ 83 #define ML_BLENDING 0x800000 /* use sector color blending (top/lower, ceiling, floor colors). */ 84 #define ML_TRIGGERFRONT 0x1000000 /* can only trigger from the front of the line */ 85 #define ML_HIDEAUTOMAPTRIGGER 0x2000000 /* don't display as yellow line special in automap */ 86 #define ML_INVERSEBLEND 0x4000000 /* reverse the blending of the sector colors */ 87 #define ML_UNKNOWN8000000 0x8000000 /* reserved */ 88 #define ML_UNKNOWN10000000 0x10000000 /* reserved */ 89 #define ML_UNKNOWN20000000 0x20000000 /* reserved */ 90 #define ML_HMIRROR 0x40000000 /* horizontal mirror the texture */ 91 #define ML_VMIRROR 0x80000000 /* vertical mirror the texture */ 92 93 /* 94 // Psx Doom New Flags 95 #define ML_MIDMASKED 0x200 96 #define ML_MIDTRANSLUCENT 0x400 97 #define ML_BLOCKPRJECTILE 0x800 98 // Psx Final Doom New Flag 99 #define ML_MIDCLIPTEXTURE 0x1000 100 */ 101 102 /*---------------------*/ 103 /* Special attributes. */ 104 /*---------------------*/ 105 106 #define MLU_MACRO 0x100 /* line is set to be used as a macro */ 107 #define MLU_RED 0x200 /* requires red key */ 108 #define MLU_BLUE 0x400 /* requires blue key */ 109 #define MLU_YELLOW 0x800 /* requires yellow key */ 110 #define MLU_CROSS 0x1000 /* must cross to trigger */ 111 #define MLU_SHOOT 0x2000 /* must shoot the line to trigger */ 112 #define MLU_USE 0x4000 /* must press use on the line to trigger */ 113 #define MLU_REPEAT 0x8000 /* line can be reactivated again */ 114 115 /*------------*/ 116 /* Line masks */ 117 /*------------*/ 118 119 #define SWITCHMASK(x) (x & 0x6000) 120 #define SPECIALMASK(x) (x & 0x1FF) 121 #define MACROMASK(x) (SPECIALMASK(x) - (x & MLU_MACRO)) 122 123 typedef struct 124 { 125 short floorheight, ceilingheight; 126 short floorpic, ceilingpic; 127 short colors[5]; 128 short special, tag; 129 short flags; 130 } mapsector_t; 131 132 /*--------------*/ 133 /* Sector Flags */ 134 /*--------------*/ 135 136 #define MS_REVERB 1 /* sounds are echoed in this sector */ 137 #define MS_REVERBHEAVY 2 /* heavier echo effect */ 138 #define MS_LIQUIDFLOOR 4 /* water effect (blitting two flats together) */ 139 #define MS_SYNCSPECIALS 8 /* sync light special with multiple sectors */ 140 #define MS_SCROLLFAST 16 /* faster ceiling/floor scrolling */ 141 #define MS_SECRET 32 /* count secret when entering and display message */ 142 #define MS_DAMAGEX5 64 /* damage player x5 */ 143 #define MS_DAMAGEX10 128 /* damage player x10 */ 144 #define MS_DAMAGEX20 256 /* damage player x20 */ 145 #define MS_HIDESSECTOR 512 /* hide subsectors in automap (textured mode) */ 146 #define MS_SCROLLCEILING 1024 /* enable ceiling scrolling */ 147 #define MS_SCROLLFLOOR 2048 /* enable floor scrolling */ 148 #define MS_SCROLLLEFT 4096 /* scroll flat to the left */ 149 #define MS_SCROLLRIGHT 8192 /* scroll flat to the right */ 150 #define MS_SCROLLUP 16384 /* scroll flat to the north */ 151 #define MS_SCROLLDOWN 32768 /* scroll flat to the south */ 152 153 154 typedef struct 155 { 156 short numsegs; 157 short firstseg; /* segs are stored sequentially */ 158 } mapsubsector_t; 159 160 typedef struct 161 { 162 short v1, v2; 163 short angle; /* ???: make this a sidedef? */ 164 short linedef, side; 165 short offset; 166 } mapseg_t; 167 168 enum {BOXTOP,BOXBOTTOM,BOXLEFT,BOXRIGHT}; /* bbox coordinates */ 169 170 #define NF_SUBSECTOR 0x8000 171 typedef struct 172 { 173 short x,y,dx,dy; /* partition line */ 174 short bbox[2][4]; /* bounding box for each child */ 175 unsigned short children[2]; /* if NF_SUBSECTOR its a subsector */ 176 } mapnode_t; 177 178 typedef struct 179 { 180 short x,y,z; 181 short angle; 182 short type; 183 short options; 184 short tid; 185 } mapthing_t; 186 187 #define MTF_EASY 1 188 #define MTF_NORMAL 2 189 #define MTF_HARD 4 190 #define MTF_AMBUSH 8 191 192 #define MTF_MULTI 16 /* Multiplayer specific */ 193 #define MTF_SPAWN 32 /* Don't spawn until triggered in level */ 194 #define MTF_ONTOUCH 64 /* Trigger something when picked up */ 195 #define MTF_ONDEATH 128 /* Trigger something when killed */ 196 #define MTF_SECRET 256 /* Count as secret for intermission when picked up */ 197 #define MTF_NOINFIGHTING 512 /* Ignore other attackers */ 198 #define MTF_NODEATHMATCH 1024 /* Don't spawn in deathmatch games */ 199 #define MTF_NONETGAME 2048 /* Don't spawn in standard netgame mode */ 200 #define MTF_NIGHTMARE 4096 /* [kex] Nightmare thing */ 201 202 /* 203 //Psx Doom 204 #define MTF_BLENDMASK1 0x20 205 #define MTF_BLENDMASK2 0x40 206 #define MTF_BLENDMASK3 0x80 207 */ 208 209 // New Doom 64 210 typedef struct 211 { 212 byte r; 213 byte g; 214 byte b; 215 byte a; 216 short tag; 217 } maplights_t; 218 219 #endif /* __DOOMDATA__ */ 220