home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / qube / qube.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-07  |  2.7 KB  |  102 lines

  1. /***
  2. ****  QuBE  --- Main header file.
  3. ***/
  4.  
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8.  
  9. /*
  10. **  This is the header on the BSP file.  Its definitions are now based on the
  11. **  information available in the Unofficial Quake Specs, V3.0.    If you need to
  12. **  know what the stuff below means, read my source or get the specs:
  13. **  http://www.stud.montefiore.ulg.ac.be/ftp-mirror/quake/docs/
  14. */
  15.  
  16. struct headertag {
  17.     /* File type identifier; appears to be 0x17 for .BSP files */
  18.         unsigned long id;                       /* 00 - should be 17 */
  19.  
  20.     /* The entities list */
  21.         unsigned long entities;                 /* 04 */
  22.     unsigned long entitieslen;        /* 08 */
  23.  
  24.     /* The map planes */
  25.     unsigned long planes;            /* 0C */
  26.     unsigned long planeslen;        /* 10 */
  27.  
  28.     /* The wall textures */
  29.         unsigned long pictures;                 /* 14 */
  30.     unsigned long piclen;            /* 18 */
  31.  
  32.     /* The map vertices */
  33.     unsigned long vertices;         /* 1C */
  34.     unsigned long verticeslen;        /* 20 */
  35.  
  36.     /* The visibility lists */
  37.     unsigned long PVS;            /* 24 */
  38.     unsigned long PVSlen;            /* 28 */
  39.  
  40.     /* Hull BSP nodes */
  41.     unsigned long nodes;            /* 2C */
  42.     unsigned long nodeslen;         /* 30 */
  43.  
  44.     /* The map surfaces */
  45.     unsigned long surfaces;         /* 34 */
  46.     unsigned long surfaceslen;        /* 38 */
  47.  
  48.     /* The light maps */
  49.     unsigned long lightmaps;        /* 3C */
  50.     unsigned long lightmapslen;        /* 40 */
  51.  
  52.     /* The hull BSP tree */
  53.         unsigned long tree;                     /* 44 */
  54.     unsigned long treelen;            /* 48 */
  55.  
  56.     /* The hull BSP leaves */
  57.     unsigned long leaves;            /* 4C */
  58.     unsigned long leaveslen;        /* 50 */
  59.  
  60.     /* The list of surfaces */
  61.     unsigned long surfacelist;        /* 54 */
  62.     unsigned long surfacelistlen;        /* 58 */
  63.  
  64.     /* The original surface edges */
  65.     unsigned long orgedges;         /* 5C */
  66.     unsigned long orgedgeslen;        /* 60 */
  67.  
  68.     /* The list of surfaces edges */
  69.     unsigned long edges;            /* 64 */
  70.     unsigned long edgeslen;         /* 68 */
  71.  
  72.     /* The list of hulls */
  73.     unsigned long hulls;            /* 6C */
  74.     unsigned long hullslen;         /* 70 */
  75. };
  76.  
  77. /* Structure of a vertex.  Note that it uses floating point.  That probably
  78.    means that it'll be the first to change when the final release of Quake
  79.    comes out. */
  80.  
  81. typedef struct {
  82.     float x, y, z;
  83. } vertex;
  84.  
  85. /* The header and the input file will be
  86.    needed everywhere, so they're global */
  87.  
  88. extern struct headertag header;
  89. extern FILE *fi;
  90. extern int filenamearg;
  91. extern int justcreated;
  92. extern int verbose;
  93.  
  94. void Error(char *format, ...);
  95. int main(int argc, char **argv);
  96. int MatchName(char *expr, char *string);
  97.  
  98. void *Qmalloc(long int size);
  99. void *Qrealloc(void *buffer, long int size);
  100. void Qfree(void *buffer);
  101.  
  102.