mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-04-11 20:51:37 +00:00
Reformat the headers
This commit is contained in:
parent
63cdbff0e3
commit
e1f338f59b
7 changed files with 701 additions and 674 deletions
File diff suppressed because it is too large
Load diff
|
@ -30,6 +30,6 @@
|
|||
void CRC_Init(unsigned short *crcvalue);
|
||||
void CRC_ProcessByte(unsigned short *crcvalue, byte data);
|
||||
unsigned short CRC_Value(unsigned short crcvalue);
|
||||
unsigned short CRC_Block (byte *start, int count);
|
||||
unsigned short CRC_Block(byte *start, int count);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -29,405 +29,400 @@
|
|||
|
||||
/* The .pak files are just a linear collapse of a directory tree */
|
||||
|
||||
#define IDPAKHEADER (('K'<<24)+('C'<<16)+('A'<<8)+'P')
|
||||
#define IDPAKHEADER (('K' << 24) + ('C' << 16) + ('A' << 8) + 'P')
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[56];
|
||||
int filepos, filelen;
|
||||
char name[56];
|
||||
int filepos, filelen;
|
||||
} dpackfile_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int ident; /* == IDPAKHEADER */
|
||||
int dirofs;
|
||||
int dirlen;
|
||||
int ident; /* == IDPAKHEADER */
|
||||
int dirofs;
|
||||
int dirlen;
|
||||
} dpackheader_t;
|
||||
|
||||
#define MAX_FILES_IN_PACK 4096
|
||||
|
||||
#define MAX_FILES_IN_PACK 4096
|
||||
|
||||
/* PCX files are used for as many images as possible */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char manufacturer;
|
||||
char version;
|
||||
char encoding;
|
||||
char bits_per_pixel;
|
||||
unsigned short xmin,ymin,xmax,ymax;
|
||||
unsigned short hres,vres;
|
||||
unsigned char palette[48];
|
||||
char reserved;
|
||||
char color_planes;
|
||||
unsigned short bytes_per_line;
|
||||
unsigned short palette_type;
|
||||
char filler[58];
|
||||
unsigned char data; /* unbounded */
|
||||
char manufacturer;
|
||||
char version;
|
||||
char encoding;
|
||||
char bits_per_pixel;
|
||||
unsigned short xmin, ymin, xmax, ymax;
|
||||
unsigned short hres, vres;
|
||||
unsigned char palette[48];
|
||||
char reserved;
|
||||
char color_planes;
|
||||
unsigned short bytes_per_line;
|
||||
unsigned short palette_type;
|
||||
char filler[58];
|
||||
unsigned char data; /* unbounded */
|
||||
} pcx_t;
|
||||
|
||||
|
||||
/* .MD2 triangle model file format */
|
||||
|
||||
#define IDALIASHEADER (('2'<<24)+('P'<<16)+('D'<<8)+'I')
|
||||
#define ALIAS_VERSION 8
|
||||
#define IDALIASHEADER (('2' << 24) + ('P' << 16) + ('D' << 8) + 'I')
|
||||
#define ALIAS_VERSION 8
|
||||
|
||||
#define MAX_TRIANGLES 4096
|
||||
#define MAX_VERTS 2048
|
||||
#define MAX_FRAMES 512
|
||||
#define MAX_MD2SKINS 32
|
||||
#define MAX_SKINNAME 64
|
||||
#define MAX_TRIANGLES 4096
|
||||
#define MAX_VERTS 2048
|
||||
#define MAX_FRAMES 512
|
||||
#define MAX_MD2SKINS 32
|
||||
#define MAX_SKINNAME 64
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short s;
|
||||
short t;
|
||||
short s;
|
||||
short t;
|
||||
} dstvert_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short index_xyz[3];
|
||||
short index_st[3];
|
||||
short index_xyz[3];
|
||||
short index_st[3];
|
||||
} dtriangle_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte v[3]; /* scaled byte to fit in frame mins/maxs */
|
||||
byte lightnormalindex;
|
||||
byte v[3]; /* scaled byte to fit in frame mins/maxs */
|
||||
byte lightnormalindex;
|
||||
} dtrivertx_t;
|
||||
|
||||
#define DTRIVERTX_V0 0
|
||||
#define DTRIVERTX_V1 1
|
||||
#define DTRIVERTX_V2 2
|
||||
#define DTRIVERTX_LNI 3
|
||||
#define DTRIVERTX_V0 0
|
||||
#define DTRIVERTX_V1 1
|
||||
#define DTRIVERTX_V2 2
|
||||
#define DTRIVERTX_LNI 3
|
||||
#define DTRIVERTX_SIZE 4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float scale[3]; /* multiply byte verts by this */
|
||||
float translate[3]; /* then add this */
|
||||
char name[16]; /* frame name from grabbing */
|
||||
dtrivertx_t verts[1]; /* variable sized */
|
||||
float scale[3]; /* multiply byte verts by this */
|
||||
float translate[3]; /* then add this */
|
||||
char name[16]; /* frame name from grabbing */
|
||||
dtrivertx_t verts[1]; /* variable sized */
|
||||
} daliasframe_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. */
|
||||
* - 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. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int ident;
|
||||
int version;
|
||||
int ident;
|
||||
int version;
|
||||
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
int framesize; /* byte size of each frame */
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
int framesize; /* byte size of each frame */
|
||||
|
||||
int num_skins;
|
||||
int num_xyz;
|
||||
int num_st; /* greater than num_xyz for seams */
|
||||
int num_tris;
|
||||
int num_glcmds; /* dwords in strip/fan command list */
|
||||
int num_frames;
|
||||
|
||||
int ofs_skins; /* each skin is a MAX_SKINNAME string */
|
||||
int ofs_st; /* byte offset from start for stverts */
|
||||
int ofs_tris; /* offset for dtriangles */
|
||||
int ofs_frames; /* offset for first frame */
|
||||
int ofs_glcmds;
|
||||
int ofs_end; /* end of file */
|
||||
int num_skins;
|
||||
int num_xyz;
|
||||
int num_st; /* greater than num_xyz for seams */
|
||||
int num_tris;
|
||||
int num_glcmds; /* dwords in strip/fan command list */
|
||||
int num_frames;
|
||||
|
||||
int ofs_skins; /* each skin is a MAX_SKINNAME string */
|
||||
int ofs_st; /* byte offset from start for stverts */
|
||||
int ofs_tris; /* offset for dtriangles */
|
||||
int ofs_frames; /* offset for first frame */
|
||||
int ofs_glcmds;
|
||||
int ofs_end; /* end of file */
|
||||
} dmdl_t;
|
||||
|
||||
/* .SP2 sprite file format */
|
||||
|
||||
#define IDSPRITEHEADER (('2'<<24)+('S'<<16)+('D'<<8)+'I') /* little-endian "IDS2" */
|
||||
#define SPRITE_VERSION 2
|
||||
#define IDSPRITEHEADER (('2' << 24) + ('S' << 16) + ('D' << 8) + 'I') /* little-endian "IDS2" */
|
||||
#define SPRITE_VERSION 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int width, height;
|
||||
int origin_x, origin_y; /* raster coordinates inside pic */
|
||||
char name[MAX_SKINNAME]; /* name of pcx file */
|
||||
int width, height;
|
||||
int origin_x, origin_y; /* raster coordinates inside pic */
|
||||
char name[MAX_SKINNAME]; /* name of pcx file */
|
||||
} dsprframe_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int ident;
|
||||
int version;
|
||||
int numframes;
|
||||
dsprframe_t frames[1]; /* variable sized */
|
||||
int ident;
|
||||
int version;
|
||||
int numframes;
|
||||
dsprframe_t frames[1]; /* variable sized */
|
||||
} dsprite_t;
|
||||
|
||||
/* .WAL texture file format */
|
||||
|
||||
#define MIPLEVELS 4
|
||||
#define MIPLEVELS 4
|
||||
typedef struct miptex_s
|
||||
{
|
||||
char name[32];
|
||||
unsigned width, height;
|
||||
unsigned offsets[MIPLEVELS]; /* four mip maps stored */
|
||||
char animname[32]; /* next frame in animation chain */
|
||||
int flags;
|
||||
int contents;
|
||||
int value;
|
||||
char name[32];
|
||||
unsigned width, height;
|
||||
unsigned offsets[MIPLEVELS]; /* four mip maps stored */
|
||||
char animname[32]; /* next frame in animation chain */
|
||||
int flags;
|
||||
int contents;
|
||||
int value;
|
||||
} miptex_t;
|
||||
|
||||
/* .BSP file format */
|
||||
|
||||
#define IDBSPHEADER (('P'<<24)+('S'<<16)+('B'<<8)+'I') /* little-endian "IBSP" */
|
||||
#define BSPVERSION 38
|
||||
#define IDBSPHEADER (('P' << 24) + ('S' << 16) + ('B' << 8) + 'I') /* little-endian "IBSP" */
|
||||
#define BSPVERSION 38
|
||||
|
||||
/* upper design bounds */
|
||||
/* leaffaces, leafbrushes, planes, and verts are still bounded by */
|
||||
/* 16 bit short limits */
|
||||
#define MAX_MAP_MODELS 1024
|
||||
#define MAX_MAP_BRUSHES 8192
|
||||
#define MAX_MAP_ENTITIES 2048
|
||||
#define MAX_MAP_ENTSTRING 0x40000
|
||||
#define MAX_MAP_TEXINFO 8192
|
||||
/* upper design bounds: leaffaces, leafbrushes, planes, and
|
||||
* verts are still bounded by 16 bit short limits */
|
||||
#define MAX_MAP_MODELS 1024
|
||||
#define MAX_MAP_BRUSHES 8192
|
||||
#define MAX_MAP_ENTITIES 2048
|
||||
#define MAX_MAP_ENTSTRING 0x40000
|
||||
#define MAX_MAP_TEXINFO 8192
|
||||
|
||||
#define MAX_MAP_AREAS 256
|
||||
#define MAX_MAP_AREAPORTALS 1024
|
||||
#define MAX_MAP_PLANES 65536
|
||||
#define MAX_MAP_NODES 65536
|
||||
#define MAX_MAP_BRUSHSIDES 65536
|
||||
#define MAX_MAP_LEAFS 65536
|
||||
#define MAX_MAP_VERTS 65536
|
||||
#define MAX_MAP_FACES 65536
|
||||
#define MAX_MAP_LEAFFACES 65536
|
||||
#define MAX_MAP_LEAFBRUSHES 65536
|
||||
#define MAX_MAP_PORTALS 65536
|
||||
#define MAX_MAP_EDGES 128000
|
||||
#define MAX_MAP_SURFEDGES 256000
|
||||
#define MAX_MAP_LIGHTING 0x200000
|
||||
#define MAX_MAP_VISIBILITY 0x100000
|
||||
#define MAX_MAP_AREAS 256
|
||||
#define MAX_MAP_AREAPORTALS 1024
|
||||
#define MAX_MAP_PLANES 65536
|
||||
#define MAX_MAP_NODES 65536
|
||||
#define MAX_MAP_BRUSHSIDES 65536
|
||||
#define MAX_MAP_LEAFS 65536
|
||||
#define MAX_MAP_VERTS 65536
|
||||
#define MAX_MAP_FACES 65536
|
||||
#define MAX_MAP_LEAFFACES 65536
|
||||
#define MAX_MAP_LEAFBRUSHES 65536
|
||||
#define MAX_MAP_PORTALS 65536
|
||||
#define MAX_MAP_EDGES 128000
|
||||
#define MAX_MAP_SURFEDGES 256000
|
||||
#define MAX_MAP_LIGHTING 0x200000
|
||||
#define MAX_MAP_VISIBILITY 0x100000
|
||||
|
||||
/* key / value pair sizes */
|
||||
|
||||
#define MAX_KEY 32
|
||||
#define MAX_VALUE 1024
|
||||
#define MAX_KEY 32
|
||||
#define MAX_VALUE 1024
|
||||
|
||||
/* ================================================================== */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int fileofs, filelen;
|
||||
int fileofs, filelen;
|
||||
} lump_t;
|
||||
|
||||
#define LUMP_ENTITIES 0
|
||||
#define LUMP_PLANES 1
|
||||
#define LUMP_VERTEXES 2
|
||||
#define LUMP_VISIBILITY 3
|
||||
#define LUMP_NODES 4
|
||||
#define LUMP_TEXINFO 5
|
||||
#define LUMP_FACES 6
|
||||
#define LUMP_LIGHTING 7
|
||||
#define LUMP_LEAFS 8
|
||||
#define LUMP_LEAFFACES 9
|
||||
#define LUMP_LEAFBRUSHES 10
|
||||
#define LUMP_EDGES 11
|
||||
#define LUMP_SURFEDGES 12
|
||||
#define LUMP_MODELS 13
|
||||
#define LUMP_BRUSHES 14
|
||||
#define LUMP_BRUSHSIDES 15
|
||||
#define LUMP_POP 16
|
||||
#define LUMP_AREAS 17
|
||||
#define LUMP_AREAPORTALS 18
|
||||
#define HEADER_LUMPS 19
|
||||
#define LUMP_ENTITIES 0
|
||||
#define LUMP_PLANES 1
|
||||
#define LUMP_VERTEXES 2
|
||||
#define LUMP_VISIBILITY 3
|
||||
#define LUMP_NODES 4
|
||||
#define LUMP_TEXINFO 5
|
||||
#define LUMP_FACES 6
|
||||
#define LUMP_LIGHTING 7
|
||||
#define LUMP_LEAFS 8
|
||||
#define LUMP_LEAFFACES 9
|
||||
#define LUMP_LEAFBRUSHES 10
|
||||
#define LUMP_EDGES 11
|
||||
#define LUMP_SURFEDGES 12
|
||||
#define LUMP_MODELS 13
|
||||
#define LUMP_BRUSHES 14
|
||||
#define LUMP_BRUSHSIDES 15
|
||||
#define LUMP_POP 16
|
||||
#define LUMP_AREAS 17
|
||||
#define LUMP_AREAPORTALS 18
|
||||
#define HEADER_LUMPS 19
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int ident;
|
||||
int version;
|
||||
lump_t lumps[HEADER_LUMPS];
|
||||
int ident;
|
||||
int version;
|
||||
lump_t lumps[HEADER_LUMPS];
|
||||
} dheader_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float mins[3], maxs[3];
|
||||
float origin[3]; /* for sounds or lights */
|
||||
int headnode;
|
||||
int firstface, numfaces; /* submodels just draw faces */
|
||||
/* without walking the bsp tree */
|
||||
float mins[3], maxs[3];
|
||||
float origin[3]; /* for sounds or lights */
|
||||
int headnode;
|
||||
int firstface, numfaces; /* submodels just draw faces without
|
||||
walking the bsp tree */
|
||||
} dmodel_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float point[3];
|
||||
float point[3];
|
||||
} dvertex_t;
|
||||
|
||||
|
||||
/* 0-2 are axial planes */
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
#define PLANE_X 0
|
||||
#define PLANE_Y 1
|
||||
#define PLANE_Z 2
|
||||
|
||||
/* 3-5 are non-axial planes snapped to the nearest */
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
#define PLANE_ANYX 3
|
||||
#define PLANE_ANYY 4
|
||||
#define PLANE_ANYZ 5
|
||||
|
||||
/* planes (x&~1) and (x&~1)+1 are always opposites */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float normal[3];
|
||||
float dist;
|
||||
int type; /* PLANE_X - PLANE_ANYZ */
|
||||
float normal[3];
|
||||
float dist;
|
||||
int type; /* PLANE_X - PLANE_ANYZ */
|
||||
} dplane_t;
|
||||
|
||||
|
||||
/* contents flags are seperate bits
|
||||
- given brush can contribute multiple content bits
|
||||
- multiple brushes can be in a single leaf */
|
||||
* - given brush can contribute multiple content bits
|
||||
* - multiple brushes can be in a single leaf */
|
||||
|
||||
/* lower bits are stronger, and will eat weaker brushes completely */
|
||||
#define CONTENTS_SOLID 1 /* an eye is never valid in a solid */
|
||||
#define CONTENTS_WINDOW 2 /* translucent, but not watery */
|
||||
#define CONTENTS_AUX 4
|
||||
#define CONTENTS_LAVA 8
|
||||
#define CONTENTS_SLIME 16
|
||||
#define CONTENTS_WATER 32
|
||||
#define CONTENTS_MIST 64
|
||||
#define LAST_VISIBLE_CONTENTS 64
|
||||
#define CONTENTS_SOLID 1 /* an eye is never valid in a solid */
|
||||
#define CONTENTS_WINDOW 2 /* translucent, but not watery */
|
||||
#define CONTENTS_AUX 4
|
||||
#define CONTENTS_LAVA 8
|
||||
#define CONTENTS_SLIME 16
|
||||
#define CONTENTS_WATER 32
|
||||
#define CONTENTS_MIST 64
|
||||
#define LAST_VISIBLE_CONTENTS 64
|
||||
|
||||
/* remaining contents are non-visible, and don't eat brushes */
|
||||
#define CONTENTS_AREAPORTAL 0x8000
|
||||
#define CONTENTS_AREAPORTAL 0x8000
|
||||
|
||||
#define CONTENTS_PLAYERCLIP 0x10000
|
||||
#define CONTENTS_MONSTERCLIP 0x20000
|
||||
#define CONTENTS_PLAYERCLIP 0x10000
|
||||
#define CONTENTS_MONSTERCLIP 0x20000
|
||||
|
||||
/* currents can be added to any other contents, and may be mixed */
|
||||
#define CONTENTS_CURRENT_0 0x40000
|
||||
#define CONTENTS_CURRENT_90 0x80000
|
||||
#define CONTENTS_CURRENT_180 0x100000
|
||||
#define CONTENTS_CURRENT_270 0x200000
|
||||
#define CONTENTS_CURRENT_UP 0x400000
|
||||
#define CONTENTS_CURRENT_DOWN 0x800000
|
||||
#define CONTENTS_CURRENT_0 0x40000
|
||||
#define CONTENTS_CURRENT_90 0x80000
|
||||
#define CONTENTS_CURRENT_180 0x100000
|
||||
#define CONTENTS_CURRENT_270 0x200000
|
||||
#define CONTENTS_CURRENT_UP 0x400000
|
||||
#define CONTENTS_CURRENT_DOWN 0x800000
|
||||
|
||||
#define CONTENTS_ORIGIN 0x1000000 /* removed before bsping an entity */
|
||||
#define CONTENTS_ORIGIN 0x1000000 /* removed before bsping an entity */
|
||||
|
||||
#define CONTENTS_MONSTER 0x2000000 /* should never be on a brush, only in game */
|
||||
#define CONTENTS_DEADMONSTER 0x4000000
|
||||
#define CONTENTS_DETAIL 0x8000000 /* brushes to be added after vis leafs */
|
||||
#define CONTENTS_TRANSLUCENT 0x10000000 /* auto set if any surface has trans */
|
||||
#define CONTENTS_LADDER 0x20000000
|
||||
#define CONTENTS_MONSTER 0x2000000 /* should never be on a brush, only in game */
|
||||
#define CONTENTS_DEADMONSTER 0x4000000
|
||||
#define CONTENTS_DETAIL 0x8000000 /* brushes to be added after vis leafs */
|
||||
#define CONTENTS_TRANSLUCENT 0x10000000 /* auto set if any surface has trans */
|
||||
#define CONTENTS_LADDER 0x20000000
|
||||
|
||||
#define SURF_LIGHT 0x1 /* value will hold the light strength */
|
||||
#define SURF_LIGHT 0x1 /* value will hold the light strength */
|
||||
|
||||
#define SURF_SLICK 0x2 /* effects game physics */
|
||||
#define SURF_SLICK 0x2 /* effects game physics */
|
||||
|
||||
#define SURF_SKY 0x4 /* don't draw, but add to skybox */
|
||||
#define SURF_WARP 0x8 /* turbulent water warp */
|
||||
#define SURF_TRANS33 0x10
|
||||
#define SURF_TRANS66 0x20
|
||||
#define SURF_FLOWING 0x40 /* scroll towards angle */
|
||||
#define SURF_NODRAW 0x80 /* don't bother referencing the texture */
|
||||
#define SURF_SKY 0x4 /* don't draw, but add to skybox */
|
||||
#define SURF_WARP 0x8 /* turbulent water warp */
|
||||
#define SURF_TRANS33 0x10
|
||||
#define SURF_TRANS66 0x20
|
||||
#define SURF_FLOWING 0x40 /* scroll towards angle */
|
||||
#define SURF_NODRAW 0x80 /* don't bother referencing the texture */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int planenum;
|
||||
int children[2]; /* negative numbers are -(leafs+1), not nodes */
|
||||
short mins[3]; /* for frustom culling */
|
||||
short maxs[3];
|
||||
unsigned short firstface;
|
||||
unsigned short numfaces; /* counting both sides */
|
||||
int planenum;
|
||||
int children[2]; /* negative numbers are -(leafs+1), not nodes */
|
||||
short mins[3]; /* for frustom culling */
|
||||
short maxs[3];
|
||||
unsigned short firstface;
|
||||
unsigned short numfaces; /* counting both sides */
|
||||
} dnode_t;
|
||||
|
||||
typedef struct texinfo_s
|
||||
{
|
||||
float vecs[2][4]; /* [s/t][xyz offset] */
|
||||
int flags; /* miptex flags + overrides */
|
||||
int value; /* light emission, etc */
|
||||
char texture[32]; /* texture name (textures*.wal) */
|
||||
int nexttexinfo; /* for animations, -1 = end of chain */
|
||||
float vecs[2][4]; /* [s/t][xyz offset] */
|
||||
int flags; /* miptex flags + overrides light emission, etc */
|
||||
int value;
|
||||
char texture[32]; /* texture name (textures*.wal) */
|
||||
int nexttexinfo; /* for animations, -1 = end of chain */
|
||||
} texinfo_t;
|
||||
|
||||
/* note that edge 0 is never used, because negative edge nums are used for */
|
||||
/* counterclockwise use of the edge in a face */
|
||||
/* note that edge 0 is never used, because negative edge
|
||||
nums are used for counterclockwise use of the edge in
|
||||
a face */
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2]; /* vertex numbers */
|
||||
unsigned short v[2]; /* vertex numbers */
|
||||
} dedge_t;
|
||||
|
||||
#define MAXLIGHTMAPS 4
|
||||
#define MAXLIGHTMAPS 4
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum;
|
||||
short side;
|
||||
unsigned short planenum;
|
||||
short side;
|
||||
|
||||
int firstedge; /* we must support > 64k edges */
|
||||
short numedges;
|
||||
short texinfo;
|
||||
int firstedge; /* we must support > 64k edges */
|
||||
short numedges;
|
||||
short texinfo;
|
||||
|
||||
/* lighting info */
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int lightofs; /* start of [numstyles*surfsize] samples */
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int lightofs; /* start of [numstyles*surfsize] samples */
|
||||
} dface_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int contents; /* OR of all brushes (not needed?) */
|
||||
int contents; /* OR of all brushes (not needed?) */
|
||||
|
||||
short cluster;
|
||||
short area;
|
||||
short cluster;
|
||||
short area;
|
||||
|
||||
short mins[3]; /* for frustum culling */
|
||||
short maxs[3];
|
||||
short mins[3]; /* for frustum culling */
|
||||
short maxs[3];
|
||||
|
||||
unsigned short firstleafface;
|
||||
unsigned short numleaffaces;
|
||||
unsigned short firstleafface;
|
||||
unsigned short numleaffaces;
|
||||
|
||||
unsigned short firstleafbrush;
|
||||
unsigned short numleafbrushes;
|
||||
unsigned short firstleafbrush;
|
||||
unsigned short numleafbrushes;
|
||||
} dleaf_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short planenum; /* facing out of the leaf */
|
||||
short texinfo;
|
||||
unsigned short planenum; /* facing out of the leaf */
|
||||
short texinfo;
|
||||
} dbrushside_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int firstside;
|
||||
int numsides;
|
||||
int contents;
|
||||
int firstside;
|
||||
int numsides;
|
||||
int contents;
|
||||
} dbrush_t;
|
||||
|
||||
#define ANGLE_UP -1
|
||||
#define ANGLE_DOWN -2
|
||||
#define ANGLE_UP -1
|
||||
#define ANGLE_DOWN -2
|
||||
|
||||
/* the visibility lump consists of a header with a count, then */
|
||||
/* byte offsets for the PVS and PHS of each cluster, then the raw */
|
||||
/* compressed bit vectors */
|
||||
#define DVIS_PVS 0
|
||||
#define DVIS_PHS 1
|
||||
/* the visibility lump consists of a header with a count, then
|
||||
* byte offsets for the PVS and PHS of each cluster, then the raw
|
||||
* compressed bit vectors */
|
||||
#define DVIS_PVS 0
|
||||
#define DVIS_PHS 1
|
||||
typedef struct
|
||||
{
|
||||
int numclusters;
|
||||
int bitofs[8][2]; /* bitofs[numclusters][2] */
|
||||
int numclusters;
|
||||
int bitofs[8][2]; /* bitofs[numclusters][2] */
|
||||
} dvis_t;
|
||||
|
||||
/* each area has a list of portals that lead into other areas */
|
||||
/* when portals are closed, other areas may not be visible or */
|
||||
/* hearable even if the vis info says that it should be */
|
||||
/* each area has a list of portals that lead into other areas
|
||||
* when portals are closed, other areas may not be visible or
|
||||
* hearable even if the vis info says that it should be */
|
||||
typedef struct
|
||||
{
|
||||
int portalnum;
|
||||
int otherarea;
|
||||
int portalnum;
|
||||
int otherarea;
|
||||
} dareaportal_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int numareaportals;
|
||||
int firstareaportal;
|
||||
int numareaportals;
|
||||
int firstareaportal;
|
||||
} darea_t;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,6 +27,6 @@
|
|||
#ifndef UNIX_GLOB_H
|
||||
#define UNIX_GLOB_H
|
||||
|
||||
int glob_match ( char *pattern, char *text );
|
||||
int glob_match(char *pattern, char *text);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -55,14 +55,12 @@ typedef enum {false, true} qboolean;
|
|||
#define MAX_QPATH 64 /* max length of a quake game pathname */
|
||||
|
||||
#ifdef _WIN32
|
||||
#define MAX_OSPATH 256 /* max length of a filesystem pathname */
|
||||
#define MAX_OSPATH 256 /* max length of a filesystem pathname */
|
||||
#else
|
||||
#define MAX_OSPATH 128 /* max length of a filesystem pathname */
|
||||
#define MAX_OSPATH 128 /* max length of a filesystem pathname */
|
||||
#endif
|
||||
|
||||
/* */
|
||||
/* per-level limits */
|
||||
/* */
|
||||
#define MAX_CLIENTS 256 /* absolute limit */
|
||||
#define MAX_EDICTS 1024 /* must change protocol to increase more */
|
||||
#define MAX_LIGHTSTYLES 256
|
||||
|
@ -128,10 +126,12 @@ extern vec3_t vec3_origin;
|
|||
#define Q_ftol(f) (long)(f)
|
||||
|
||||
#define DotProduct(x, y) (x[0] * y[0] + x[1] * y[1] + x[2] * y[2])
|
||||
#define VectorSubtract(a, b, c) (c[0] = a[0] - b[0], c[1] = a[1] - b[1], c[2] = \
|
||||
a[2] - b[2])
|
||||
#define VectorAdd(a, b, c) (c[0] = a[0] + b[0], c[1] = a[1] + b[1], c[2] = \
|
||||
a[2] + b[2])
|
||||
#define VectorSubtract(a, b, c) \
|
||||
(c[0] = a[0] - b[0], c[1] = a[1] - b[1], c[2] = \
|
||||
a[2] - b[2])
|
||||
#define VectorAdd(a, b, c) \
|
||||
(c[0] = a[0] + b[0], c[1] = a[1] + b[1], c[2] = \
|
||||
a[2] + b[2])
|
||||
#define VectorCopy(a, b) (b[0] = a[0], b[1] = a[1], b[2] = a[2])
|
||||
#define VectorClear(a) (a[0] = a[1] = a[2] = 0)
|
||||
#define VectorNegate(a, b) (b[0] = -a[0], b[1] = -a[1], b[2] = -a[2])
|
||||
|
@ -183,8 +183,10 @@ float LerpAngle(float a1, float a2, float frac);
|
|||
|
||||
void ProjectPointOnPlane(vec3_t dst, const vec3_t p, const vec3_t normal);
|
||||
void PerpendicularVector(vec3_t dst, const vec3_t src);
|
||||
void RotatePointAroundVector(vec3_t dst, const vec3_t dir,
|
||||
const vec3_t point, float degrees);
|
||||
void RotatePointAroundVector(vec3_t dst,
|
||||
const vec3_t dir,
|
||||
const vec3_t point,
|
||||
float degrees);
|
||||
|
||||
/* ============================================= */
|
||||
|
||||
|
@ -201,7 +203,7 @@ void Com_sprintf(char *dest, int size, char *fmt, ...);
|
|||
|
||||
void Com_PageInMemory(byte *buffer, int size);
|
||||
|
||||
char *strlwr ( char *s );
|
||||
char *strlwr(char *s);
|
||||
|
||||
/* ============================================= */
|
||||
|
||||
|
@ -237,7 +239,7 @@ qboolean Info_Validate(char *s);
|
|||
/* ============================================= */
|
||||
|
||||
/* Random number generator */
|
||||
int randk(void);
|
||||
int randk(void);
|
||||
float frandk(void);
|
||||
float crandk(void);
|
||||
void randk_seed(void);
|
||||
|
@ -364,19 +366,23 @@ typedef struct cvar_s
|
|||
/* content masks */
|
||||
#define MASK_ALL (-1)
|
||||
#define MASK_SOLID (CONTENTS_SOLID | CONTENTS_WINDOW)
|
||||
#define MASK_PLAYERSOLID (CONTENTS_SOLID | CONTENTS_PLAYERCLIP | \
|
||||
CONTENTS_WINDOW | CONTENTS_MONSTER)
|
||||
#define MASK_PLAYERSOLID \
|
||||
(CONTENTS_SOLID | CONTENTS_PLAYERCLIP | \
|
||||
CONTENTS_WINDOW | CONTENTS_MONSTER)
|
||||
#define MASK_DEADSOLID (CONTENTS_SOLID | CONTENTS_PLAYERCLIP | CONTENTS_WINDOW)
|
||||
#define MASK_MONSTERSOLID (CONTENTS_SOLID | CONTENTS_MONSTERCLIP | \
|
||||
CONTENTS_WINDOW | CONTENTS_MONSTER)
|
||||
#define MASK_MONSTERSOLID \
|
||||
(CONTENTS_SOLID | CONTENTS_MONSTERCLIP | \
|
||||
CONTENTS_WINDOW | CONTENTS_MONSTER)
|
||||
#define MASK_WATER (CONTENTS_WATER | CONTENTS_LAVA | CONTENTS_SLIME)
|
||||
#define MASK_OPAQUE (CONTENTS_SOLID | CONTENTS_SLIME | CONTENTS_LAVA)
|
||||
#define MASK_SHOT (CONTENTS_SOLID | CONTENTS_MONSTER | CONTENTS_WINDOW | \
|
||||
CONTENTS_DEADMONSTER)
|
||||
#define MASK_CURRENT (CONTENTS_CURRENT_0 | CONTENTS_CURRENT_90 | \
|
||||
CONTENTS_CURRENT_180 | CONTENTS_CURRENT_270 | \
|
||||
CONTENTS_CURRENT_UP | \
|
||||
CONTENTS_CURRENT_DOWN)
|
||||
#define MASK_SHOT \
|
||||
(CONTENTS_SOLID | CONTENTS_MONSTER | CONTENTS_WINDOW | \
|
||||
CONTENTS_DEADMONSTER)
|
||||
#define MASK_CURRENT \
|
||||
(CONTENTS_CURRENT_0 | CONTENTS_CURRENT_90 | \
|
||||
CONTENTS_CURRENT_180 | CONTENTS_CURRENT_270 | \
|
||||
CONTENTS_CURRENT_UP | \
|
||||
CONTENTS_CURRENT_DOWN)
|
||||
|
||||
/* gi.BoxEdicts() can return a list of either solid or trigger entities */
|
||||
#define AREA_SOLID 1
|
||||
|
@ -458,10 +464,10 @@ typedef enum
|
|||
#define PMF_NO_PREDICTION 64 /* temporarily disables prediction (used for grappling hook) */
|
||||
|
||||
/* this structure needs to be communicated bit-accurate/
|
||||
from the server to the client to guarantee that
|
||||
prediction stays in sync, so no floats are used.
|
||||
if any part of the game code modifies this struct, it
|
||||
will result in a prediction error of some degree. */
|
||||
* from the server to the client to guarantee that
|
||||
* prediction stays in sync, so no floats are used.
|
||||
* if any part of the game code modifies this struct, it
|
||||
* will result in a prediction error of some degree. */
|
||||
typedef struct
|
||||
{
|
||||
pmtype_t pm_type;
|
||||
|
@ -472,7 +478,7 @@ typedef struct
|
|||
byte pm_time; /* each unit = 8 ms */
|
||||
short gravity;
|
||||
short delta_angles[3]; /* add to command angles to get view direction
|
||||
changed by spawns, rotating objects, and teleporters */
|
||||
* changed by spawns, rotating objects, and teleporters */
|
||||
} pmove_state_t;
|
||||
|
||||
/* button bits */
|
||||
|
@ -520,10 +526,10 @@ typedef struct
|
|||
} pmove_t;
|
||||
|
||||
/* entity_state_t->effects
|
||||
Effects are things handled on the client side (lights, particles,
|
||||
frame animations) that happen constantly on the given entity.
|
||||
An entity that has effects will be sent to the client even if
|
||||
it has a zero index model. */
|
||||
* Effects are things handled on the client side (lights, particles,
|
||||
* frame animations) that happen constantly on the given entity.
|
||||
* An entity that has effects will be sent to the client even if
|
||||
* it has a zero index model. */
|
||||
#define EF_ROTATE 0x00000001 /* rotate (bonus items) */
|
||||
#define EF_GIB 0x00000002 /* leave a trail */
|
||||
#define EF_BLASTER 0x00000008 /* redlight + trail */
|
||||
|
@ -844,9 +850,9 @@ typedef struct
|
|||
extern vec3_t monster_flash_offset[];
|
||||
|
||||
/* Temp entity events are for things that happen
|
||||
at a location seperate from any existing entity.
|
||||
Temporary entity messages are explicitly constructed
|
||||
and broadcast. */
|
||||
* at a location seperate from any existing entity.
|
||||
* Temporary entity messages are explicitly constructed
|
||||
* and broadcast. */
|
||||
typedef enum
|
||||
{
|
||||
TE_GUNSHOT,
|
||||
|
@ -916,9 +922,9 @@ typedef enum
|
|||
#define SPLASH_BLOOD 6
|
||||
|
||||
/* sound channels:
|
||||
channel 0 never willingly overrides
|
||||
other channels (1-7) allways override
|
||||
a playing sound on that channel */
|
||||
* channel 0 never willingly overrides
|
||||
* other channels (1-7) allways override
|
||||
* a playing sound on that channel */
|
||||
#define CHAN_AUTO 0
|
||||
#define CHAN_WEAPON 1
|
||||
#define CHAN_VOICE 2
|
||||
|
@ -993,8 +999,8 @@ typedef enum
|
|||
#define SHORT2ANGLE(x) ((x) * (360.0 / 65536))
|
||||
|
||||
/* config strings are a general means of communication from
|
||||
the server to all connected clients. Each config string
|
||||
can be at most MAX_QPATH characters. */
|
||||
* the server to all connected clients. Each config string
|
||||
* can be at most MAX_QPATH characters. */
|
||||
#define CS_NAME 0
|
||||
#define CS_CDTRACK 1
|
||||
#define CS_SKY 2
|
||||
|
@ -1018,9 +1024,9 @@ typedef enum
|
|||
/* ============================================== */
|
||||
|
||||
/* entity_state_t->event values
|
||||
entity events are for effects that take place reletive
|
||||
to an existing entities origin. Very network efficient.
|
||||
All muzzle flashes really should be converted to events... */
|
||||
* entity events are for effects that take place reletive
|
||||
* to an existing entities origin. Very network efficient.
|
||||
* All muzzle flashes really should be converted to events... */
|
||||
typedef enum
|
||||
{
|
||||
EV_NONE,
|
||||
|
@ -1034,8 +1040,8 @@ typedef enum
|
|||
} entity_event_t;
|
||||
|
||||
/* entity_state_t is the information conveyed from the server
|
||||
in an update message about entities that the client will
|
||||
need to render in some way */
|
||||
* in an update message about entities that the client will
|
||||
* need to render in some way */
|
||||
typedef struct entity_state_s
|
||||
{
|
||||
int number; /* edict index */
|
||||
|
@ -1061,9 +1067,9 @@ typedef struct entity_state_s
|
|||
/* ============================================== */
|
||||
|
||||
/* player_state_t is the information needed in addition to pmove_state_t
|
||||
to rendered a view. There will only be 10 player_state_t sent each second,
|
||||
but the number of pmove_state_t changes will be reletive to client
|
||||
frame rates */
|
||||
* to rendered a view. There will only be 10 player_state_t sent each second,
|
||||
* but the number of pmove_state_t changes will be reletive to client
|
||||
* frame rates */
|
||||
typedef struct
|
||||
{
|
||||
pmove_state_t pmove; /* for prediction */
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
#ifdef USE_OPENAL
|
||||
|
||||
#ifndef _QAL_API_H_
|
||||
#define _QAL_API_H_
|
||||
#define _QAL_API_H_
|
||||
|
||||
#include <AL/al.h>
|
||||
#include <AL/efx.h>
|
||||
#include <AL/al.h>
|
||||
#include <AL/efx.h>
|
||||
|
||||
/* Function pointers used to tie
|
||||
the qal API to the OpenAL API */
|
||||
* the qal API to the OpenAL API */
|
||||
extern LPALENABLE qalEnable;
|
||||
extern LPALDISABLE qalDisable;
|
||||
extern LPALISENABLED qalIsEnabled;
|
||||
|
|
|
@ -28,13 +28,13 @@
|
|||
#ifndef UNIX_UNIX_H
|
||||
#define UNIX_UNIX_H
|
||||
|
||||
typedef void ( *Key_Event_fp_t )( int key, qboolean down );
|
||||
extern void ( *IN_Update_fp )( void );
|
||||
typedef void (*Key_Event_fp_t)(int key, qboolean down);
|
||||
extern void (*IN_Update_fp)(void);
|
||||
|
||||
typedef struct in_state
|
||||
{
|
||||
/* Pointers to functions back in client, set by vid_so */
|
||||
void ( *IN_CenterView_fp )( void );
|
||||
void (*IN_CenterView_fp)(void);
|
||||
Key_Event_fp_t Key_Event_fp;
|
||||
vec_t *viewangles;
|
||||
int *in_strafe_state;
|
||||
|
|
Loading…
Reference in a new issue