UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qfiles.h File Reference

Header for various formats like pak, and model formats as well as bsp format. More...

Go to the source code of this file.

Data Structures

struct  dMD2Coord_t
 These two shorts are used to map a vertex onto a skin The horizontal axis position is given by s, and the vertical axis position is given by t. The ranges for s and t are greater than or equal to 0 and less than skinWidth and skinHeight. More...
 
struct  dMD2Triangle_t
 
struct  dMD2TriangleVertex_t
 
struct  dAliasFrame_s
 is a variable sized structure, however all frame_t structures within the same file will have the same size (numVertices in the header) More...
 
struct  dMD2Model_t
 the glcmd format: a positive integer starts a tristrip command, followed by that many vertex structures. a negative integer starts a trifan command, followed by -x vertexes a zero indicates the end of the command list. a vertex consists of a floating point s, a floating point t, and an integer vertex index. More...
 
struct  dMD2tag_t
 Tag file header structure - 32 byte A tag for a model must have the same amount of frames as the model. A tag is nothing more than a coordinate. It's used to e.g. determine the hand of a model when the walking animation is played. The renderer has to know where to place the weapon. More...
 
struct  dmd3coord_t
 
struct  dmd3vertex_t
 
struct  dmd3frame_t
 
struct  dorientation_t
 
struct  dmd3tag_t
 
struct  dmd3skin_t
 
struct  dmd3mesh_t
 
struct  dmd3_t
 
struct  lump_t
 Directory of the different data blocks. More...
 
struct  dBspHeader_t
 The BSP header definition with the data block directory. More...
 

Macros

#define IDMDXHEADER   "UFOMDX"
 
#define MDX_VERSION   1
 
#define IDALIASHEADER   (('2'<<24)+('P'<<16)+('D'<<8)+'I')
 
#define IDTAGHEADER   (('2'<<24)+('P'<<16)+('D'<<8)+'J')
 
#define MD2_ALIAS_VERSION   8
 
#define TAG_VERSION   1
 
#define MD2_MAX_TRIANGLES   4096
 
#define MD2_MAX_VERTS   2048
 
#define MD2_MAX_FRAMES   1024
 
#define MD2_MAX_SKINS   32
 
#define MD2_MAX_SKINNAME   64
 
#define MD2_MAX_TAGNAME   64
 
#define IDMD3HEADER   (('3'<<24)+('P'<<16)+('D'<<8)+'I')
 
#define MD3_ALIAS_VERSION   15
 
#define MD3_ALIAS_MAX_LODS   4
 
#define MD3_MAX_TRIANGLES   8192 /* per mesh */
 
#define MD3_MAX_VERTS   4096 /* per mesh */
 
#define MD3_MAX_SHADERS   256 /* per mesh */
 
#define MD3_MAX_FRAMES   1024 /* per model */
 
#define MD3_MAX_MESHES   32 /* per model */
 
#define MD3_MAX_TAGS   16 /* per frame */
 
#define MD3_MAX_PATH   64
 
#define MD3_XYZ_SCALE   (1.0f/64.0f)
 
#define IDBSPHEADER   (('P'<<24)+('S'<<16)+('B'<<8)+'I')
 
#define BSPVERSION   79
 
#define BSP_SwapHeader(header, name)
 

Typedefs

typedef struct dAliasFrame_s dMD2Frame_t
 is a variable sized structure, however all frame_t structures within the same file will have the same size (numVertices in the header) More...
 

Detailed Description

Header for various formats like pak, and model formats as well as bsp format.

Note
This file must be identical in the quake and utils directories
The .pk3 files are just zip files
quake file formats: md2, md3, pk3, bsp

Definition in file qfiles.h.

Macro Definition Documentation

