Remove GPL-licensed headers.

This commit is contained in:
Andrey Akhmichin 2020-04-22 13:12:23 +05:00
parent 6af5c3f472
commit 0aecf06741
11 changed files with 198 additions and 1163 deletions

16
cl_dll/wrect.h Normal file
View File

@ -0,0 +1,16 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#pragma once
#if !defined( WRECTH )
#define WRECTH
typedef struct rect_s
{
int left, right, top, bottom;
} wrect_t;
#endif

View File

@ -1,246 +0,0 @@
/*
bspfile.h - BSP format included q1, hl1 support
Copyright (C) 2010 Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef BSPFILE_H
#define BSPFILE_H
/*
==============================================================================
BRUSH MODELS
.bsp contain level static geometry with including PVS and lightning info
==============================================================================
*/
// header
#define Q1BSP_VERSION 29 // quake1 regular version (beta is 28)
#define HLBSP_VERSION 30 // half-life regular version
#define XTBSP_VERSION 31 // extended lightmaps and expanded clipnodes limit
#define IDEXTRAHEADER (('H'<<24)+('S'<<16)+('A'<<8)+'X') // little-endian "XASH"
#define EXTRA_VERSION 2 // because version 1 was occupied by old versions of XashXT
#define DELUXEMAP_VERSION 1
#define IDDELUXEMAPHEADER (('T'<<24)+('I'<<16)+('L'<<8)+'Q') // little-endian "QLIT"
// worldcraft predefined angles
#define ANGLE_UP -1
#define ANGLE_DOWN -2
// bmodel limits
#define MAX_MAP_HULLS 4 // MAX_HULLS
#define SURF_NOCULL BIT( 0 ) // two-sided polygon (e.g. 'water4b')
#define SURF_PLANEBACK BIT( 1 ) // plane should be negated
#define SURF_DRAWSKY BIT( 2 ) // sky surface
#define SURF_WATERCSG BIT( 3 ) // culled by csg (was SURF_DRAWSPRITE)
#define SURF_DRAWTURB BIT( 4 ) // warp surface
#define SURF_DRAWTILED BIT( 5 ) // face without lighmap
#define SURF_CONVEYOR BIT( 6 ) // scrolled texture (was SURF_DRAWBACKGROUND)
#define SURF_UNDERWATER BIT( 7 ) // caustics
#define SURF_TRANSPARENT BIT( 8 ) // it's a transparent texture (was SURF_DONTWARP)
#define SURF_REFLECT BIT( 31 ) // reflect surface (mirror)
// lightstyle management
#define LM_STYLES 4 // MAXLIGHTMAPS
#define LS_NORMAL 0x00
#define LS_UNUSED 0xFE
#define LS_NONE 0xFF
#define MAX_MAP_MODELS 1024 // can be increased up to 2048 if needed
#define MAX_MAP_BRUSHES 32768 // unsigned short limit
#define MAX_MAP_ENTITIES 8192 // can be increased up to 32768 if needed
#define MAX_MAP_ENTSTRING 0x80000 // 512 kB should be enough
#define MAX_MAP_PLANES 65536 // can be increased without problems
#define MAX_MAP_NODES 32767 // because negative shorts are leafs
#define MAX_MAP_CLIPNODES 32767 // because negative shorts are contents
#define MAX_MAP_LEAFS 32767 // signed short limit
#define MAX_MAP_VERTS 65535 // unsigned short limit
#define MAX_MAP_FACES 65535 // unsigned short limit
#define MAX_MAP_MARKSURFACES 65535 // unsigned short limit
#define MAX_MAP_TEXINFO MAX_MAP_FACES // in theory each face may have personal texinfo
#define MAX_MAP_EDGES 0x100000 // can be increased but not needed
#define MAX_MAP_SURFEDGES 0x200000 // can be increased but not needed
#define MAX_MAP_TEXTURES 2048 // can be increased but not needed
#define MAX_MAP_MIPTEX 0x2000000 // 32 Mb internal textures data
#define MAX_MAP_LIGHTING 0x2000000 // 32 Mb lightmap raw data (can contain deluxemaps)
#define MAX_MAP_VISIBILITY 0x800000 // 8 Mb visdata
// quake lump ordering
#define LUMP_ENTITIES 0
#define LUMP_PLANES 1
#define LUMP_TEXTURES 2 // internal textures
#define LUMP_VERTEXES 3
#define LUMP_VISIBILITY 4
#define LUMP_NODES 5
#define LUMP_TEXINFO 6
#define LUMP_FACES 7
#define LUMP_LIGHTING 8
#define LUMP_CLIPNODES 9
#define LUMP_LEAFS 10
#define LUMP_MARKSURFACES 11
#define LUMP_EDGES 12
#define LUMP_SURFEDGES 13
#define LUMP_MODELS 14 // internal submodels
#define HEADER_LUMPS 15
// version 31
#define LUMP_CLIPNODES2 15 // hull0 goes into LUMP_NODES, hull1 goes into LUMP_CLIPNODES,
#define LUMP_CLIPNODES3 16 // hull2 goes into LUMP_CLIPNODES2, hull3 goes into LUMP_CLIPNODES3
#define HEADER_LUMPS_31 17
#define LUMP_FACES_EXTRADATA 0 // extension of dface_t
#define LUMP_VERTS_EXTRADATA 1 // extension of dvertex_t
#define LUMP_CUBEMAPS 2 // cubemap description
#define EXTRA_LUMPS 8 // g-cont. just for future expansions
// texture flags
#define TEX_SPECIAL BIT( 0 ) // sky or slime, no lightmap or 256 subdivision
// ambient sound types
enum
{
AMBIENT_WATER = 0, // waterfall
AMBIENT_SKY, // wind
AMBIENT_SLIME, // never used in quake
AMBIENT_LAVA, // never used in quake
NUM_AMBIENTS // automatic ambient sounds
};
//
// BSP File Structures
//
typedef struct
{
int fileofs;
int filelen;
} dlump_t;
typedef struct
{
int version;
dlump_t lumps[HEADER_LUMPS];
} dheader_t;
typedef struct
{
int version;
dlump_t lumps[HEADER_LUMPS_31];
} dheader31_t;
typedef struct
{
int id; // must be little endian XASH
int version;
dlump_t lumps[EXTRA_LUMPS];
} dextrahdr_t;
typedef struct
{
vec3_t mins;
vec3_t maxs;
vec3_t origin; // for sounds or lights
int headnode[MAX_MAP_HULLS];
int visleafs; // not including the solid leaf 0
int firstface;
int numfaces;
} dmodel_t;
typedef struct
{
int nummiptex;
int dataofs[4]; // [nummiptex]
} dmiptexlump_t;
typedef struct
{
vec3_t point;
} dvertex_t;
typedef struct
{
vec3_t normal;
float dist;
int type; // PLANE_X - PLANE_ANYZ ?
} dplane_t;
typedef struct
{
int planenum;
short children[2]; // negative numbers are -(leafs + 1), not nodes
short mins[3]; // for sphere culling
short maxs[3];
word firstface;
word numfaces; // counting both sides
} dnode_t;
// leaf 0 is the generic CONTENTS_SOLID leaf, used for all solid areas
// all other leafs need visibility info
typedef struct
{
int contents;
int visofs; // -1 = no visibility info
short mins[3]; // for frustum culling
short maxs[3];
word firstmarksurface;
word nummarksurfaces;
// automatic ambient sounds
byte ambient_level[NUM_AMBIENTS]; // ambient sound level (0 - 255)
} dleaf_t;
typedef struct
{
int planenum;
short children[2]; // negative numbers are contents
} dclipnode_t;
typedef struct
{
float vecs[2][4]; // texmatrix [s/t][xyz offset]
int miptex;
int flags;
} dtexinfo_t;
typedef word dmarkface_t; // leaf marksurfaces indexes
typedef int dsurfedge_t; // map surfedges
// NOTE: that edge 0 is never used, because negative edge nums
// are used for counterclockwise use of the edge in a face
typedef struct
{
word v[2]; // vertex numbers
} dedge_t;
typedef struct
{
word planenum;
short side;
int firstedge; // we must support > 64k edges
short numedges;
short texinfo;
// lighting info
byte styles[LM_STYLES];
int lightofs; // start of [numstyles*surfsize] samples
} dface_t;
#endif//BSPFILE_H

