X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=model_shared.h;h=0955d56f84c43e30b1198c42e759720d88578088;hp=d3a701a792545c0cc6b076c1eba9381e83fef611;hb=e411cc7d14dad08cbbe27f5b3af86700f7eb5184;hpb=855932aeb5707c5efb2858c3e51b913d8203ebbe diff --git a/model_shared.h b/model_shared.h index d3a701a7..0955d56f 100644 --- a/model_shared.h +++ b/model_shared.h @@ -35,6 +35,19 @@ m*_t structures are in-memory typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t; +typedef struct animscene_s +{ + char name[32]; // for viewthing support + int firstframe; + int framecount; + int loop; // true or false + float framerate; +} +animscene_t; + +#define MAX_SKINS 256 + + #include "model_brush.h" #include "model_sprite.h" #include "model_alias.h" @@ -42,7 +55,7 @@ typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t; typedef struct model_s { char name[MAX_QPATH]; - qboolean needload; // bmodels and sprites don't cache normally + qboolean needload; // bmodels don't cache normally modtype_t type; int aliastype; // LordHavoc: Q2 model support @@ -105,33 +118,55 @@ typedef struct model_s byte *lightdata; char *entities; + int numportals; + mportal_t *portals; + + int numportalpoints; + mvertex_t *portalpoints; + // LordHavoc: useful for sprites and models int numtris; int numskins; - int skinanimrange[1024]; // array of start and length pairs, note: offset from ->cache.data - int skinanim[1024*5]; // texture numbers for each frame (indexed by animrange), note: offset from ->cache.data, second note: normal pants shirt glow body (normal contains no shirt/pants/glow colors and body is normal + pants + shirt, but not glow) + int skinanimrange[MAX_SKINS*2]; // array of start and length pairs + rtexture_t *skinanim[MAX_SKINS*5]; // texture numbers for each frame (indexed by animrange), note: normal pants shirt glow body (normal contains no shirt/pants/glow colors and body is normal + pants + shirt, but not glow) + int ofs_scenes; // offset from Mod_ExtraData(model) memory to array of animscene_t structs + // these are used simply to simplify model/sprite/whatever processing and are specific to each type + int ofs_frames; // offset from Mod_ExtraData(model) memory to array of model specific frame structs + int framesize; // size of model specific frame structs // additional model data cache_user_t cache; // only access through Mod_Extradata + int cachesize; // size of cached data (zero if not cached) } model_t; //============================================================================ -void Mod_Init (void); -void Mod_ClearAll (void); +// used to avoid setting up submodels in non-world bmodels +extern qboolean isworldmodel; +// model loading +extern model_t *loadmodel; +extern byte *mod_base; +// sky/water subdivision +extern cvar_t gl_subdivide_size; +// texture fullbrights +extern cvar_t r_fullbrights; + +void Mod_Init (void); +void Mod_ClearAll (void); model_t *Mod_ForName (char *name, qboolean crash); -void *Mod_Extradata (model_t *mod); // handles caching -void Mod_TouchModel (char *name); +void *Mod_Extradata (model_t *mod); // handles caching +void Mod_TouchModel (char *name); mleaf_t *Mod_PointInLeaf (float *p, model_t *model); -byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model); +byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model); -extern model_t *loadmodel; -extern char loadname[32]; // for hunk tags +extern model_t *loadmodel; +extern char loadname[32]; // for hunk tags extern model_t *Mod_LoadModel (model_t *mod, qboolean crash); extern float RadiusFromBounds (vec3_t mins, vec3_t maxs); extern model_t *Mod_FindName (char *name); + #endif // __MODEL__