mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-13 07:47:45 +00:00
2e1a70e319
maplist command now generates links. implemented skin objects for q3. added a csqc builtin for it. also supports compositing skins. playing demos inside zips/pk3s/paks should now work. bumped default rate cvar. added cl_transfer to attempt to connect to a new server without disconnecting first. rewrote fog command. alpha and mindist arguments are now supported. fog change also happens over a short time period. added new args to the showpic console command. can now create clickable items for touchscreen/absmouse users. fixed menus to properly support right-aligned text. this finally fixes variable-width fonts. rewrote console tab completion suggestions display. now clickable links. strings obtained from qc are now marked as const. this has required quite a few added consts all over the place. probably crappy attempt at adding joypad support to the sdl port. no idea if it works. changed key bind event code. buttons now track which event they should trigger when released, instead of being the same one the whole time. this allows +forward etc clickable buttons on screen. Also simplified modifier keys - they no longer trigger random events when pressing the modifier key itself. Right modifiers can now be bound separately from left modifiers. Right will use left's binding if not otherwise bound. Bind assumes left if there's no prefix. multiplayer->setup->network menu no longer crashes. added rgb colours to the translation view (but not to the colour-changing keys). added modelviewer command to view models. added menu_mods menu to switch mods in a more friendly way. will be shown by default if multiple manifests exist in the binarydir. clamped classic tracer density. scrag particles no longer look quite so buggy. added ifdefs to facilitate a potential winrt port. the engine should now have no extra dependencies, but still needs system code+audio drivers to be written. if it can't set a renderer, it'll now try to use *every* renderer until it finds one that works. added experimental mapcluster server mode (that console command). New maps will be started up as required. rewrote skeletal blending code a bit. added cylinder geomtypes. fix cfg_save writing to the wrong path bug. VFS_CLOSE now returns a boolean. false means there was some sort of fatal error (either crc when reading was bad, or the write got corrupted or something). Typically ignorable, depends how robust you want to be. win32 tls code now supports running as a server. added connect tls://address support, as well as equivalent sv_addport support. exposed basic model loading api to plugins. d3d11 backend now optionally supports tessellation hlsl. no suitable hlsl provided by default. !!tess to enable. attempted to add gamma ramp support for d3d11. added support for shader blobs to speed up load times. r_shaderblobs 1 to enable. almost vital for d3d11. added vid_srgb cvar. shadowless lights are no longer disabled if shadows are not supported. attempt to add support for touchscreens in win7/8. Wrote gimmicky lua support, using lua instead of ssqc. define VM_LUA to enable. updated saved game code. can again load saved games from vanilla-like engines. changed scale clamping. 0.0001 should no longer appear as 1. changed default mintic from 0.03 to 0.013 to match vanilla qw. I don't know why it was at 0.03. probably a typo. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4623 fc73d0e0-1445-4013-8a0c-d673dee63da5
203 lines
6 KiB
C
203 lines
6 KiB
C
|
|
#include "hash.h"
|
|
#include "shader.h"
|
|
|
|
#ifdef SKELETALMODELS
|
|
#include <stdlib.h>
|
|
#endif
|
|
|
|
int HLMod_BoneForName(model_t *mod, const char *name);
|
|
int HLMod_FrameForName(model_t *mod, const char *name);
|
|
|
|
//a single pose within an animation (note: always refered to via a framegroup, even if there's only one frame in that group).
|
|
typedef struct
|
|
{
|
|
vecV_t *ofsverts;
|
|
#ifndef SERVERONLY
|
|
vec3_t *ofsnormals;
|
|
vec3_t *ofstvector;
|
|
vec3_t *ofssvector;
|
|
|
|
vboarray_t vboverts;
|
|
vboarray_t vbonormals;
|
|
vboarray_t vbosvector;
|
|
vboarray_t vbotvector;
|
|
#endif
|
|
|
|
vec3_t scale;
|
|
vec3_t scale_origin;
|
|
} galiaspose_t;
|
|
|
|
//a frame group (aka: animation)
|
|
typedef struct
|
|
{
|
|
#ifdef SKELETALMODELS
|
|
skeltype_t skeltype; //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.
|
|
float *boneofs; //numposes*12*numbones
|
|
#endif
|
|
qboolean loop;
|
|
int numposes;
|
|
float rate;
|
|
galiaspose_t *poseofs;
|
|
char name[64];
|
|
} galiasgroup_t;
|
|
|
|
typedef struct galiasbone_s galiasbone_t;
|
|
#ifdef SKELETALMODELS
|
|
struct galiasbone_s
|
|
{
|
|
char name[32];
|
|
int parent;
|
|
float inverse[12];
|
|
};
|
|
|
|
typedef struct FTE_DEPRECATED
|
|
{
|
|
//DEPRECATED
|
|
//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;
|
|
qbyte **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;
|
|
shader_t **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
|
|
{
|
|
char name[64];
|
|
vec3_t org;
|
|
float ang[3][3];
|
|
} md3tag_t;
|
|
|
|
typedef struct galiasinfo_s
|
|
{
|
|
char surfacename[MAX_QPATH];
|
|
unsigned short geomset;
|
|
unsigned short geomid;
|
|
index_t *ofs_indexes;
|
|
int numindexes;
|
|
|
|
int *ofs_trineighbours;
|
|
float lerpcutoff; //hack. should probably be part of the entity structure, but I really don't want new models (and thus code) to have access to this ugly inefficient hack. make your models properly in the first place.
|
|
|
|
int numskins;
|
|
#ifndef SERVERONLY
|
|
galiasskin_t *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
|
|
vec2_t *ofs_st_array;
|
|
vec4_t *ofs_rgbaf;
|
|
byte_vec4_t *ofs_rgbaub;
|
|
#endif
|
|
|
|
int groups;
|
|
galiasgroup_t *groupofs;
|
|
|
|
struct galiasinfo_s *nextsurf;
|
|
|
|
#ifdef SKELETALMODELS
|
|
float *baseframeofs; /*non-heirachical*/
|
|
int numbones;
|
|
galiasbone_t *ofsbones;
|
|
int numswtransforms;
|
|
galisskeletaltransforms_t *ofsswtransforms;
|
|
|
|
vecV_t *ofs_skel_xyz;
|
|
vec3_t *ofs_skel_norm;
|
|
vec3_t *ofs_skel_svect;
|
|
vec3_t *ofs_skel_tvect;
|
|
byte_vec4_t *ofs_skel_idx;
|
|
vec4_t *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;
|
|
vboarray_t vborgba; //yeah, just you try reading THAT as an actual word.
|
|
|
|
//these exist only in the root mesh.
|
|
int numtagframes;
|
|
int numtags;
|
|
md3tag_t *ofstags;
|
|
} galiasinfo_t;
|
|
|
|
typedef struct
|
|
{
|
|
int (*RegisterModelFormatText)(void *module, const char *formatname, char *magictext, qboolean (QDECL *load) (struct model_s *mod, void *buffer, size_t fsize));
|
|
int (*RegisterModelFormatMagic)(void *module, const char *formatname, unsigned int magic, qboolean (QDECL *load) (struct model_s *mod, void *buffer, size_t fsize));
|
|
void (*UnRegisterModelFormat)(int idx);
|
|
void (*UnRegisterAllModelFormats)(void *module);
|
|
|
|
void *(*ZG_Malloc)(zonegroup_t *ctx, int size);
|
|
|
|
void (*ConcatTransforms) (float in1[3][4], float in2[3][4], float out[3][4]);
|
|
void (*M3x4_Invert) (const float *in1, float *out);
|
|
void (*StripExtension) (const char *in, char *out, int outlen);
|
|
void (*GenMatrixPosQuat4Scale)(vec3_t pos, vec4_t quat, vec3_t scale, float result[12]);
|
|
void (*ForceConvertBoneData)(skeltype_t sourcetype, const float *sourcedata, size_t bonecount, galiasbone_t *bones, skeltype_t desttype, float *destbuffer, size_t destbonecount);
|
|
|
|
shader_t *(*RegisterShader) (const char *name, unsigned int usageflags, const char *shaderscript);
|
|
shader_t *(*RegisterSkin) (const char *shadername, const char *modname);
|
|
void (*BuildDefaultTexnums)(texnums_t *tn, shader_t *shader);
|
|
} modplugfuncs_t;
|
|
|
|
#ifdef SKELETALMODELS
|
|
void Alias_TransformVerticies(float *bonepose, galisskeletaltransforms_t *weights, int numweights, vecV_t *xyzout, vec3_t *normout);
|
|
void Alias_ForceConvertBoneData(skeltype_t sourcetype, const float *sourcedata, size_t bonecount, galiasbone_t *bones, skeltype_t desttype, float *destbuffer, size_t destbonecount);
|
|
#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 Alias_Register(void);
|
|
|
|
void Mod_DoCRC(model_t *mod, char *buffer, int buffersize);
|
|
|
|
qboolean QDECL Mod_LoadHLModel (model_t *mod, void *buffer, size_t fsize);
|
|
#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);
|