#define BSP_SwapHeader (   header,
  name 
)
Value:
{ \
unsigned int i; \
(header)->ident = LittleLong((header)->ident); \
(header)->version = LittleLong((header)->version); \
for (i = 0; i < HEADER_LUMPS; i++) { \
lump_t* l = &(header)->lumps[i]; \
l->filelen = LittleLong(l->filelen); \
l->fileofs = LittleLong(l->fileofs); \
if (l->fileofs == (uint32_t) -1) \
Sys_Error("Invalid bsp header found (lump overflow %i): '%s'", i, (name)); \
} \
}
void Sys_Error(const char *error,...)
Definition: g_main.cpp:421
#define HEADER_LUMPS
Definition: defines.h:184
QGL_EXTERN GLint i
Definition: r_gl.h:113
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
#define LittleLong(X)
Definition: byte.h:37

Definition at line 269 of file qfiles.h.

Referenced by CM_AddMapTile(), LoadBSPFile(), and R_ModAddMapTile().

#define BSPVERSION   79

Definition at line 253 of file qfiles.h.

Referenced by CheckBSPFile(), CM_AddMapTile(), LoadBSPFile(), R_ModAddMapTile(), and WriteBSPFile().

#define IDALIASHEADER   (('2'<<24)+('P'<<16)+('D'<<8)+'I')

Definition at line 40 of file qfiles.h.

Referenced by LoadModel(), MD2HeaderCheck(), ModelWorker(), R_LoadModelAsync(), and SV_LoadModelAABB().

#define IDBSPHEADER   (('P'<<24)+('S'<<16)+('B'<<8)+'I')

little-endian "IBSP"

Definition at line 251 of file qfiles.h.

Referenced by CheckBSPFile(), LoadBSPFile(), ModelWorker(), R_LoadModelAsync(), and WriteBSPFile().

#define IDMD3HEADER   (('3'<<24)+('P'<<16)+('D'<<8)+'I')
#define IDMDXHEADER   "UFOMDX"

Definition at line 33 of file qfiles.h.

Referenced by R_ModLoadMDX(), and WriteToFile().

#define IDTAGHEADER   (('2'<<24)+('P'<<16)+('D'<<8)+'J')

Definition at line 41 of file qfiles.h.

#define MD2_ALIAS_VERSION   8

Definition at line 42 of file qfiles.h.

Referenced by MD2HeaderCheck(), and R_ModLoadAliasMD2Mesh().

#define MD2_MAX_FRAMES   1024

Definition at line 47 of file qfiles.h.

Referenced by R_ModLoadAliasMD2Model().

#define MD2_MAX_SKINNAME   64
#define MD2_MAX_SKINS   32
#define MD2_MAX_TAGNAME   64

Definition at line 50 of file qfiles.h.

#define MD2_MAX_TRIANGLES   4096
#define MD2_MAX_VERTS   2048
#define MD3_ALIAS_MAX_LODS   4

Definition at line 162 of file qfiles.h.

#define MD3_ALIAS_VERSION   15

Definition at line 161 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MD3_MAX_FRAMES   1024 /* per model */

Definition at line 167 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MD3_MAX_MESHES   32 /* per model */

Definition at line 168 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MD3_MAX_PATH   64

Definition at line 170 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MD3_MAX_SHADERS   256 /* per mesh */

Definition at line 166 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MD3_MAX_TAGS   16 /* per frame */

Definition at line 169 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MD3_MAX_TRIANGLES   8192 /* per mesh */

Definition at line 164 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MD3_MAX_VERTS   4096 /* per mesh */

Definition at line 165 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MD3_XYZ_SCALE   (1.0f/64.0f)

vertex scales

Definition at line 173 of file qfiles.h.

Referenced by R_ModLoadAliasMD3Model().

#define MDX_VERSION   1

Definition at line 34 of file qfiles.h.

Referenced by R_ModLoadMDX(), and WriteToFile().

#define TAG_VERSION   1

Definition at line 43 of file qfiles.h.

Referenced by R_ModLoadTags().

Typedef Documentation

typedef struct dAliasFrame_s dMD2Frame_t

is a variable sized structure, however all frame_t structures within the same file will have the same size (numVertices in the header)