View File

@ -1,59 +1,80 @@
/*
com_model.h - cient model structures
Copyright (C) 2010 Uncle Mike
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
// com_model.h
#pragma once
#ifndef COM_MODEL_H
#if !defined( COM_MODEL_H )
#define COM_MODEL_H
#include "bspfile.h" // we need some declarations from it
#define STUDIO_RENDER 1
#define STUDIO_EVENTS 2
typedef vec_t vec2_t[2];
typedef vec_t vec4_t[4];
#define MAX_CLIENTS 32
#define MAX_EDICTS 900
/*
==============================================================================
#define MAX_MODEL_NAME 64
#define MAX_MAP_HULLS 4
#define MIPLEVELS 4
#define NUM_AMBIENTS 4 // automatic ambient sounds
#define MAXLIGHTMAPS 4
#define PLANE_ANYZ 5
ENGINE MODEL FORMAT
==============================================================================
*/
#define STUDIO_RENDER 1
#define STUDIO_EVENTS 2
#define ALIAS_Z_CLIP_PLANE 5
#define ZISCALE ((float)0x8000)
// flags in finalvert_t.flags
#define ALIAS_LEFT_CLIP 0x0001
#define ALIAS_TOP_CLIP 0x0002
#define ALIAS_RIGHT_CLIP 0x0004
#define ALIAS_BOTTOM_CLIP 0x0008
#define ALIAS_Z_CLIP 0x0010
#define ALIAS_ONSEAM 0x0020
#define ALIAS_XY_CLIP_MASK 0x000F
#define MIPLEVELS 4
#define VERTEXSIZE 7
#define MAXLIGHTMAPS 4
#define NUM_AMBIENTS 4 // automatic ambient sounds
#define ZISCALE ((float)0x8000)
#define CACHE_SIZE 32 // used to align key data structures
// model types
typedef enum
{
mod_bad = -1,
mod_brush,
mod_sprite,
mod_alias,
mod_studio
} modtype_t;
// must match definition in modelgen.h
#ifndef SYNCTYPE_T
#define SYNCTYPE_T
typedef enum
{
ST_SYNC=0,
ST_RAND
} synctype_t;
#endif
typedef struct
{
float mins[3], maxs[3];
float origin[3];
int headnode[MAX_MAP_HULLS];
int visleafs; // not including the solid leaf 0
int firstface, numfaces;
} dmodel_t;
// plane_t structure
typedef struct mplane_s
{
vec3_t normal;
float dist;
byte type; // for fast side tests
byte signbits; // signx + (signy<<1) + (signz<<1)
byte pad[2];
vec3_t normal; // surface normal
float dist; // closest appoach to origin
byte type; // for texture axis selection and fast side tests
byte signbits; // signx + signy<<1 + signz<<1
byte pad[2];
} mplane_t;
typedef struct
@ -70,292 +91,246 @@ typedef struct
typedef struct texture_s
{
char name[16];
unsigned int width, height;
int gl_texturenum;
struct msurface_s *texturechain; // for gl_texsort drawing
int anim_total; // total tenths in sequence ( 0 = no)
int anim_min, anim_max; // time for this frame min <=time< max
struct texture_s *anim_next; // in the animation sequence
struct texture_s *alternate_anims; // bmodels in frame 1 use these
unsigned short fb_texturenum; // auto-luma texturenum
unsigned short dt_texturenum; // detail-texture binding
unsigned int unused[3]; // reserved
unsigned width, height;
int anim_total; // total tenths in sequence ( 0 = no)
int anim_min, anim_max; // time for this frame min <=time< max
struct texture_s *anim_next; // in the animation sequence
struct texture_s *alternate_anims; // bmodels in frame 1 use these
unsigned offsets[MIPLEVELS]; // four mip maps stored
unsigned paloffset;
} texture_t;
typedef struct
{
float vecs[2][4]; // [s/t] unit vectors in world space.
// [i][3] is the s/t offset relative to the origin.
// s or t = dot( 3Dpoint, vecs[i] ) + vecs[i][3]
float mipadjust; // mipmap limits for very small surfaces
texture_t *texture;
int flags; // sky or slime, no lightmap or 256 subdivision
float vecs[2][4]; // [s/t] unit vectors in world space.
// [i][3] is the s/t offset relative to the origin.
// s or t = dot(3Dpoint,vecs[i])+vecs[i][3]
float mipadjust; // ?? mipmap limits for very small surfaces
texture_t *texture;
int flags; // sky or slime, no lightmap or 256 subdivision
} mtexinfo_t;
// 73 bytes per VBO vertex
// FIXME: align to 32 bytes
typedef struct glvert_s
{
vec3_t vertex; // position
vec3_t normal; // normal
vec2_t stcoord; // ST texture coords
vec2_t lmcoord; // ST lightmap coords
vec2_t sccoord; // ST scissor coords (decals only) - for normalmap coords migration
vec3_t tangent; // tangent
vec3_t binormal; // binormal
byte color[4]; // colors per vertex
} glvert_t;
typedef struct glpoly_s
{
struct glpoly_s *next;
struct glpoly_s *chain;
int numverts;
int flags; // for SURF_UNDERWATER
float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2)
} glpoly_t;
typedef struct mnode_s
{
// common with leaf
int contents; // 0, to differentiate from leafs
int visframe; // node needs to be traversed if current
int contents; // 0, to differentiate from leafs
int visframe; // node needs to be traversed if current
short minmaxs[6]; // for bounding box culling
float minmaxs[6]; // for bounding box culling
struct mnode_s *parent;
// node specific
mplane_t *plane;
mplane_t *plane;
struct mnode_s *children[2];
unsigned short firstsurface;
unsigned short numsurfaces;
unsigned short firstsurface;
unsigned short numsurfaces;
} mnode_t;
typedef struct msurface_s msurface_t;
typedef struct decal_s decal_t;
typedef struct decal_s decal_t;
// JAY: Compress this as much as possible
struct decal_s
{
decal_t *pnext; // linked list for each surface
msurface_t *psurface; // Surface id for persistence / unlinking
float dx; // local texture coordinates
float dy; //
float scale; // Pixel scale
decal_t *pnext; // linked list for each surface
msurface_t *psurface; // Surface id for persistence / unlinking
short dx; // Offsets into surface texture (in texture coordinates, so we don't need floats)
short dy;
short texture; // Decal texture
byte flags; // Decal flags FDECAL_*
byte scale; // Pixel scale
byte flags; // Decal flags
short entityIndex; // Entity this is attached to
// Xash3D added
vec3_t position; // location of the decal center in world space.
vec3_t saxis; // direction of the s axis in world space
struct msurfmesh_s *mesh; // decal mesh in local space
int reserved[4]; // for future expansions
};
typedef struct mleaf_s
{
// common with node
int contents;
int visframe; // node needs to be traversed if current
int contents; // wil be a negative contents number
int visframe; // node needs to be traversed if current
float minmaxs[6]; // for bounding box culling
short minmaxs[6]; // for bounding box culling
struct mnode_s *parent;
// leaf specific
byte *compressed_vis;
struct efrag_s *efrags;
msurface_t **firstmarksurface;
int nummarksurfaces;
byte *compressed_pas;
int nummarksurfaces;
int key; // BSP sequence number for leaf's contents
byte ambient_sound_level[NUM_AMBIENTS];
} mleaf_t;
struct msurface_s
{
int visframe; // should be drawn when node is crossed
int visframe; // should be drawn when node is crossed
mplane_t *plane; // pointer to shared plane
int flags; // see SURF_ #defines
int dlightframe; // last frame the surface was checked by an animated light
int dlightbits; // dynamically generated. Indicates if the surface illumination
// is modified by an animated light.
int firstedge; // look up in model->surfedges[], negative numbers
int numedges; // are backwards edges
mplane_t *plane; // pointer to shared plane
int flags; // see SURF_ #defines
short texturemins[2];
short extents[2];
int firstedge; // look up in model->surfedges[], negative numbers
int numedges; // are backwards edges
// surface generation data
struct surfcache_s *cachespots[MIPLEVELS];
int light_s, light_t; // gl lightmap coordinates
short texturemins[2]; // smallest s/t position on the surface.
short extents[2]; // ?? s/t texture size, 1..256 for all non-sky surfaces
glpoly_t *polys; // multiple if warped
struct msurface_s *texturechain;
mtexinfo_t *texinfo;
// lighting info
int dlightframe; // last frame the surface was checked by an animated light
int dlightbits; // dynamically generated. Indicates if the surface illumination
// is modified by an animated light.
int lightmaptexturenum;
byte styles[MAXLIGHTMAPS];
int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
struct msurface_s *lightmapchain; // for new dlights rendering (was cached_dlight)
color24 *samples; // note: this is the actual lightmap data for this surface
mtexinfo_t *texinfo;
// lighting info
byte styles[MAXLIGHTMAPS]; // index into d_lightstylevalue[] for animated lights
// no one surface can be effected by more than 4
// animated lights.
color24 *samples;
decal_t *pdecals;
};
typedef struct msurfmesh_s
typedef struct
{
unsigned short numVerts;
unsigned short numElems; // ~ 20 000 vertex per one surface. Should be enough
unsigned int startVert; // user-variable. may be used for construct world single-VBO
unsigned int startElem; // user-variable. may be used for construct world single-VBO
glvert_t *verts; // vertexes array
unsigned short *elems; // indices
struct msurface_s *surf; // pointer to parent surface. Just for consistency
struct msurfmesh_s *next; // temporary chain of subdivided surfaces
} msurfmesh_t;
// surface extradata stored in cache.data for all brushmodels
typedef struct mextrasurf_s
{
vec3_t mins, maxs;
vec3_t origin; // surface origin
msurfmesh_t *mesh; // VBO\VA ready surface mesh. Not used by engine but can be used by mod-makers
int dlight_s, dlight_t; // gl lightmap coordinates for dynamic lightmaps
int mirrortexturenum; // gl texnum
float mirrormatrix[4][4];
struct mextrasurf_s *mirrorchain; // for gl_texsort drawing
struct mextrasurf_s *detailchain; // for detail textures drawing
color24 *deluxemap; // note: this is the actual deluxemap data for this surface
int reserved[32]; // just for future expansions or mod-makers
} mextrasurf_t;
int planenum;
short children[2]; // negative numbers are contents
} dclipnode_t;
typedef struct hull_s
{
dclipnode_t *clipnodes;
mplane_t *planes;
int firstclipnode;
int lastclipnode;
mplane_t *planes;
int firstclipnode;
int lastclipnode;
vec3_t clip_mins;
vec3_t clip_maxs;
} hull_t;
#ifndef CACHE_USER
#if !defined( CACHE_USER ) && !defined( QUAKEDEF_H )
#define CACHE_USER
typedef struct cache_user_s
{
void *data; // extradata
void *data;
} cache_user_t;
#endif
typedef struct model_s
{
char name[64]; // model name
qboolean needload; // bmodels and sprites don't cache normally
char name[ MAX_MODEL_NAME ];
qboolean needload; // bmodels and sprites don't cache normally
// shared modelinfo
modtype_t type; // model type
int numframes; // sprite's framecount
byte *mempool; // private mempool (was synctype)
int flags; // hl compatibility
modtype_t type;
int numframes;
synctype_t synctype;
int flags;
//
// volume occupied by the model
//
vec3_t mins, maxs; // bounding box at angles '0 0 0'
//
vec3_t mins, maxs;
float radius;
// brush model
int firstmodelsurface;
int nummodelsurfaces;
int numsubmodels;
dmodel_t *submodels; // or studio animations
//
// brush model
//
int firstmodelsurface, nummodelsurfaces;
int numplanes;
mplane_t *planes;
int numsubmodels;
dmodel_t *submodels;
int numleafs; // number of visible leafs, not counting 0
mleaf_t *leafs;
int numplanes;
mplane_t *planes;
int numvertexes;
mvertex_t *vertexes;
int numleafs; // number of visible leafs, not counting 0
struct mleaf_s *leafs;
int numedges;
int numvertexes;
mvertex_t *vertexes;
int numedges;
medge_t *edges;
int numnodes;
int numnodes;
mnode_t *nodes;
int numtexinfo;
int numtexinfo;
mtexinfo_t *texinfo;
int numsurfaces;
int numsurfaces;
msurface_t *surfaces;
int numsurfedges;
int *surfedges;
int numsurfedges;
int *surfedges;
int numclipnodes;
int numclipnodes;
dclipnode_t *clipnodes;
int nummarksurfaces;
int nummarksurfaces;
msurface_t **marksurfaces;
hull_t hulls[MAX_MAP_HULLS];
int numtextures;
texture_t **textures;
int numtextures;
texture_t **textures;
byte *visdata;
color24 *lightdata;
char *entities;
//
// additional model data
//
cache_user_t cache; // only access through Mod_Extradata
} model_t;
typedef vec_t vec4_t[4];
typedef struct alight_s
{
int ambientlight; // clip at 128
int shadelight; // clip at 192 - ambientlight
int ambientlight; // clip at 128
int shadelight; // clip at 192 - ambientlight
vec3_t color;
float *plightvec;
} alight_t;
typedef struct auxvert_s
{
float fv[3]; // viewspace x, y
float fv[3]; // viewspace x, y
} auxvert_t;
#define MAX_SCOREBOARDNAME 32
#define MAX_INFO_STRING 256
#include "custom.h"
#define MAX_INFO_STRING 256
#define MAX_SCOREBOARDNAME 32
typedef struct player_info_s
{
int userid; // User id on server
char userinfo[MAX_INFO_STRING]; // User info string
char name[MAX_SCOREBOARDNAME]; // Name (extracted from userinfo)
int spectator; // Spectator or not, unused
// User id on server
int userid;
// User info string
char userinfo[ MAX_INFO_STRING ];
// Name
char name[ MAX_SCOREBOARDNAME ];
// Spectator or not, unused
int spectator;
int ping;
int packet_loss;
// skin information
char model[64];
char model[MAX_QPATH];
int topcolor;
int bottomcolor;
@ -364,50 +339,12 @@ typedef struct player_info_s
// Gait frame estimation
int gaitsequence;
float gaitframe;
float gaityaw;
vec3_t prevgaitorigin;
float gaitframe;
float gaityaw;
vec3_t prevgaitorigin;
customization_t customdata;
customization_t customdata;
} player_info_t;
//
// sprite representation in memory
//
typedef enum { SPR_SINGLE = 0, SPR_GROUP, SPR_ANGLED } spriteframetype_t;
#endif // COM_MODEL_H
typedef struct mspriteframe_s
{
int width;
int height;
float up, down, left, right;
int gl_texturenum;
} mspriteframe_t;
typedef struct
{
int numframes;
float *intervals;
mspriteframe_t *frames[1];
} mspritegroup_t;
typedef struct
{
spriteframetype_t type;
mspriteframe_t *frameptr;
} mspriteframedesc_t;
typedef struct
{
short type;
short texFormat;
int maxwidth;
int maxheight;
int numframes;
int radius;
int facecull;
int synctype;
mspriteframedesc_t frames[1];
} msprite_t;
#endif//COM_MODEL_H

