2008-11-09 22:29:28 +00:00
|
|
|
|
|
|
|
#include "hash.h"
|
|
|
|
#include "shader.h"
|
|
|
|
|
|
|
|
#if defined(ZYMOTICMODELS) || defined(MD5MODELS)
|
|
|
|
#define SKELETALMODELS
|
|
|
|
#include <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
2009-11-04 21:16:50 +00:00
|
|
|
int HLMod_BoneForName(model_t *mod, char *name);
|
|
|
|
int HLMod_FrameForName(model_t *mod, char *name);
|
2008-11-09 22:29:28 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int ofs_indexes;
|
|
|
|
int numindexes;
|
|
|
|
|
|
|
|
int ofs_trineighbours;
|
|
|
|
|
|
|
|
int numskins;
|
|
|
|
#ifndef SERVERONLY
|
|
|
|
int ofsskins;
|
|
|
|
#endif
|
|
|
|
|
2011-07-30 14:14:56 +00:00
|
|
|
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).
|
2008-11-09 22:29:28 +00:00
|
|
|
|
|
|
|
int numverts;
|
|
|
|
|
|
|
|
#ifndef SERVERONLY
|
|
|
|
int ofs_st_array;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int groups;
|
|
|
|
int groupofs;
|
2010-09-15 09:06:31 +00:00
|
|
|
int baseframeofs; /*non-heirachical*/
|
2008-11-09 22:29:28 +00:00
|
|
|
|
|
|
|
int nextsurf;
|
|
|
|
|
|
|
|
#ifdef SKELETALMODELS
|
|
|
|
int numbones;
|
|
|
|
int ofsbones;
|
2011-07-30 14:14:56 +00:00
|
|
|
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;
|
2008-11-09 22:29:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//these exist only in the root mesh.
|
|
|
|
int numtagframes;
|
|
|
|
int numtags;
|
|
|
|
int ofstags;
|
|
|
|
} galiasinfo_t;
|
|
|
|
|
|
|
|
//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;
|
2009-11-04 21:16:50 +00:00
|
|
|
int ofstvector;
|
|
|
|
int ofssvector;
|
2008-11-09 22:29:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
vec3_t scale;
|
|
|
|
vec3_t scale_origin;
|
|
|
|
} galiaspose_t;
|
|
|
|
|
|
|
|
#ifdef SKELETALMODELS
|
|
|
|
typedef struct {
|
|
|
|
char name[32];
|
|
|
|
int parent;
|
|
|
|
} galiasbone_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
//skeletal poses refer to this.
|
|
|
|
int vertexindex;
|
|
|
|
int boneindex;
|
|
|
|
vec4_t org;
|
2009-06-30 22:05:18 +00:00
|
|
|
#ifndef SERVERONLY
|
|
|
|
vec3_t normal;
|
|
|
|
#endif
|
2008-11-09 22:29:28 +00:00
|
|
|
} 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 texnums;
|
|
|
|
int ofstexnums;
|
|
|
|
char name [MAX_QPATH];
|
|
|
|
} galiasskin_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char name[MAX_QPATH];
|
2009-11-04 21:16:50 +00:00
|
|
|
texnums_t texnum;
|
2008-06-01 22:06:22 +00:00
|
|
|
unsigned int tcolour;
|
2008-11-09 22:29:28 +00:00
|
|
|
unsigned int bcolour;
|
2010-08-28 17:14:38 +00:00
|
|
|
unsigned int pclass;
|
2008-11-09 22:29:28 +00:00
|
|
|
int skinnum;
|
2009-11-04 21:16:50 +00:00
|
|
|
unsigned int subframe;
|
2008-11-09 22:29:28 +00:00
|
|
|
bucket_t bucket;
|
|
|
|
} galiascolourmapped_t;
|
|
|
|
#endif
|
|
|
|
|
2008-12-23 02:55:20 +00:00
|
|
|
float *Alias_GetBonePositions(galiasinfo_t *inf, framestate_t *fstate, float *buffer, int buffersize);
|
2009-01-16 01:24:57 +00:00
|
|
|
#ifdef SKELETALMODELS
|
2010-03-14 14:35:56 +00:00
|
|
|
void Alias_TransformVerticies(float *bonepose, galisskeletaltransforms_t *weights, int numweights, vecV_t *xyzout, vec3_t *normout);
|
2009-01-16 01:24:57 +00:00
|
|
|
#endif
|
2011-07-30 14:14:56 +00:00
|
|
|
qboolean Alias_GAliasBuildMesh(mesh_t *mesh, galiasinfo_t *inf, int surfnum, entity_t *e, qboolean allowskel);
|
|
|
|
void Alias_FlushCache(void);
|
2008-11-09 22:29:28 +00:00
|
|
|
|
2008-12-23 02:55:20 +00:00
|
|
|
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);
|
2010-09-15 09:06:31 +00:00
|
|
|
#endif
|
|
|
|
#ifdef DPMMODELS
|
2008-12-23 02:55:20 +00:00
|
|
|
qboolean Mod_LoadDarkPlacesModel(model_t *mod, void *buffer);
|
|
|
|
#endif
|
2010-09-15 09:06:31 +00:00
|
|
|
#ifdef PSKMODELS
|
|
|
|
qboolean Mod_LoadPSKModel(model_t *mod, void *buffer);
|
|
|
|
#endif
|
2011-05-20 04:10:46 +00:00
|
|
|
#ifdef INTERQUAKEMODELS
|
|
|
|
qboolean Mod_LoadInterQuakeModel(model_t *mod, void *buffer);
|
|
|
|
#endif
|
2008-12-23 02:55:20 +00:00
|
|
|
#ifdef MD5MODELS
|
|
|
|
qboolean Mod_LoadMD5MeshModel(model_t *mod, void *buffer);
|
|
|
|
qboolean Mod_LoadCompositeAnim(model_t *mod, void *buffer);
|
|
|
|
#endif
|
Fixes, workarounds, and breakages. Hexen2 should work much better (-hexen2 says no mission pack, -portals says h2mp). Started working on splitting bigcoords per client, far too much work still to go on that. Removed gl_ztrick entirely. Enabled csprogs download by default. Added client support for fitzquake's 666 protocol, needs testing, some cleanup for dp protocols too, no server support, couldn't selectively enable it anyway. Now attempting to cache shadow meshes for explosions and stuff. Played with lightmaps a little, should potentially run a little faster on certain (intel?) cards. Tweeked npfte a little to try to avoid deadlocks and crashes. Fixed sky worldspawn parsing. Added h2mp's model format. Fixed baseline issue in q2 client, made servers generate q2 baselines. MOVETYPE_PUSH will not rotate extra if rotation is forced. Made status command show allowed client types. Changed lighting on weapons - should now be shaded.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3572 fc73d0e0-1445-4013-8a0c-d673dee63da5
2010-08-11 03:36:31 +00:00
|
|
|
#ifdef MAP_PROC
|
|
|
|
qboolean Mod_LoadMap_Proc(model_t *mode, void *buffer);
|
|
|
|
#endif
|
2009-11-04 21:16:50 +00:00
|
|
|
|
|
|
|
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);
|