XDDEFS.H 4.6 KB

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