home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the DOOM Programming Gurus / Tricks_of_the_Doom_Programming_Gurus.iso / bonus / editors / deth / source / wstructs.h < prev   
Encoding:
C/C++ Source or Header  |  1995-03-15  |  4.6 KB  |  178 lines

  1. /*
  2.    Doom Editor Utility, by Brendon Wyber and RaphaĆ«l Quinet.
  3.    
  4.    You are allowed to use any parts of this code in another program, as
  5.    long as you give credits to the authors in the documentation and in
  6.    the program itself.  Read the file README.1ST for more information.
  7.    
  8.    This program comes with absolutely no warranty.
  9.    
  10.    WSTRUCTS.H - WAD files data structures.
  11.    */
  12.  
  13.  
  14. /*
  15.    this data structure contains the information about the THINGS
  16.    */
  17.  
  18. /* protection against multiple includes */
  19. #ifndef _WSTRUCTS_H
  20. #define _WSTRUCTS_H
  21.  
  22. struct Thing
  23. {
  24.     BCINT xpos;      /* x position */
  25.     BCINT ypos;      /* y position */
  26.     BCINT angle;     /* facing angle */
  27.     BCINT type;      /* thing type */
  28.     BCINT when;      /* appears when? */
  29. };
  30. typedef struct Thing huge *TPtr;
  31.  
  32.  
  33.  
  34. /*
  35.    this data structure contains the information about the LINEDEFS
  36.    */
  37. struct LineDef
  38. {
  39.     BCINT start;     /* from this vertex ... */
  40.     BCINT end;       /* ... to this vertex */
  41.     BCINT flags;     /* see NAMES.C for more info */
  42.     BCINT type;      /* see NAMES.C for more info */
  43.     BCINT tag;       /* crossing this linedef activates the sector with the same tag */
  44.     BCINT sidedef1;  /* sidedef */
  45.     BCINT sidedef2;  /* only if this line adjoins 2 sectors */
  46. };
  47. typedef struct LineDef huge *LDPtr;
  48.  
  49.  
  50.  
  51. /*
  52.    this data structure contains the information about the SIDEDEFS
  53.    */
  54. struct SideDef
  55. {
  56.     BCINT xoff;      /* X offset for texture */
  57.     BCINT yoff;      /* Y offset for texture */
  58.     char tex1[8];  /* texture name for the part above */
  59.     char tex2[8];  /* texture name for the part below */
  60.     char tex3[8];  /* texture name for the regular part */
  61.     BCINT sector;    /* adjacent sector  */
  62. };
  63. typedef struct SideDef huge *SDPtr;
  64.  
  65.  
  66.  
  67. /*
  68.    this data structure contains the information about the VERTEXES
  69.    */
  70. struct Vertex
  71. {
  72.     BCINT x;         /* X coordinate */
  73.     BCINT y;         /* Y coordinate */
  74. };
  75. typedef struct Vertex huge *VPtr;
  76.  
  77.  
  78.  
  79. /*
  80.    this data structure contains the information about the SEGS
  81.    */
  82. typedef struct Seg huge *SEPtr;
  83. struct Seg
  84. {
  85.     SEPtr next;      /* next Seg in list */
  86.     BCINT start;     /* from this vertex ... */
  87.     BCINT end;       /* ... to this vertex */
  88.     UBCINT angle;    /* angle (0 = east, 16384 = north, ...) */
  89.     BCINT linedef;   /* linedef that this seg goes along*/
  90.     BCINT flip;      /* true if not the same direction as linedef */
  91.     UBCINT dist;     /* distance from starting point */
  92. };
  93.  
  94.  
  95.  
  96. /*
  97.    this data structure contains the information about the SSECTORS
  98.    */
  99. typedef struct SSector huge *SSPtr;
  100. struct SSector
  101. {
  102.     SSPtr next;      /* next Sub-Sector in list */
  103.     BCINT num;       /* number of Segs in this Sub-Sector */
  104.     BCINT first;     /* first Seg */
  105. };
  106.  
  107.  
  108.  
  109. /*
  110.    this data structure contains the information about the NODES
  111.    */
  112. typedef struct Node *NPtr;
  113. struct Node
  114. {
  115.     BCINT x, y;                         /* starting poBCINT */
  116.     BCINT dx, dy;                       /* offset to ending point */
  117.     BCINT miny1, maxy1, minx1, maxx1;   /* bounding rectangle 1 */
  118.     BCINT miny2, maxy2, minx2, maxx2;   /* bounding rectangle 2 */
  119.     BCINT child1, child2;               /* Node or SSector (if high bit is set) */
  120.     NPtr node1, node2;                /* pointer if the child is a Node */
  121.     BCINT num;                          /* number given to this Node */
  122. };
  123.  
  124.  
  125.  
  126. /*
  127.    this data structure contains the information about the SECTORS
  128.    */
  129. struct Sector
  130. {
  131.     BCINT floorh;    /* floor height */
  132.     BCINT ceilh;     /* ceiling height */
  133.     char floort[8];/* floor texture */
  134.     char ceilt[8]; /* ceiling texture */
  135.     BCINT light;     /* light level (0-255) */
  136.     BCINT special;   /* special behaviour (0 = normal, 9 = secret, ...) */
  137.     BCINT tag;       /* sector activated by a linedef with the same tag */
  138. };
  139. typedef struct Sector huge *SPtr;
  140.  
  141.  
  142. /* SO: added these 2 25/02/95 to speed up displaying wall textures */
  143.  
  144. typedef struct {
  145.     char name[8]; /* name of this texture */
  146.     BCINT zero1;  /* fields which are always zero */
  147.     BCINT zero2;
  148.     BCINT width;  /* dimensions of this texture */
  149.     BCINT height;
  150.     BCINT zero3;
  151.     BCINT zero4;
  152.     BCINT nPatches; /* number of patch descriptors following */
  153. } Texture;
  154.  
  155. typedef struct {
  156.     BCINT
  157.     xOffset,
  158.     yOffset,
  159.     PatchNumber,
  160.     One,
  161.     Zero;
  162. } PatchDesc;
  163.  
  164. /* these are to make drawing pictures easier */
  165. typedef struct {
  166.     BCINT width, height, xofs, yofs;
  167. } PHeader;
  168.  
  169. typedef struct {
  170.     BYTE yofs, npixels;
  171. } PColumn;
  172.  
  173. #endif
  174. /* _WSTRUCTS_H */
  175.  
  176. /* end of file */
  177.  
  178.