2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 typedef enum {ST_SYNC=0, ST_RAND } synctype_t;
31 d*_t structures are on-disk representations
32 m*_t structures are in-memory
36 typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
38 typedef struct animscene_s
40 char name[32]; // for viewthing support
43 int loop; // true or false
51 #include "model_brush.h"
52 #include "model_sprite.h"
53 #include "model_alias.h"
55 typedef struct model_s
58 qboolean needload; // bmodels don't cache normally
61 int aliastype; // LordHavoc: Q2 model support
62 int fullbright; // LordHavoc: if true (normally only for sprites) the model/sprite/bmodel is always rendered fullbright
68 // volume occupied by the model graphics
72 // solid volume for clipping
74 vec3_t clipmins, clipmaxs;
77 int firstmodelsurface, nummodelsurfaces;
85 int numleafs; // number of visible leafs, not counting 0
101 msurface_t *surfaces;
107 dclipnode_t *clipnodes;
110 msurface_t **marksurfaces;
112 hull_t hulls[MAX_MAP_HULLS];
115 texture_t **textures;
125 mvertex_t *portalpoints;
127 // LordHavoc: useful for sprites and models
130 int skinanimrange[MAX_SKINS*2]; // array of start and length pairs
131 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)
132 int ofs_scenes; // offset from Mod_ExtraData(model) memory to array of animscene_t structs
133 // these are used simply to simplify model/sprite/whatever processing and are specific to each type
134 int ofs_frames; // offset from Mod_ExtraData(model) memory to array of model specific frame structs
135 int framesize; // size of model specific frame structs
137 // additional model data
138 cache_user_t cache; // only access through Mod_Extradata
139 int cachesize; // size of cached data (zero if not cached)
143 //============================================================================
145 void Mod_Init (void);
146 void Mod_ClearAll (void);
147 model_t *Mod_ForName (char *name, qboolean crash);
148 void *Mod_Extradata (model_t *mod); // handles caching
149 void Mod_TouchModel (char *name);
151 mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
152 byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
154 extern model_t *loadmodel;
155 extern char loadname[32]; // for hunk tags
157 extern model_t *Mod_LoadModel (model_t *mod, qboolean crash);
159 extern float RadiusFromBounds (vec3_t mins, vec3_t maxs);
160 extern model_t *Mod_FindName (char *name);