2015-02-02 08:01:53 +00:00
# ifdef __cplusplus
extern " C " {
# endif
2008-11-09 22:29:28 +00:00
# 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
2008-11-09 22:29:28 +00:00
# include <stdlib.h>
# endif
2014-03-30 08:55:06 +00:00
int HLMod_BoneForName ( model_t * mod , const char * name ) ;
int HLMod_FrameForName ( model_t * mod , const char * name ) ;
2008-11-09 22:29:28 +00:00
2013-07-14 12:22:51 +00:00
//a single pose within an animation (note: always refered to via a framegroup, even if there's only one frame in that group).
2013-04-06 03:36:00 +00:00
typedef struct
{
2013-07-14 12:22:51 +00:00
vecV_t * ofsverts ;
2008-11-09 22:29:28 +00:00
# ifndef SERVERONLY
2013-07-14 12:22:51 +00:00
vec3_t * ofsnormals ;
vec3_t * ofstvector ;
vec3_t * ofssvector ;
2013-04-06 03:36:00 +00:00
vboarray_t vboverts ;
vboarray_t vbonormals ;
vboarray_t vbosvector ;
vboarray_t vbotvector ;
2008-11-09 22:29:28 +00:00
# endif
vec3_t scale ;
vec3_t scale_origin ;
} galiaspose_t ;
2013-07-14 12:22:51 +00:00
//a frame group (aka: animation)
typedef struct
{
# ifdef SKELETALMODELS
2014-03-30 08:55:06 +00:00
skeltype_t skeltype ; //for models with transforms, states that bones need to be transformed from their parent.
2013-07-14 12:22:51 +00:00
//this is actually bad, and can result in bones shortening as they interpolate.
2014-03-30 08:55:06 +00:00
float * boneofs ; //numposes*12*numbones
2013-07-14 12:22:51 +00:00
# endif
qboolean loop ;
int numposes ;
float rate ;
galiaspose_t * poseofs ;
char name [ 64 ] ;
2015-03-03 00:14:43 +00:00
} galiasanimation_t ;
2013-07-14 12:22:51 +00:00
2011-12-23 03:12:29 +00:00
typedef struct galiasbone_s galiasbone_t ;
2008-11-09 22:29:28 +00:00
# ifdef SKELETALMODELS
2013-04-06 03:36:00 +00:00
struct galiasbone_s
{
2008-11-09 22:29:28 +00:00
char name [ 32 ] ;
int parent ;
2011-12-23 03:12:29 +00:00
float inverse [ 12 ] ;
} ;
2008-11-09 22:29:28 +00:00
2014-03-30 08:55:06 +00:00
typedef struct FTE_DEPRECATED
2013-04-06 03:36:00 +00:00
{
2014-03-30 08:55:06 +00:00
//DEPRECATED
2008-11-09 22:29:28 +00:00
//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
2014-10-05 20:04:11 +00:00
typedef struct
{
shader_t * shader ;
qbyte * texels ; //this is 8bit for frame 0 only. only valid in q1 models without replacement textures, used for colourising player skins.
char * defaultshader ;
char shadername [ MAX_QPATH ] ;
texnums_t texnums ;
} skinframe_t ;
2013-07-14 12:22:51 +00:00
typedef struct
{
2008-11-09 22:29:28 +00:00
int skinwidth ;
int skinheight ;
float skinspeed ;
2014-10-05 20:04:11 +00:00
int numframes ;
skinframe_t * frame ;
2013-07-14 12:22:51 +00:00
char name [ MAX_QPATH ] ;
2008-11-09 22:29:28 +00:00
} galiasskin_t ;
2013-07-14 12:22:51 +00:00
typedef struct
{
2008-11-09 22:29:28 +00:00
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
2013-07-14 12:22:51 +00:00
typedef struct
{
char name [ 64 ] ;
vec3_t org ;
float ang [ 3 ] [ 3 ] ;
} md3tag_t ;
2013-06-23 02:17:02 +00:00
2013-07-14 12:22:51 +00:00
typedef struct galiasinfo_s
{
2014-03-30 08:55:06 +00:00
char surfacename [ MAX_QPATH ] ;
unsigned short geomset ;
unsigned short geomid ;
2013-07-14 12:22:51 +00:00
index_t * ofs_indexes ;
2013-06-23 02:17:02 +00:00
int numindexes ;
2013-07-14 12:22:51 +00:00
int * ofs_trineighbours ;
2013-11-21 23:02:28 +00:00
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.
2013-06-23 02:17:02 +00:00
int numskins ;
# ifndef SERVERONLY
2013-07-14 12:22:51 +00:00
galiasskin_t * ofsskins ;
2013-06-23 02:17:02 +00:00
# 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
2013-07-14 12:22:51 +00:00
vec2_t * ofs_st_array ;
2014-03-30 08:55:06 +00:00
vec4_t * ofs_rgbaf ;
byte_vec4_t * ofs_rgbaub ;
2013-06-23 02:17:02 +00:00
# endif
2015-03-03 00:14:43 +00:00
int numanimations ;
galiasanimation_t * ofsanimations ;
2013-06-23 02:17:02 +00:00
2013-07-14 12:22:51 +00:00
struct galiasinfo_s * nextsurf ;
2013-06-23 02:17:02 +00:00
# ifdef SKELETALMODELS
2013-07-14 12:22:51 +00:00
float * baseframeofs ; /*non-heirachical*/
2013-06-23 02:17:02 +00:00
int numbones ;
2013-07-14 12:22:51 +00:00
galiasbone_t * ofsbones ;
2013-06-23 02:17:02 +00:00
int numswtransforms ;
2013-07-14 12:22:51 +00:00
galisskeletaltransforms_t * ofsswtransforms ;
2013-06-23 02:17:02 +00:00
2013-07-14 12:22:51 +00:00
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 ;
2013-06-23 02:17:02 +00:00
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 ;
2014-03-30 08:55:06 +00:00
vboarray_t vborgba ; //yeah, just you try reading THAT as an actual word.
2013-06-23 02:17:02 +00:00
//these exist only in the root mesh.
int numtagframes ;
int numtags ;
2013-07-14 12:22:51 +00:00
md3tag_t * ofstags ;
2013-06-23 02:17:02 +00:00
} galiasinfo_t ;
2014-03-30 08:55:06 +00:00
typedef struct
{
2014-05-16 01:34:58 +00:00
int version ;
int ( QDECL * RegisterModelFormatText ) ( const char * formatname , char * magictext , qboolean ( QDECL * load ) ( struct model_s * mod , void * buffer , size_t fsize ) ) ;
int ( QDECL * RegisterModelFormatMagic ) ( const char * formatname , unsigned int magic , qboolean ( QDECL * load ) ( struct model_s * mod , void * buffer , size_t fsize ) ) ;
2014-04-24 01:53:01 +00:00
void ( QDECL * UnRegisterModelFormat ) ( int idx ) ;
2014-05-16 01:34:58 +00:00
void ( QDECL * UnRegisterAllModelFormats ) ( void ) ;
2014-04-24 01:53:01 +00:00
2014-10-05 20:04:11 +00:00
void * ( QDECL * ZG_Malloc ) ( zonegroup_t * ctx , int size ) ; //ctx=&mod->memgroup and the data will be freed when the model is freed.
2014-04-24 01:53:01 +00:00
void ( QDECL * ConcatTransforms ) ( float in1 [ 3 ] [ 4 ] , float in2 [ 3 ] [ 4 ] , float out [ 3 ] [ 4 ] ) ;
void ( QDECL * M3x4_Invert ) ( const float * in1 , float * out ) ;
2015-02-02 08:01:53 +00:00
void ( QDECL * VectorAngles ) ( float * forward , float * up , float * result ) ;
void ( QDECL * AngleVectors ) ( const vec3_t angles , vec3_t forward , vec3_t right , vec3_t up ) ;
2014-04-24 01:53:01 +00:00
void ( QDECL * GenMatrixPosQuat4Scale ) ( vec3_t pos , vec4_t quat , vec3_t scale , float result [ 12 ] ) ;
2015-02-02 08:01:53 +00:00
void ( QDECL * StripExtension ) ( const char * in , char * out , int outlen ) ;
2014-04-24 01:53:01 +00:00
void ( QDECL * ForceConvertBoneData ) ( skeltype_t sourcetype , const float * sourcedata , size_t bonecount , galiasbone_t * bones , skeltype_t desttype , float * destbuffer , size_t destbonecount ) ;
2015-02-02 08:01:53 +00:00
2015-03-05 22:14:21 +00:00
void * unused1 ;
void * reserved2 ;
void * unused3 ;
void * unused4 ;
void * unused5 ;
2014-03-30 08:55:06 +00:00
} modplugfuncs_t ;
2015-02-02 08:01:53 +00:00
# define MODPLUGFUNCS_VERSION 2
2014-03-30 08:55:06 +00:00
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 ) ;
2014-04-24 01:53:01 +00:00
void QDECL Alias_ForceConvertBoneData ( skeltype_t sourcetype , const float * sourcedata , size_t bonecount , galiasbone_t * bones , skeltype_t desttype , float * destbuffer , size_t destbonecount ) ;
2009-01-16 01:24:57 +00:00
# endif
2013-04-06 03:36:00 +00:00
qboolean Alias_GAliasBuildMesh ( mesh_t * mesh , vbo_t * * vbop , galiasinfo_t * inf , int surfnum , entity_t * e , qboolean allowskel ) ;
2014-10-05 20:04:11 +00:00
void Mod_DestroyMesh ( galiasinfo_t * galias ) ;
2011-07-30 14:14:56 +00:00
void Alias_FlushCache ( void ) ;
2012-07-05 19:42:36 +00:00
void Alias_Shutdown ( void ) ;
2013-10-29 17:38:22 +00:00
void Alias_Register ( void ) ;
2014-10-05 20:04:11 +00:00
shader_t * Mod_ShaderForSkin ( model_t * model , int num ) ;
const char * Mod_SkinNameForNum ( model_t * model , int num ) ;
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 ) ;
2014-03-30 08:55:06 +00:00
qboolean QDECL Mod_LoadHLModel ( model_t * mod , void * buffer , size_t fsize ) ;
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 ) ;
2015-02-02 08:01:53 +00:00
# ifdef __cplusplus
} ;
# endif