doomdata.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /*
  2. ===========================================================================
  3. Doom 3 BFG Edition GPL Source Code
  4. Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
  6. Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __DOOMDATA__
  21. #define __DOOMDATA__
  22. // The most basic types we use, portability.
  23. #include "doomtype.h"
  24. // Some global defines, that configure the game.
  25. #include "doomdef.h"
  26. //
  27. // Map level types.
  28. // The following data structures define the persistent format
  29. // used in the lumps of the WAD files.
  30. //
  31. // Lump order in a map WAD: each map needs a couple of lumps
  32. // to provide a complete scene geometry description.
  33. enum
  34. {
  35. ML_LABEL, // A separator, name, ExMx or MAPxx
  36. ML_THINGS, // Monsters, items..
  37. ML_LINEDEFS, // LineDefs, from editing
  38. ML_SIDEDEFS, // SideDefs, from editing
  39. ML_VERTEXES, // Vertices, edited and BSP splits generated
  40. ML_SEGS, // LineSegs, from LineDefs split by BSP
  41. ML_SSECTORS, // SubSectors, list of LineSegs
  42. ML_NODES, // BSP nodes
  43. ML_SECTORS, // Sectors, from editing
  44. ML_REJECT, // LUT, sector-sector visibility
  45. ML_BLOCKMAP // LUT, motion clipping, walls/grid element
  46. };
  47. // A single Vertex.
  48. typedef struct
  49. {
  50. short x;
  51. short y;
  52. } mapvertex_t;
  53. // A SideDef, defining the visual appearance of a wall,
  54. // by setting textures and offsets.
  55. typedef struct
  56. {
  57. short textureoffset;
  58. short rowoffset;
  59. char toptexture[8];
  60. char bottomtexture[8];
  61. char midtexture[8];
  62. // Front sector, towards viewer.
  63. short sector;
  64. } mapsidedef_t;
  65. // A LineDef, as used for editing, and as input
  66. // to the BSP builder.
  67. typedef struct
  68. {
  69. short v1;
  70. short v2;
  71. short flags;
  72. short special;
  73. short tag;
  74. // sidenum[1] will be -1 if one sided
  75. short sidenum[2];
  76. } maplinedef_t;
  77. //
  78. // LineDef attributes.
  79. //
  80. // Solid, is an obstacle.
  81. #define ML_BLOCKING 1
  82. // Blocks monsters only.
  83. #define ML_BLOCKMONSTERS 2
  84. // Backside will not be present at all
  85. // if not two sided.
  86. #define ML_TWOSIDED 4
  87. // If a texture is pegged, the texture will have
  88. // the end exposed to air held constant at the
  89. // top or bottom of the texture (stairs or pulled
  90. // down things) and will move with a height change
  91. // of one of the neighbor sectors.
  92. // Unpegged textures allways have the first row of
  93. // the texture at the top pixel of the line for both
  94. // top and bottom textures (use next to windows).
  95. // upper texture unpegged
  96. #define ML_DONTPEGTOP 8
  97. // lower texture unpegged
  98. #define ML_DONTPEGBOTTOM 16
  99. // In AutoMap: don't map as two sided: IT'S A SECRET!
  100. #define ML_SECRET 32
  101. // Sound rendering: don't let sound cross two of these.
  102. #define ML_SOUNDBLOCK 64
  103. // Don't draw on the automap at all.
  104. #define ML_DONTDRAW 128
  105. // Set if already seen, thus drawn in automap.
  106. #define ML_MAPPED 256
  107. // Sector definition, from editing.
  108. typedef struct
  109. {
  110. short floorheight;
  111. short ceilingheight;
  112. char floorpic[8];
  113. char ceilingpic[8];
  114. short lightlevel;
  115. short special;
  116. short tag;
  117. } mapsector_t;
  118. // SubSector, as generated by BSP.
  119. typedef struct
  120. {
  121. short numsegs;
  122. // Index of first one, segs are stored sequentially.
  123. short firstseg;
  124. } mapsubsector_t;
  125. // LineSeg, generated by splitting LineDefs
  126. // using partition lines selected by BSP builder.
  127. typedef struct
  128. {
  129. short v1;
  130. short v2;
  131. short angle;
  132. short linedef;
  133. short side;
  134. short offset;
  135. } mapseg_t;
  136. // BSP node structure.
  137. // Indicate a leaf.
  138. #define NF_SUBSECTOR 0x8000
  139. typedef struct
  140. {
  141. // Partition line from (x,y) to x+dx,y+dy)
  142. short x;
  143. short y;
  144. short dx;
  145. short dy;
  146. // Bounding box for each child,
  147. // clip against view frustum.
  148. short bbox[2][4];
  149. // If NF_SUBSECTOR its a subsector,
  150. // else it's a node of another subtree.
  151. unsigned short children[2];
  152. } mapnode_t;
  153. // Thing definition, position, orientation and type,
  154. // plus skill/visibility flags and attributes.
  155. typedef struct
  156. {
  157. short x;
  158. short y;
  159. short angle;
  160. short type;
  161. short options;
  162. } mapthing_t;
  163. #endif // __DOOMDATA__