doomdata.h 4.7 KB

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