home *** CD-ROM | disk | FTP | other *** search
/ 1,001 Nights of Doom / 1001NightsOfDoom1995wickedSensations.iso / nodebild / idbsp10.zip / DOOMDATA.H < prev    next >
C/C++ Source or Header  |  1994-05-28  |  5KB  |  203 lines

  1. /* DoomData.h */
  2.  
  3. /*
  4.  all external data is defined here
  5.  most of the data is loaded into different structures at run time
  6. */
  7.  
  8. #ifndef __DOOMDATA__
  9. #define __DOOMDATA__
  10.  
  11. #ifndef __BYTEBOOL__
  12. #define __BYTEBOOL__
  13. typedef enum {false, true} boolean;
  14. typedef unsigned char byte;
  15. #endif
  16.  
  17. /*
  18. ===============================================================================
  19.  
  20.                         map level types
  21.  
  22. ===============================================================================
  23. */
  24.  
  25. /* lump order in a map wad */
  26. enum {ML_LABEL, ML_THINGS, ML_LINEDEFS, ML_SIDEDEFS, ML_VERTEXES, ML_SEGS,
  27. ML_SSECTORS, ML_NODES, ML_SECTORS , ML_REJECT, ML_BLOCKMAP};
  28.  
  29.  
  30. typedef struct
  31. {
  32.     short        x,y;
  33. } mapvertex_t;
  34.  
  35. typedef struct
  36. {
  37.     short        textureoffset;
  38.     short        rowoffset;
  39.     char        toptexture[8], bottomtexture[8], midtexture[8];
  40.     short        sector;                /* on viewers side */
  41. } mapsidedef_t;
  42.  
  43. typedef struct
  44. {
  45.     short        v1, v2;
  46.     short        flags;
  47.     short        special, tag;
  48.     short        sidenum[2];            /* sidenum[1] will be -1 if one sided */
  49. } maplinedef_t;
  50.  
  51. #define    ML_BLOCKING            1
  52. #define    ML_BLOCKMONSTERS    2
  53. #define    ML_TWOSIDED            4        /* backside will not be present at all */
  54.                                                         /* if not two sided */
  55.  
  56. /*
  57.  if a texture is pegged, the texture will have the end exposed to air held
  58.  constant at the top or bottom of the texture (stairs or pulled down things)
  59.  and will move with a height change of one of the neighbor sectors
  60.  Unpegged textures allways have the first row of the texture at the top
  61.  pixel of the line for both top and bottom textures (windows)
  62. */
  63.  
  64. #define    ML_DONTPEGTOP        8
  65. #define    ML_DONTPEGBOTTOM    16
  66.  
  67. #define ML_SECRET                32        /* dont map as two sided: ITS A SECRET! */
  68. #define ML_SOUNDBLOCK        64        /* dont let sound cross two of these        */
  69. #define    ML_DONTDRAW            128        /* dont draw on the automap                            */
  70. #define    ML_MAPPED                256        /* set if allready drawn in automap            */
  71.  
  72.  
  73. typedef    struct
  74. {
  75.     short        floorheight, ceilingheight;
  76.     char        floorpic[8], ceilingpic[8];
  77.     short        lightlevel;
  78.     short        special, tag;
  79. } mapsector_t;
  80.  
  81. typedef struct
  82. {
  83.     short        numsegs;
  84.     short        firstseg;            /* segs are stored sequentially */
  85. } mapsubsector_t;
  86.  
  87. typedef struct
  88. {
  89.     short        v1, v2;
  90.     short        angle;
  91.     short        linedef, side;
  92.     short        offset;
  93. } mapseg_t;
  94.  
  95. enum {BOXTOP,BOXBOTTOM,BOXLEFT,BOXRIGHT};    /* bbox coordinates */
  96.  
  97. #define    NF_SUBSECTOR    0x8000
  98. typedef struct
  99. {
  100.     short        x,y,dx,dy;            /* partition line */
  101.     short        bbox[2][4];            /* bounding box for each child */
  102.     unsigned short    children[2];        /* if NF_SUBSECTOR its a subsector */
  103. } mapnode_t;
  104.  
  105. typedef struct
  106. {
  107.     short        x,y;
  108.     short        angle;
  109.     short        type;
  110.     short        options;
  111. } mapthing_t;
  112.  
  113. #define    MTF_EASY        1
  114. #define    MTF_NORMAL        2
  115. #define    MTF_HARD        4
  116. #define    MTF_AMBUSH        8
  117.  
  118. /*
  119. ===============================================================================
  120.  
  121.                         texture definition
  122.  
  123. ===============================================================================
  124. */
  125.  
  126. typedef struct
  127. {
  128.     short    originx;
  129.     short    originy;
  130.     short    patch;
  131.     short    stepdir;
  132.     short    colormap;
  133. } mappatch_t;
  134.  
  135. typedef struct
  136. {
  137.     char        name[8];
  138.     boolean        masked;
  139.     short        width;
  140.     short        height;
  141.     void        **columndirectory;    /* OBSOLETE */
  142.     short        patchcount;
  143.     mappatch_t    patches[1];
  144. } maptexture_t;
  145.  
  146.  
  147. /*
  148. ===============================================================================
  149.  
  150.                             graphics
  151.  
  152. ===============================================================================
  153. */
  154.  
  155. /*    posts are runs of non masked source pixels */
  156. typedef struct
  157. {
  158.     byte        topdelta;        /* -1 is the last post in a column */
  159.     byte        length;
  160. /* length data bytes follows */
  161. } post_t;
  162.  
  163. /* column_t is a list of 0 or more post_t, (byte)-1 terminated */
  164. typedef post_t    column_t;
  165.  
  166. /* a patch holds one or more columns */
  167. /* patches are used for sprites and all masked pictures */
  168. typedef struct
  169. {
  170.     short        width;        /*    bounding box size */
  171.     short        height;
  172.     short        leftoffset; /*pixels to the left of origin */
  173.     short        topoffset;  /* pixels below the origin */
  174.     int            columnofs[8]; /* only [width] used;  the [0] is &columnofs[width] */
  175. } patch_t;
  176.  
  177. /*
  178.  a pic is an unmasked block of pixels
  179. */
  180.  
  181. typedef struct
  182. {
  183.     byte        width,height;
  184.     byte        data;
  185. } pic_t;
  186.  
  187.  
  188.  
  189.  
  190. /*
  191. ===============================================================================
  192.  
  193.                             status
  194.  
  195. ===============================================================================
  196. */
  197.  
  198.  
  199.  
  200.  
  201. #endif            /* __DOOMDATA__ */
  202.  
  203.