home *** CD-ROM | disk | FTP | other *** search
- #include "dostypes.h"
-
-
- void LoadQuake();
-
- // *** Basic Datatypes ***
-
- typedef float scalar_t; // Scalar value,
- typedef unsigned char u_char;
- typedef unsigned short int u_short;
-
- typedef struct // Vector or Position
- { scalar_t x; // horizontal
- scalar_t y; // horizontal
- scalar_t z; // vertical
- } vec3_t;
-
-
- typedef struct // Bounding Box
- { vec3_t min; // minimum values of X,Y,Z
- vec3_t max; // maximum values of X,Y,Z
- } boundbox_t;
-
-
- // *** The BSP file structures ***
-
- typedef struct // A Directory entry
- { long offset; // Offset to entry, in bytes, from start of file
- long size; // Size of entry in file, in bytes
- } dentry_t;
-
- // Here is the directory itself:
-
- typedef struct // The BSP file header
- { long version; // Model version, must be 27.
- dentry_t entities; // List of Entities.
- dentry_t planes; // Map Planes.
- // numplanes = size/sizeof(plane_t)
- dentry_t miptex; // Wall Textures.
- dentry_t vertices; // Map Vertexes.
- // numvertex = size/sizeof(vertex_t)
- dentry_t visilist; // Leaves Visibility lists.
- dentry_t nodes; // Zone BSP Nodes.
- // numnodes = size/sizeof(node_t)
- dentry_t surfaces; // Map Surfaces.
- // numsurfaces = size/sizeof(surface_t)
- dentry_t lightmaps; // Wall Light Maps.
- dentry_t zonesplit; // BSP to separate Zones.
- // numzsplit = size/sizeof(zsplit_t)
- dentry_t leaves; // Zone BSP Leaves.
- // numlaves = size/sizeof(leaf_t)
- dentry_t lstsurf; // List of Surfaces.
- dentry_t edges; // Original surface Edges.
- // numedges = Size/sizeof(edge_t)
- dentry_t lstedges; // List of surfaces Edges.
- dentry_t zones; // List of Zones.
- // numzones = Size/sizeof(zone_t)
- } dheader_t;
-
- typedef struct
- { vec3_t normal; // Vector orthogonal to plane (Nx,Ny,Nz)
- // with Nx▓+Ny▓+Nz▓ = 1
- scalar_t dist; // Offset to plane, along the normal vector
- // Distance from (0,0,0) to the plane
- long type; // Type of plane, depending on normal vector:
- // 0: facing toward X 3: toward -X
- // 1: facing toward Y 4: toward -Y
- // 2: facing toward Z 5: toward -Z
- long firstsurf; // first surface in that plane
- // must be in [0,numsurfaces[
- long numsurf; // nb of consecutive surfaces in that plane
- } plane_t;
-
-
- typedef struct
- { short planenum; // The plane in which the surface lies
- // must be in [0,numplanes[
- short side; // 1 if in front of the plane, 0 if behind
- u_char texnum; // id of Mips Texture
- // must be in [0,numtex[
- u_char sofs; // horizontal offset (in texture space)
- u_char tofs; // vertical offset (in texture space)
- u_char flips; // bit 0: flip verticaly (in texture space)
- // bit 1: flip horizontaly (in texture space)
- // bit 2: exchange vertical and horizontal
- long firstedge; // first edge in the List of edges
- // must be in [0,numedges[
- long numedge; // number of edges in the List of edges
- u_char light; // base light level for the surface
- u_char unknown1; // 0xFF
- u_char unknown2; // 0xFF
- u_char unknown3; // 0xFF
- long lightmap; // Pointer inside the general light map, or -1
- // this define the start of the surface light map
- } dsurface_t;
-
-
- typedef struct
- { u_short startvertex; // id of the start vertex
- // must be in [0,numvertexes[
- u_short endvertex; // id of the start vertex
- // must be in [0,numvertexes[
- } edge_t;
-
- typedef struct
- {
- float x,y,z; // X,Y,Z coordinates of the vertex
- }vertex_t;
-