View File

@ -1,49 +0,0 @@
/*
gameinfo.h - current game info
Copyright (C) 2010 Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef GAMEINFO_H
#define GAMEINFO_H
#define GFL_NOMODELS (1<<0)
/*
========================================================================
GAMEINFO stuff
internal shared gameinfo structure (readonly for engine parts)
========================================================================
*/
typedef struct
{
// filesystem info
char gamefolder[64]; // used for change game '-game x'
char startmap[64]; // map to start singleplayer game
char trainmap[64]; // map to start hazard course (if specified)
char title[64]; // Game Main Title
char version[14]; // game version (optional)
short flags; // game flags
// about mod info
char game_url[256]; // link to a developer's site
char update_url[256]; // link to updates page
char type[64]; // single, toolkit, multiplayer etc
char date[64];
char size[64]; // displayed mod size
int gamemode;
} GAMEINFO;
#endif//GAMEINFO_H

View File

@ -1,29 +0,0 @@
/*
lightstyle.h - lighstyle description
Copyright (C) 2011 Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef LIGHTSTYLE_H
#define LIGHTSTYLE_H
typedef struct
{
char pattern[256];
float map[256];
int length;
float value;
qboolean interp; // allow to interpolate this lightstyle
float time; // local time is gurantee what new style begins from the start, not mid or end of the sequence
} lightstyle_t;
#endif//LIGHTSTYLE_H

View File

@ -1,261 +0,0 @@
/*
render_api.h - Xash3D extension for client interface
Copyright (C) 2011 Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef RENDER_API_H
#define RENDER_API_H
#include "lightstyle.h"
#include "dlight.h"
// changes for version 28
// replace decal_t from software declaration to hardware (matched to normal HL)
// mextrasurf_t->increased limit of reserved fields (up from 7 to 32)
// replace R_StoreEfrags with him extended version
// formed group for BSP decal manipulating
// move misc functions at end of the interface
// added new export for clearing studio decals
#define CL_RENDER_INTERFACE_VERSION 35
#define MAX_STUDIO_DECALS 4096 // + unused space of BSP decals
#define SURF_INFO( surf, mod ) ((mextrasurf_t *)mod->cache.data + (surf - mod->surfaces))
#define INFO_SURF( surf, mod ) (mod->surfaces + (surf - (mextrasurf_t *)mod->cache.data))
// render info parms
#define PARM_TEX_WIDTH 1 // all parms with prefix 'TEX_' receive arg as texnum
#define PARM_TEX_HEIGHT 2 // otherwise it's not used
#define PARM_TEX_SRC_WIDTH 3
#define PARM_TEX_SRC_HEIGHT 4
#define PARM_TEX_SKYBOX 5 // second arg as skybox ordering num
#define PARM_TEX_SKYTEXNUM 6 // skytexturenum for quake sky
#define PARM_TEX_LIGHTMAP 7 // second arg as number 0 - 128
#define PARM_TEX_TARGET 8
#define PARM_TEX_TEXNUM 9
#define PARM_TEX_FLAGS 10
#define PARM_TEX_TYPE 11
#define PARM_TEX_CACHEFRAME 12 // compare with worldmodel->needload
#define PARM_TEX_GLFORMAT 13 // get a texture GL-format
// reserved
#define PARM_WORLD_VERSION 16 // return the version of bsp
#define PARM_SKY_SPHERE 17 // sky is quake sphere ?
#define PARM_MAP_HAS_MIRRORS 18 // current map has mirorrs
#define PARM_MAP_HAS_DELUXE 19 // map has deluxedata
#define PARM_MAX_ENTITIES 20
#define PARM_WIDESCREEN 21
#define PARM_FULLSCREEN 22
#define PARM_SCREEN_WIDTH 23
#define PARM_SCREEN_HEIGHT 24
#define PARM_CLIENT_INGAME 25
#define PARM_FEATURES 26 // same as movevars->features
#define PARM_ACTIVE_TMU 27 // for debug
#define PARM_CACHEFRAME 28
#define PARM_MAX_IMAGE_UNITS 29
#define PARM_CLIENT_ACTIVE 30
#define PARM_REBUILD_GAMMA 31 // if true lightmaps rebuilding for gamma change
enum
{
// skybox ordering
SKYBOX_RIGHT = 0,
SKYBOX_BACK,
SKYBOX_LEFT,
SKYBOX_FORWARD,
SKYBOX_UP,
SKYBOX_DOWN,
};
typedef enum
{
TEX_INVALID = 0, // free slot
TEX_SYSTEM, // generated by engine
TEX_NOMIP, // hud pics, menu etc
TEX_BRUSH, // a map texture
TEX_SPRITE, // sprite frames
TEX_STUDIO, // studio skins
TEX_LIGHTMAP, // lightmap textures
TEX_DECAL, // decals
TEX_VGUI, // vgui fonts or images
TEX_CUBEMAP, // cubemap textures (sky)
TEX_DETAIL, // detail textures
TEX_REMAP, // local copy of remap texture
TEX_SCREENCOPY, // keep screen copy e.g. for mirror
TEX_CUSTOM, // user created texture
TEX_DEPTHMAP // shadowmap texture
} texType_t;
typedef enum
{
TF_NEAREST = (1<<0), // disable texfilter
TF_KEEP_RGBDATA = (1<<1), // some images keep source
TF_NOFLIP_TGA = (1<<2), // Steam background completely ignore tga attribute 0x20
TF_KEEP_8BIT = (1<<3), // keep original 8-bit image (if present)
TF_NOPICMIP = (1<<4), // ignore r_picmip resample rules
TF_UNCOMPRESSED = (1<<5), // don't compress texture in video memory
TF_CUBEMAP = (1<<6), // it's cubemap texture
TF_DEPTHMAP = (1<<7), // custom texture filter used
TF_INTENSITY = (1<<8), // monochrome intensity image
TF_LUMINANCE = (1<<9), // force image to grayscale
TF_SKYSIDE = (1<<10), // this is a part of skybox
TF_CLAMP = (1<<11), // clamp texcoords to [0..1] range
TF_NOMIPMAP = (1<<12), // don't build mips for this image
TF_HAS_LUMA = (1<<13), // sets by GL_UploadTexture
TF_MAKELUMA = (1<<14), // create luma from quake texture (only q1 textures contain luma-pixels)
TF_NORMALMAP = (1<<15), // is a normalmap
TF_HAS_ALPHA = (1<<16), // image has alpha (used only for GL_CreateTexture)
TF_FORCE_COLOR = (1<<17), // force upload monochrome textures as RGB (detail textures)
TF_TEXTURE_1D = (1<<18), // this is GL_TEXTURE_1D
TF_BORDER = (1<<19), // zero clamp for projected textures
TF_TEXTURE_3D = (1<<20), // this is GL_TEXTURE_3D
TF_STATIC = (1<<21), // a marker for purge mechanism (not used by engine)
TF_TEXTURE_RECTANGLE= (1<<22), // this is GL_TEXTURE_RECTANGLE
TF_ALPHA_BORDER = (1<<23), // clamp to (0,0,0,255) (probably no difference)
TF_IMAGE_PROGRAM = (1<<24), // enable image program support like in Doom3
TF_ALPHACONTRAST = (1<<25), // special texture flags for internal usage
TF_FLOAT = (1<<26), // float textures
TF_NOCOMPARE = (1<<27), // disable comparing for depth textures
TF_FLOATDATA = (1<<28), // incoming dataType has type GL_FLOAT
} texFlags_t;
typedef struct beam_s BEAM;
typedef struct particle_s particle_t;
// 12 bytes here
typedef struct modelstate_s
{
short sequence;
short frame; // 10 bits multiple by 4, should be enough
byte blending[2];
byte controller[4];
byte body;
byte skin;
} modelstate_t;
typedef struct decallist_s
{
vec3_t position;
char name[64];
short entityIndex;
byte depth;
byte flags;
float scale;
// this is the surface plane that we hit so that
// we can move certain decals across
// transitions if they hit similar geometry
vec3_t impactPlaneNormal;
modelstate_t studio_state; // studio decals only
} decallist_t;
typedef struct render_api_s
{
// Get renderer info (doesn't changes engine state at all)
int (*RenderGetParm)( int parm, int arg ); // generic
void (*GetDetailScaleForTexture)( int texture, float *xScale, float *yScale );
void (*GetExtraParmsForTexture)( int texture, byte *red, byte *green, byte *blue, byte *alpha );
lightstyle_t* (*GetLightStyle)( int number );
dlight_t* (*GetDynamicLight)( int number );
dlight_t* (*GetEntityLight)( int number );
byte (*TextureToTexGamma)( byte color ); // software gamma support
void (*GetBeamChains)( BEAM ***active_beams, BEAM ***free_beams, particle_t ***free_trails );
// Set renderer info (tell engine about changes)
void (*R_SetCurrentEntity)( struct cl_entity_s *ent ); // tell engine about both currententity and currentmodel
void (*R_SetCurrentModel)( struct model_s *mod ); // change currentmodel but leave currententity unchanged
void (*GL_SetWorldviewProjectionMatrix)( const float *glmatrix ); // update viewprojection matrix (tracers uses it)
void (*R_StoreEfrags)( struct efrag_s **ppefrag, int framecount );// store efrags for static entities
// Texture tools
int (*GL_FindTexture)( const char *name );
const char* (*GL_TextureName)( unsigned int texnum );
const byte* (*GL_TextureData)( unsigned int texnum ); // may be NULL
int (*GL_LoadTexture)( const char *name, const byte *buf, size_t size, int flags );
int (*GL_CreateTexture)( const char *name, int width, int height, const void *buffer, int flags );
void (*GL_SetTextureType)( unsigned int texnum, unsigned int type );
void (*GL_TextureCacheFrame)( unsigned int texnum );
void (*GL_FreeTexture)( unsigned int texnum );
// Decals manipulating (draw & remove)
void (*DrawSingleDecal)( struct decal_s *pDecal, struct msurface_s *fa );
float *(*R_DecalSetupVerts)( struct decal_s *pDecal, struct msurface_s *surf, int texture, int *outCount );
void (*R_EntityRemoveDecals)( struct model_s *mod ); // remove all the decals from specified entity (BSP only)
// AVIkit support
void *(*AVI_LoadVideo)( const char *filename, int ignore_hwgamma );
int (*AVI_GetVideoInfo)( void *Avi, long *xres, long *yres, float *duration );
long (*AVI_GetVideoFrameNumber)( void *Avi, float time );
byte *(*AVI_GetVideoFrame)( void *Avi, long frame );
void (*AVI_UploadRawFrame)( int texture, int cols, int rows, int width, int height, const byte *data );
void (*AVI_FreeVideo)( void *Avi );
int (*AVI_IsActive)( void *Avi );
// glState related calls (must use this instead of normal gl-calls to prevent de-synchornize local states between engine and the client)
void (*GL_Bind)( int tmu, unsigned int texnum );
void (*GL_SelectTexture)( int tmu );
void (*GL_LoadTextureMatrix)( const float *glmatrix );
void (*GL_TexMatrixIdentity)( void );
void (*GL_CleanUpTextureUnits)( int last ); // pass 0 for clear all the texture units
void (*GL_TexGen)( unsigned int coord, unsigned int mode );
void (*GL_TextureTarget)( unsigned int target ); // change texture unit mode without bind texture
void (*GL_TexCoordArrayMode)( unsigned int texmode );
void (*GL_Reserved0)( void ); // for potential interface expansion without broken compatibility
void (*GL_Reserved1)( void );
void (*GL_Reserved2)( void );
void (*GL_Reserved3)( void );
// Misc renderer functions
void (*GL_DrawParticles)( const float *vieworg, const float *fwd, const float *rt, const float *up, unsigned int clipFlags );
void (*EnvShot)( const float *vieworg, const char *name, qboolean skyshot, int shotsize ); // creates a cubemap or skybox into gfx\env folder
int (*COM_CompareFileTime)( const char *filename1, const char *filename2, int *iCompare );
void (*Host_Error)( const char *error, ... ); // cause Host Error
int (*SPR_LoadExt)( const char *szPicName, unsigned int texFlags ); // extended version of SPR_Load
void (*TessPolygon)( struct msurface_s *surf, struct model_s *mod, float tessSize );
struct mstudiotex_s *( *StudioGetTexture )( struct cl_entity_s *e );
const struct ref_overview_s *( *GetOverviewParms )( void );
void (*S_FadeMusicVolume)( float fadePercent ); // fade background track (0-100 percents)
void (*SetRandomSeed)( long lSeed ); // set custom seed for RANDOM_FLOAT\RANDOM_LONG for predictable random
// static allocations
void *(*pfnMemAlloc)( size_t cb, const char *filename, const int fileline );
void (*pfnMemFree)( void *mem, const char *filename, const int fileline );
// find in files
char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly );
// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 35
} render_api_t;
// render callbacks
typedef struct render_interface_s
{
int version;
// passed through R_RenderFrame (0 - use engine renderer, 1 - use custom client renderer)
int (*GL_RenderFrame)( const struct ref_params_s *pparams, qboolean drawWorld );
// build all the lightmaps on new level or when gamma is changed
void (*GL_BuildLightmaps)( void );
// setup map bounds for ortho-projection when we in dev_overview mode
void (*GL_OrthoBounds)( const float *mins, const float *maxs );
// handle decals which hit mod_studio or mod_sprite
void (*R_StudioDecalShoot)( int decalTexture, struct cl_entity_s *ent, const float *start, const float *pos, int flags, modelstate_t *state );
// prepare studio decals for save
int (*R_CreateStudioDecalList)( decallist_t *pList, int count, qboolean changelevel );
// clear decals by engine request (e.g. for demo recording or vid_restart)
void (*R_ClearStudioDecals)( void );
// grab r_speeds message
qboolean (*R_SpeedsMessage)( char *out, size_t size );
// replace with built-in R_DrawCubemapView for make skyshots or envshots
qboolean (*R_DrawCubemapView)( const float *origin, const float *angles, int size );
// alloc or destroy studiomodel custom data
void (*Mod_ProcessUserData)( struct model_s *mod, qboolean create, const byte *buffer );
} render_interface_t;
#endif//RENDER_API_H

View File

@ -1,24 +0,0 @@
/*
wrect.h - rectangle definition
Copyright (C) 2010 Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef WRECT_H
#define WRECT_H
typedef struct wrect_s
{
int left, right, top, bottom;
} wrect_t;
#endif//WRECT_H

View File

@ -1,70 +0,0 @@
/*
cdll_exp.h - exports for client
Copyright (C) 2013 Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef CDLL_EXP_H
#define CDLL_EXP_H
// NOTE: ordering is important!
typedef struct cldll_func_s
{
int (*pfnInitialize)( cl_enginefunc_t *pEnginefuncs, int iVersion );
void (*pfnInit)( void );
int (*pfnVidInit)( void );
int (*pfnRedraw)( float flTime, int intermission );
int (*pfnUpdateClientData)( client_data_t *cdata, float flTime );
void (*pfnReset)( void );
void (*pfnPlayerMove)( struct playermove_s *ppmove, int server );
void (*pfnPlayerMoveInit)( struct playermove_s *ppmove );
char (*pfnPlayerMoveTexture)( char *name );
void (*IN_ActivateMouse)( void );
void (*IN_DeactivateMouse)( void );
void (*IN_MouseEvent)( int mstate );
void (*IN_ClearStates)( void );
void (*IN_Accumulate)( void );
void (*CL_CreateMove)( float frametime, struct usercmd_s *cmd, int active );
int (*CL_IsThirdPerson)( void );
void (*CL_CameraOffset)( float *ofs );
void *(*KB_Find)( const char *name );
void (*CAM_Think)( void ); // camera stuff
void (*pfnCalcRefdef)( ref_params_t *pparams );
int (*pfnAddEntity)( int type, cl_entity_t *ent, const char *modelname );
void (*pfnCreateEntities)( void );
void (*pfnDrawNormalTriangles)( void );
void (*pfnDrawTransparentTriangles)( void );
void (*pfnStudioEvent)( const struct mstudioevent_s *event, const cl_entity_t *entity );
void (*pfnPostRunCmd)( struct local_state_s *from, struct local_state_s *to, usercmd_t *cmd, int runfuncs, double time, unsigned int random_seed );
void (*pfnShutdown)( void );
void (*pfnTxferLocalOverrides)( entity_state_t *state, const clientdata_t *client );
void (*pfnProcessPlayerState)( entity_state_t *dst, const entity_state_t *src );
void (*pfnTxferPredictionData)( entity_state_t *ps, const entity_state_t *pps, clientdata_t *pcd, const clientdata_t *ppcd, weapon_data_t *wd, const weapon_data_t *pwd );
void (*pfnDemo_ReadBuffer)( int size, byte *buffer );
int (*pfnConnectionlessPacket)( const struct netadr_s *net_from, const char *args, char *buffer, int *size );
int (*pfnGetHullBounds)( int hullnumber, float *mins, float *maxs );
void (*pfnFrame)( double time );
int (*pfnKey_Event)( int eventcode, int keynum, const char *pszCurrentBinding );
void (*pfnTempEntUpdate)( double frametime, double client_time, double cl_gravity, struct tempent_s **ppTempEntFree, struct tempent_s **ppTempEntActive, int ( *Callback_AddVisibleEntity )( cl_entity_t *pEntity ), void ( *Callback_TempEntPlaySound )( struct tempent_s *pTemp, float damp ));
cl_entity_t *(*pfnGetUserEntity)( int index );
void (*pfnVoiceStatus)( int entindex, qboolean bTalking );
void (*pfnDirectorMessage)( int iSize, void *pbuf );
int (*pfnGetStudioModelInterface)( int version, struct r_studio_interface_s **ppinterface, struct engine_studio_api_s *pstudio );
void (*pfnChatInputPosition)( int *x, int *y );
int (*pfnGetPlayerTeam)( int playerIndex );
void *(*pfnGetClientFactory)( void );
// Xash3D extension
int (*pfnGetRenderInterface)( int version, render_api_t *renderfuncs, render_interface_t *callback );
void (*pfnClipMoveToEntity)( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
} cldll_func_t;
#endif//CDLL_EXP_H

View File

@ -18,6 +18,8 @@
#include "const.h"
#define MAX_QPATH 64 // Must match value in quakedefs.h
/////////////////
// Customization
// passed to pfnPlayerCustomization

View File

@ -1,188 +0,0 @@
/*
menu_int.h - interface between engine and menu
Copyright (C) 2010 Uncle Mike
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef MENU_INT_H
#define MENU_INT_H
#include "cvardef.h"
#include "gameinfo.h"
#include "wrect.h"
typedef int HIMAGE; // handle to a graphic
// flags for PIC_Load
#define PIC_NEAREST (1<<0) // disable texfilter
#define PIC_KEEP_RGBDATA (1<<1) // some images keep source
#define PIC_NOFLIP_TGA (1<<2) // Steam background completely ignore tga attribute 0x20
#define PIC_KEEP_8BIT (1<<3) // keep original 8-bit image (if present)
typedef struct ui_globalvars_s
{
float time; // unclamped host.realtime
float frametime;
int scrWidth; // actual values
int scrHeight;
int maxClients;
int developer;
int demoplayback;
int demorecording;
char demoname[64]; // name of currently playing demo
char maptitle[64]; // title of active map
} ui_globalvars_t;
typedef struct ui_enginefuncs_s
{
// image handlers
HIMAGE (*pfnPIC_Load)( const char *szPicName, const byte *ucRawImage, long ulRawImageSize, long flags );
void (*pfnPIC_Free)( const char *szPicName );
int (*pfnPIC_Width)( HIMAGE hPic );
int (*pfnPIC_Height)( HIMAGE hPic );
void (*pfnPIC_Set)( HIMAGE hPic, int r, int g, int b, int a );
void (*pfnPIC_Draw)( int x, int y, int width, int height, const wrect_t *prc );
void (*pfnPIC_DrawHoles)( int x, int y, int width, int height, const wrect_t *prc );
void (*pfnPIC_DrawTrans)( int x, int y, int width, int height, const wrect_t *prc );
void (*pfnPIC_DrawAdditive)( int x, int y, int width, int height, const wrect_t *prc );
void (*pfnPIC_EnableScissor)( int x, int y, int width, int height );
void (*pfnPIC_DisableScissor)( void );
// screen handlers
void (*pfnFillRGBA)( int x, int y, int width, int height, int r, int g, int b, int a );
// cvar handlers
cvar_t* (*pfnRegisterVariable)( const char *szName, const char *szValue, int flags );
float (*pfnGetCvarFloat)( const char *szName );
char* (*pfnGetCvarString)( const char *szName );
void (*pfnCvarSetString)( const char *szName, const char *szValue );
void (*pfnCvarSetValue)( const char *szName, float flValue );
// command handlers
int (*pfnAddCommand)( const char *cmd_name, void (*function)(void) );
void (*pfnClientCmd)( int execute_now, const char *szCmdString );
void (*pfnDelCommand)( const char *cmd_name );
int (*pfnCmdArgc)( void );
char* (*pfnCmdArgv)( int argc );
char* (*pfnCmd_Args)( void );
// debug messages (in-menu shows only notify)
void (*Con_Printf)( char *fmt, ... );
void (*Con_DPrintf)( char *fmt, ... );
void (*Con_NPrintf)( int pos, char *fmt, ... );
void (*Con_NXPrintf)( struct con_nprint_s *info, char *fmt, ... );
// sound handlers
void (*pfnPlayLocalSound)( const char *szSound );
// cinematic handlers
void (*pfnDrawLogo)( const char *filename, float x, float y, float width, float height );
int (*pfnGetLogoWidth)( void );
int (*pfnGetLogoHeight)( void );
float (*pfnGetLogoLength)( void ); // cinematic duration in seconds
// text message system
void (*pfnDrawCharacter)( int x, int y, int width, int height, int ch, int ulRGBA, HIMAGE hFont );
int (*pfnDrawConsoleString)( int x, int y, const char *string );
void (*pfnDrawSetTextColor)( int r, int g, int b, int alpha );
void (*pfnDrawConsoleStringLen)( const char *string, int *length, int *height );
void (*pfnSetConsoleDefaultColor)( int r, int g, int b ); // color must came from colors.lst
// custom rendering (for playermodel preview)
struct cl_entity_s* (*pfnGetPlayerModel)( void ); // for drawing playermodel previews
void (*pfnSetModel)( struct cl_entity_s *ed, const char *path );
void (*pfnClearScene)( void );
void (*pfnRenderScene)( const struct ref_params_s *fd );
int (*CL_CreateVisibleEntity)( int type, struct cl_entity_s *ent );
// misc handlers
void (*pfnHostError)( const char *szFmt, ... );
int (*pfnFileExists)( const char *filename, int gamedironly );
void (*pfnGetGameDir)( char *szGetGameDir );
// gameinfo handlers
int (*pfnCreateMapsList)( int fRefresh );
int (*pfnClientInGame)( void );
void (*pfnClientJoin)( const struct netadr_s adr );
// parse txt files
byte* (*COM_LoadFile)( const char *filename, int *pLength );
char* (*COM_ParseFile)( char *data, char *token );
void (*COM_FreeFile)( void *buffer );
// keyfuncs
void (*pfnKeyClearStates)( void ); // call when menu open or close
void (*pfnSetKeyDest)( int dest );
const char *(*pfnKeynumToString)( int keynum );
const char *(*pfnKeyGetBinding)( int keynum );
void (*pfnKeySetBinding)( int keynum, const char *binding );
int (*pfnKeyIsDown)( int keynum );
int (*pfnKeyGetOverstrikeMode)( void );
void (*pfnKeySetOverstrikeMode)( int fActive );
void *(*pfnKeyGetState)( const char *name ); // for mlook, klook etc
// engine memory manager
void* (*pfnMemAlloc)( size_t cb, const char *filename, const int fileline );
void (*pfnMemFree)( void *mem, const char *filename, const int fileline );
// collect info from engine
int (*pfnGetGameInfo)( GAMEINFO *pgameinfo );
GAMEINFO **(*pfnGetGamesList)( int *numGames ); // collect info about all mods
char **(*pfnGetFilesList)( const char *pattern, int *numFiles, int gamedironly ); // find in files
int (*pfnGetSaveComment)( const char *savename, char *comment );
int (*pfnGetDemoComment)( const char *demoname, char *comment );
int (*pfnCheckGameDll)( void ); // returns false if hl.dll is missed or invalid
char *(*pfnGetClipboardData)( void );
// engine launcher
void (*pfnShellExecute)( const char *name, const char *args, int closeEngine );
void (*pfnWriteServerConfig)( const char *name );
void (*pfnChangeInstance)( const char *newInstance, const char *szFinalMessage );
void (*pfnPlayBackgroundTrack)( const char *introName, const char *loopName );
void (*pfnHostEndGame)( const char *szFinalMessage );
// menu interface is freezed at version 0.75
// new functions starts here
float (*pfnRandomFloat)( float flLow, float flHigh );
int (*pfnRandomLong)( int lLow, int lHigh );
void (*pfnSetCursor)( void *hCursor ); // change cursor
int (*pfnIsMapValid)( char *filename );
void (*pfnProcessImage)( int texnum, float gamma, int topColor, int bottomColor );
int (*pfnCompareFileTime)( char *filename1, char *filename2, int *iCompare );
} ui_enginefuncs_t;
typedef struct
{
int (*pfnVidInit)( void );
void (*pfnInit)( void );
void (*pfnShutdown)( void );
void (*pfnRedraw)( float flTime );
void (*pfnKeyEvent)( int key, int down );
void (*pfnMouseMove)( int x, int y );
void (*pfnSetActiveMenu)( int active );
void (*pfnAddServerToList)( struct netadr_s adr, const char *info );
void (*pfnGetCursorPos)( int *pos_x, int *pos_y );
void (*pfnSetCursorPos)( int pos_x, int pos_y );
void (*pfnShowCursor)( int show );
void (*pfnCharEvent)( int key );
int (*pfnMouseInRect)( void ); // mouse entering\leave game window
int (*pfnIsVisible)( void );
int (*pfnCreditsActive)( void ); // unused
void (*pfnFinalCredits)( void ); // show credits + game end
} UI_FUNCTIONS;
typedef int (*MENUAPI)( UI_FUNCTIONS *pFunctionTable, ui_enginefuncs_t* engfuncs, ui_globalvars_t *pGlobals );
#endif//MENU_INT_H

View File

@ -1,53 +0,0 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
0.000000, 0.098165, 0.196270, 0.294259, 0.392069, 0.489643, 0.586920, 0.683850,
0.780360, 0.876405, 0.971920, 1.066850, 1.161140, 1.254725, 1.347560, 1.439580,
1.530735, 1.620965, 1.710220, 1.798445, 1.885585, 1.971595, 2.056410, 2.139990,
2.222280, 2.303235, 2.382795, 2.460925, 2.537575, 2.612690, 2.686235, 2.758160,
2.828425, 2.896990, 2.963805, 3.028835, 3.092040, 3.153385, 3.212830, 3.270340,
3.325880, 3.379415, 3.430915, 3.480350, 3.527685, 3.572895, 3.615955, 3.656840,
3.695520, 3.731970, 3.766175, 3.798115, 3.827760, 3.855105, 3.880125, 3.902810,
3.923140, 3.941110, 3.956705, 3.969920, 3.980740, 3.989160, 3.995180, 3.998795,
4.000000, 3.998795, 3.995180, 3.989160, 3.980740, 3.969920, 3.956705, 3.941110,
3.923140, 3.902810, 3.880125, 3.855105, 3.827760, 3.798115, 3.766175, 3.731970,
3.695520, 3.656840, 3.615955, 3.572895, 3.527685, 3.480350, 3.430915, 3.379415,
3.325880, 3.270340, 3.212830, 3.153385, 3.092040, 3.028835, 2.963805, 2.896990,
2.828425, 2.758160, 2.686235, 2.612690, 2.537575, 2.460925, 2.382795, 2.303235,
2.222280, 2.139990, 2.056410, 1.971595, 1.885585, 1.798445, 1.710220, 1.620965,
1.530735, 1.439580, 1.347560, 1.254725, 1.161140, 1.066850, 0.971920, 0.876405,
0.780360, 0.683850, 0.586920, 0.489643, 0.392069, 0.294259, 0.196270, 0.098165,
0.000000, -0.098165, -0.196270, -0.294259, -0.392069, -0.489643, -0.586920, -0.683850,
-0.780360, -0.876405, -0.971920, -1.066850, -1.161140, -1.254725, -1.347560, -1.439580,
-1.530735, -1.620965, -1.710220, -1.798445, -1.885585, -1.971595, -2.056410, -2.139990,
-2.222280, -2.303235, -2.382795, -2.460925, -2.537575, -2.612690, -2.686235, -2.758160,
-2.828425, -2.896990, -2.963805, -3.028835, -3.092040, -3.153385, -3.212830, -3.270340,
-3.325880, -3.379415, -3.430915, -3.480350, -3.527685, -3.572895, -3.615955, -3.656840,
-3.695520, -3.731970, -3.766175, -3.798115, -3.827760, -3.855105, -3.880125, -3.902810,
-3.923140, -3.941110, -3.956705, -3.969920, -3.980740, -3.989160, -3.995180, -3.998795,
-4.000000, -3.998795, -3.995180, -3.989160, -3.980740, -3.969920, -3.956705, -3.941110,
-3.923140, -3.902810, -3.880125, -3.855105, -3.827760, -3.798115, -3.766175, -3.731970,
-3.695520, -3.656840, -3.615955, -3.572895, -3.527685, -3.480350, -3.430915, -3.379415,
-3.325880, -3.270340, -3.212830, -3.153385, -3.092040, -3.028835, -2.963805, -2.896990,
-2.828425, -2.758160, -2.686235, -2.612690, -2.537575, -2.460925, -2.382795, -2.303235,
-2.222280, -2.139990, -2.056410, -1.971595, -1.885585, -1.798445, -1.710220, -1.620965,
-1.530735, -1.439580, -1.347560, -1.254725, -1.161140, -1.066850, -0.971920, -0.876405,
-0.780360, -0.683850, -0.586920, -0.489643, -0.392069, -0.294259, -0.196270, -0.098165,