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