home *** CD-ROM | disk | FTP | other *** search
/ MegaDoom Add-On 3 / MEGADOOM3.iso / editor / bsp12x / structs.h < prev    next >
C/C++ Source or Header  |  1994-10-26  |  4KB  |  134 lines

  1. /*- Doom Structures .. Colin Reed 1994 -------------------------------------*/
  2.  
  3. struct wad_header                     /* Linked wad files list.*/
  4. {
  5.     char type[4];
  6.     long int num_entries;
  7.     long int dir_start;
  8. };
  9.  
  10. struct directory                         /* The directory entry header*/
  11. {
  12.     long int start;
  13.     long int length;
  14.     char name[8];
  15. };
  16.  
  17. struct Block
  18. {
  19.     short minx;
  20.     short miny;
  21.     short xblocks;
  22.     short yblocks;
  23. };
  24.  
  25. /*- The level structures ---------------------------------------------------*/
  26.  
  27. struct Thing
  28. {
  29.    short xpos;      /* x position */
  30.    short ypos;      /* y position */
  31.    short angle;     /* facing angle */
  32.    short type;      /* thing type */
  33.    short when;      /* appears when? */
  34. };
  35.  
  36. struct Vertex
  37. {
  38.    short int x;         /* X coordinate */
  39.    short int y;         /* Y coordinate */
  40. };
  41.  
  42. struct LineDef
  43. {
  44.    short int start;     /* from this vertex ... */
  45.    short int end;       /* ... to this vertex */
  46.    short int flags;     /* see NAMES.C for more info */
  47.    short int type;      /* see NAMES.C for more info */
  48.    short int tag;       /* crossing this linedef activates the sector with the same tag */
  49.    short int sidedef1;  /* sidedef */
  50.    short int sidedef2;  /* only if this line adjoins 2 sectors */
  51. };
  52.  
  53. struct SideDef
  54. {
  55.    short int xoff;      /* X offset for texture */
  56.    short int yoff;      /* Y offset for texture */
  57.    char tex1[8];  /* texture name for the part above */
  58.    char tex2[8];  /* texture name for the part below */
  59.    char tex3[8];  /* texture name for the regular part */
  60.    short int sector;    /* adjacent sector */
  61. };
  62.  
  63. struct Sector
  64. {
  65.    short int floorh;    /* floor height */
  66.    short int ceilh;     /* ceiling height */
  67.    char floort[8];/* floor texture */
  68.    char ceilt[8]; /* ceiling texture */
  69.    short int light;     /* light level (0-255) */
  70.    short int special;   /* special behaviour (0 = normal, 9 = secret, ...) */
  71.    short int tag;       /* sector activated by a linedef with the same tag */
  72. };
  73.  
  74. /*--------------------------------------------------------------------------*/
  75. /* These are the structure used for creating the NODE bsp tree.
  76. /*--------------------------------------------------------------------------*/
  77.  
  78. struct Seg
  79. {
  80.    short int start;     /* from this vertex ... */
  81.    short int end;       /* ... to this vertex */
  82.    unsigned short angle;/* angle (0 = east, 16384 = north, ...) */
  83.    short int linedef;   /* linedef that this seg goes along*/
  84.    short int flip;      /* true if not the same direction as linedef */
  85.    unsigned short dist; /* distance from starting point */
  86.     struct Seg *next;
  87. };
  88.  
  89. struct Pseg
  90. {
  91.    short int start;     /* from this vertex ... */
  92.    short int end;       /* ... to this vertex */
  93.    unsigned short angle;/* angle (0 = east, 16384 = north, ...) */
  94.    short int linedef;   /* linedef that this seg goes along*/
  95.    short int flip;      /* true if not the same direction as linedef */
  96.    unsigned short dist; /* distance from starting point */
  97. };
  98.  
  99. struct Node
  100. {
  101.    short int x, y;                                    /* starting point*/
  102.    short int dx, dy;                                    /* offset to ending point*/
  103.    short int maxy1, miny1, minx1, maxx1;        /* bounding rectangle 1*/
  104.    short int maxy2, miny2, minx2, maxx2;        /* bounding rectangle 2*/
  105.    short int chright, chleft;                        /* Node or SSector (if high bit is set)*/
  106.     struct Node *nextr,*nextl;
  107.     short int node_num;                                /* starting at 0 (but reversed when done)*/
  108. };
  109.  
  110. struct Pnode
  111. {
  112.    short int x, y;                                    /* starting point*/
  113.    short int dx, dy;                                    /* offset to ending point*/
  114.    short int maxy1, miny1, minx1, maxx1;        /* bounding rectangle 1*/
  115.    short int maxy2, miny2, minx2, maxx2;        /* bounding rectangle 2*/
  116.    short int chright, chleft;                        /* Node or SSector (if high bit is set)*/
  117. };
  118.  
  119. struct SSector
  120. {
  121.    short int num;       /* number of Segs in this Sub-Sector */
  122.    short int first;     /* first Seg */
  123. };
  124.  
  125. struct splitter
  126. {
  127.     short int halfx;
  128.     short int halfy;
  129.     short int halfsx;
  130.     short int halfsy;
  131. };
  132.  
  133. /*--------------------------------------------------------------------------*/
  134.