home *** CD-ROM | disk | FTP | other *** search
/ Quake++ for Quake / Quake++.iso / quake / qkview / quake.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-08  |  4.3 KB  |  109 lines

  1. #include "dostypes.h"
  2.  
  3.  
  4. void LoadQuake();
  5.  
  6. // ***     Basic Datatypes     ***
  7.  
  8. typedef float scalar_t;         // Scalar value,
  9. typedef unsigned char u_char;
  10. typedef unsigned short int u_short;
  11.  
  12. typedef struct                  // Vector or Position
  13. { scalar_t x;                   // horizontal
  14.   scalar_t y;                   // horizontal
  15.   scalar_t z;                   // vertical
  16. } vec3_t;
  17.  
  18.  
  19. typedef struct                  // Bounding Box
  20. { vec3_t   min;                 // minimum values of X,Y,Z
  21.   vec3_t   max;                 // maximum values of X,Y,Z
  22. } boundbox_t;
  23.  
  24.  
  25. // ***     The BSP file structures     ***
  26.  
  27. typedef struct                  // A Directory entry
  28. { long  offset;                 // Offset to entry, in bytes, from start of file
  29.   long  size;                   // Size of entry in file, in bytes
  30. } dentry_t;
  31.  
  32. // Here is the directory itself:
  33.  
  34. typedef struct                  // The BSP file header
  35. { long  version;                // Model version, must be 27.
  36.   dentry_t entities;            // List of Entities.
  37.   dentry_t planes;              // Map Planes.
  38.                                           // numplanes = size/sizeof(plane_t)
  39.   dentry_t miptex;              // Wall Textures.
  40.   dentry_t vertices;            // Map Vertexes.
  41.                                           // numvertex = size/sizeof(vertex_t)
  42.   dentry_t visilist;            // Leaves Visibility lists.
  43.   dentry_t nodes;               // Zone BSP Nodes.
  44.                                           // numnodes = size/sizeof(node_t)
  45.   dentry_t surfaces;            // Map Surfaces.
  46.                                           // numsurfaces = size/sizeof(surface_t)
  47.   dentry_t lightmaps;           // Wall Light Maps.
  48.   dentry_t zonesplit;           // BSP to separate Zones.
  49.                                           // numzsplit = size/sizeof(zsplit_t)
  50.   dentry_t leaves;              // Zone BSP Leaves.
  51.                                           // numlaves = size/sizeof(leaf_t)
  52.   dentry_t lstsurf;             // List of Surfaces.
  53.   dentry_t edges;               // Original surface Edges.
  54.                                           // numedges = Size/sizeof(edge_t)
  55.   dentry_t lstedges;            // List of surfaces Edges.
  56.   dentry_t zones;               // List of Zones.
  57.                                           // numzones = Size/sizeof(zone_t)
  58. } dheader_t;
  59.  
  60. typedef struct
  61. { vec3_t normal;                // Vector orthogonal to plane (Nx,Ny,Nz)
  62.                                           // with Nx▓+Ny▓+Nz▓ = 1
  63.   scalar_t dist;                // Offset to plane, along the normal vector
  64.                                           // Distance from (0,0,0) to the plane
  65.   long    type;                 // Type of plane, depending on normal vector:
  66.                                           // 0: facing toward X   3: toward -X
  67.                                           // 1: facing toward Y   4: toward -Y
  68.                                           // 2: facing toward Z   5: toward -Z
  69.   long    firstsurf;            // first surface in that plane
  70.                                           // must be in [0,numsurfaces[
  71.   long    numsurf;              // nb of consecutive surfaces in that plane
  72. } plane_t;
  73.  
  74.  
  75. typedef struct
  76. { short  planenum;              // The plane in which the surface lies
  77.                                           //           must be in [0,numplanes[
  78.   short  side;                  // 1 if in front of the plane, 0 if behind
  79.   u_char texnum;                // id of Mips Texture
  80.                                           //           must be in [0,numtex[
  81.   u_char sofs;                  // horizontal offset (in texture space)
  82.   u_char tofs;                  // vertical offset (in texture space)
  83.   u_char flips;                 // bit 0: flip verticaly (in texture space)
  84.                                           // bit 1: flip horizontaly (in texture space)
  85.                                           // bit 2: exchange vertical and horizontal
  86.   long firstedge;               // first edge in the List of edges
  87.                                           //           must be in [0,numedges[
  88.   long numedge;                 // number of edges in the List of edges
  89.   u_char light;                 // base light level for the surface
  90.   u_char unknown1;              // 0xFF
  91.   u_char unknown2;              // 0xFF
  92.   u_char unknown3;              // 0xFF
  93.   long lightmap;                // Pointer inside the general light map, or -1
  94.                                           // this define the start of the surface light map
  95. } dsurface_t;
  96.  
  97.  
  98. typedef struct
  99. { u_short startvertex;          // id of the start vertex
  100.                                           //           must be in [0,numvertexes[
  101.   u_short endvertex;            // id of the start vertex
  102.                                           //           must be in [0,numvertexes[
  103. } edge_t;
  104.  
  105. typedef struct
  106. {
  107.     float x,y,z;                     // X,Y,Z coordinates of the vertex
  108. }vertex_t;
  109.