home *** CD-ROM | disk | FTP | other *** search
/ Doom Fever / Doom_Fever-1995_Maple_Media.iso / dmmaped / doomed26.zip / STRUCTS.H < prev    next >
C/C++ Source or Header  |  1994-05-21  |  7KB  |  192 lines

  1. // Structures for DoomEd
  2. // Copyright ⌐ 1994 by Geoff Allan
  3.  
  4. struct WadDirectoryEntry {
  5.     long Offset;                // start in WAD
  6.     long Length;                // length
  7.     char Title[9];              // name (in file, is 8 bytes)
  8. };
  9.  
  10. struct WadThingsFile {          // 10 bytes
  11.     int  x;                     // location x
  12.     int  y;                     // location y
  13.     int  face;                  // direction it faces (degrees)
  14.     int  item;                  // the item type number
  15.     int  lev;                   // level(s) (bit specific)
  16.                                 // bit 0 = lev 1
  17.                                 // bit 1 = lev 2&3
  18.                                 // bit 2 = lev 4
  19.                                 // bit 3 = deaf: must see you
  20.                                 // bit 4 = multiplayer mode only
  21. };
  22.  
  23. struct WadLineDefsFile {        // 14 bytes
  24.     int  from;                  // vertex from
  25.     int  to;                    // vertex to
  26.     int  solidity;              // bit 0 indicates walk-thru
  27.     int  special;               // 1=door, 48=animated, 
  28.     int  plat;                  // attached to sector - platform trigger
  29.     int  sidedef1;              // side texturing
  30.     int  sidedef2;              // optional side texturing (or -1)
  31. };
  32.  
  33. struct WadSideDefsFile {        // 30 bytes
  34.     int  x;                     // offset for texture start point
  35.     int  y;                     // offset for texture start point
  36.     char t1[8];                 // texture above a lower adjacent ceiling
  37.     char t2[8];                 // texture below a higher adjacent floor
  38.     char t3[8];                 // texture for the main wall area
  39.     int  sector;                // which sector this is a part of
  40. };
  41.  
  42. struct WadVertexFile {          // 4 bytes
  43.     int  x;                     // location x
  44.     int  y;                     // location y
  45. };
  46.  
  47. struct WadSegsFile {            // 12 bytes
  48.     int  vertex1;               // vertex from
  49.     int  vertex2;               // vertex to
  50.     int  angle;                 // angle:     0 = east,  16384 = north,
  51.                                 //       -32768 = west, -16384 = south
  52.     int  linedef;               // linedef
  53.     int  normal;                // BOOL - TRUE means vertex1 to vertex2
  54.                                 //       FALSE means vertex2 to vertex1
  55.     int  distance;              // distance from end of linedef
  56. };
  57.  
  58. struct WadSSectorsFile {        // 4 bytes
  59.     int  num;                   // # of segs in sector
  60.     int  segs;                  // segs record number to start
  61. };
  62.  
  63. struct WadNodesFile {           // 28 bytes
  64.     int  x;                     // location
  65.     int  y;                     // likewise
  66.     int  dx;                    // offset to end of nodeline
  67.     int  dy;
  68.     int  maxy1;                 // rectangular area 1
  69.     int  miny1;
  70.     int  minx1;
  71.     int  maxx1;
  72.     int  maxy2;                 // rectangular area 2
  73.     int  miny2;
  74.     int  minx2;
  75.     int  maxx2;
  76.     int  ssector1;              // if bit 15 set, these are ssectors
  77.     int  ssector2;              // (must be &'d with 0x7fff)
  78.                                 // otherwise they are nodes
  79. };
  80.  
  81. struct WadSectorsFile {         // 26 bytes
  82.     int  floorZ;                // Z axis location of floor
  83.     int  ceilZ;                 // Y axis location of floor
  84.     char Floor[8];              // name of floor tile
  85.     char Ceil[8];               // name of ceiling tile
  86.     int  light;                 // brightness of area (0-255)
  87.     int  flash;                 // light flashing info
  88.     int  plat;                  // platform number (elevators)
  89. };
  90.  
  91. struct WadBlockMapFile {        // used for fast-math display routines.
  92.                                 // Each block is 0x80 square
  93.     int  x;                     // origin (bottom left corner)
  94.     int  y;
  95.     int  xblocks;               // #: X direction (columns)
  96.     int  yblocks;               // #: Y direction (rows)
  97. };
  98.  
  99. struct WadSoundHeader {
  100.     int  id;                    // must be 3
  101.     int  rate;                  // sampling rate must be 11025
  102.     long size;                  // number of bytes
  103. };
  104.  
  105. // not in WAD file, just for DoomEd:
  106.  
  107. struct dThing {                 // descriptions of things
  108.     int  num;                   // the item number
  109.     char image[9];              // the WAD image
  110.     char desc[40];              // a nice description
  111. };
  112.  
  113. struct TextureInfo {
  114.     char name[9];               // name of texture
  115.     long offset;                // where in WAD is data
  116.     int  v1;
  117.     int  v2;
  118.     int  x;
  119.     int  y;
  120.     int  v5;
  121.     int  v6;
  122.     int  num;
  123. };
  124.  
  125. struct TextureItem {
  126.     int  x;
  127.     int  y;
  128.     int  pname;
  129.     int  v4;
  130.     int  v5;
  131. };
  132.  
  133. struct PNameInfo {
  134.     char name[9];
  135.     int  num;
  136. };
  137.  
  138. struct WavSoundHeader {         // brute force, dammit!
  139.     FOURCC riff;                // (multimedia extensions
  140.     long size;                  //  way is too complex...)
  141.     FOURCC wave;
  142.     FOURCC fmt;
  143.     long  offset;
  144.     WAVEFORMAT wf;
  145.     int  u1;
  146.     FOURCC data;
  147.     long datasize;
  148. };
  149.  
  150. struct QueueEntry {
  151.     BOOL Active;                // will action be performed?
  152.     int Action;                 // Q_ADD, Q_EXTRACT, Q_DELETE, Q_REPLACE
  153.     int dirnum;                 // Which WAD object number
  154.     long Size;                  // how many bytes in buffer
  155.     unsigned char _huge *dbuf;  // allocated using GlobalAlloc
  156.     HGLOBAL hglobal;            // this will be freed on QueueFlush
  157.     char dosfile[144];          // DOS filename (reference only)
  158. };
  159.  
  160. struct Plats {
  161.     int  PlatNum;               // platform number for Doom
  162.     char PlatName[16];          // symbolic name
  163.     char PlatDesc[256];         // description for editing
  164. };
  165.  
  166. // What follows is for the ID BSP builder
  167.  
  168. typedef struct {
  169.     int      floorheight, ceilingheight;
  170.     char     floorflat[9], ceilingflat[9];
  171.     int      lightlevel;
  172.     int      special, tag;  
  173. } sectordef_t;
  174.  
  175. typedef struct {
  176.     int     firstrow;  
  177.     int     firstcollumn;
  178.     char    toptexture[9];
  179.     char    bottomtexture[9];
  180.     char    midtexture[9];
  181.     sectordef_t  sectordef;   // on the viewer's side
  182.     int     sector;           // only used when saving doom map
  183. } worldside_t;
  184.  
  185. typedef struct {
  186.     POINT    p1, p2;
  187.     int      special, tag;
  188.     int      flags;  
  189.     worldside_t  side[2];
  190. } worldline_t;
  191.  
  192.