fteqw/engine/common/com_mesh.h

186 lines
4.5 KiB
C
Raw Normal View History

#include "hash.h"
#include "shader.h"
------------------------------------------------------------------------ r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines removed MAX_VISEDICTS limit. PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default. TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW. added android multitouch emulation for windows/rawinput (in_simulatemultitouch). split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature. now using utf-8 for windows consoles. qcc warnings/errors now give clickable console links for quick+easy editing. disabled menutint when the currently active item changes contrast or gamma (for OneManClan). Added support for drawfont/drawfontscale. tweaked the qcvm a little to reduce the number of pointers. .doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up. windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings. fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen. editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts. Added support for .framegroups files for psk(psa) and iqm formats. True support for ezquake's colour codes. Mutually exclusive with background colours. path command output slightly more readable. added support for digest_hex (MD4, SHA1, CRC16). skingroups now colourmap correctly. Fix terrain colour hints, and litdata from the wrong bsp. fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported). remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother. fix v *= v.x and similar opcodes. fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported. fteqcc: fixed '#if 1 == 3 && 4' parsing. fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable. fteqcc: copyright message now includes compile date instead. fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile. fteqccgui: the output window is now focused and scrolls down as compilation progresses. pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue. rewrote prespawn/modelist/soundlist code. server tracks progress now. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
2013-03-12 22:29:40 +00:00
#ifdef SKELETALMODELS
#include <stdlib.h>
#endif
int HLMod_BoneForName(model_t *mod, char *name);
int HLMod_FrameForName(model_t *mod, char *name);
//frame is an index into this
typedef struct
{
#ifdef SKELETALMODELS
qboolean isheirachical; //for models with transforms, states that bones need to be transformed from their parent.
//this is actually bad, and can result in bones shortening as they interpolate.
#endif
qboolean loop;
int numposes;
float rate;
int poseofs;
char name[64];
} galiasgroup_t;
typedef struct
{
int ofsverts;
#ifndef SERVERONLY
int ofsnormals;
int ofstvector;
int ofssvector;
vboarray_t vboverts;
vboarray_t vbonormals;
vboarray_t vbosvector;
vboarray_t vbotvector;
#endif
vec3_t scale;
vec3_t scale_origin;
} galiaspose_t;
typedef struct galiasbone_s galiasbone_t;
#ifdef SKELETALMODELS
struct galiasbone_s
{
char name[32];
int parent;
float inverse[12];
};
typedef struct
{
//skeletal poses refer to this.
int vertexindex;
int boneindex;
vec4_t org;
#ifndef SERVERONLY
vec3_t normal;
#endif
} galisskeletaltransforms_t;
#endif
//we can't be bothered with animating skins.
//We'll load up to four of them but after that you're on your own
#ifndef SERVERONLY
typedef struct {
int skinwidth;
int skinheight;
int ofstexels; //this is 8bit for frame 0 only. only valid in q1 models without replacement textures, used for colourising player skins.
float skinspeed;
int numshaders;
int ofsshaders;
char name [MAX_QPATH];
} galiasskin_t;
typedef struct {
char name[MAX_QPATH];
texnums_t texnum;
unsigned int tcolour;
unsigned int bcolour;
unsigned int pclass;
int skinnum;
unsigned int subframe;
bucket_t bucket;
} galiascolourmapped_t;
#endif
typedef struct {
int ofs_indexes;
int numindexes;
int ofs_trineighbours;
int numskins;
#ifndef SERVERONLY
int ofsskins;
#endif
int shares_verts; //used with models with two shaders using the same vertex. set to the surface number to inherit from (or itself).
int shares_bones; //use last mesh's bones. set to the surface number to inherit from (or itself).
int numverts;
#ifndef SERVERONLY
int ofs_st_array;
#endif
int groups;
int groupofs;
int baseframeofs; /*non-heirachical*/
int nextsurf;
#ifdef SKELETALMODELS
int numbones;
int ofsbones;
int numswtransforms;
int ofsswtransforms;
int ofs_skel_xyz;
int ofs_skel_norm;
int ofs_skel_svect;
int ofs_skel_tvect;
int ofs_skel_idx;
int ofs_skel_weight;
vboarray_t vbo_skel_verts;
vboarray_t vbo_skel_normals;
vboarray_t vbo_skel_svector;
vboarray_t vbo_skel_tvector;
vboarray_t vbo_skel_bonenum;
vboarray_t vbo_skel_bweight;
#endif
vboarray_t vboindicies;
vboarray_t vbotexcoords;
//these exist only in the root mesh.
int numtagframes;
int numtags;
int ofstags;
} galiasinfo_t;
float *Alias_GetBonePositions(galiasinfo_t *inf, framestate_t *fstate, float *buffer, int buffersize, qboolean renderable);
#ifdef SKELETALMODELS
void Alias_TransformVerticies(float *bonepose, galisskeletaltransforms_t *weights, int numweights, vecV_t *xyzout, vec3_t *normout);
#endif
qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, int surfnum, entity_t *e, qboolean allowskel);
void Alias_FlushCache(void);
void Alias_Shutdown(void);
void Mod_DoCRC(model_t *mod, char *buffer, int buffersize);
qboolean Mod_LoadQ1Model (model_t *mod, void *buffer);
#ifdef MD2MODELS
qboolean Mod_LoadQ2Model (model_t *mod, void *buffer);
#endif
#ifdef MD3MODELS
qboolean Mod_LoadQ3Model(model_t *mod, void *buffer);
#endif
#ifdef ZYMOTICMODELS
qboolean Mod_LoadZymoticModel(model_t *mod, void *buffer);
#endif
#ifdef DPMMODELS
qboolean Mod_LoadDarkPlacesModel(model_t *mod, void *buffer);
#endif
#ifdef PSKMODELS
qboolean Mod_LoadPSKModel(model_t *mod, void *buffer);
#endif
#ifdef INTERQUAKEMODELS
qboolean Mod_LoadInterQuakeModel(model_t *mod, void *buffer);
#endif
#ifdef MD5MODELS
qboolean Mod_LoadMD5MeshModel(model_t *mod, void *buffer);
qboolean Mod_LoadCompositeAnim(model_t *mod, void *buffer);
#endif
#ifdef MAP_PROC
qboolean Mod_LoadMap_Proc(model_t *mode, void *buffer);
#endif
void Mod_AccumulateTextureVectors(vecV_t *vc, vec2_t *tc, vec3_t *nv, vec3_t *sv, vec3_t *tv, index_t *idx, int numidx);
void Mod_AccumulateMeshTextureVectors(mesh_t *mesh);
void Mod_NormaliseTextureVectors(vec3_t *n, vec3_t *s, vec3_t *t, int v);