#define MAX_SKINS 256
+#define SHADOWMESHVERTEXHASH 1024
+typedef struct shadowmeshvertexhash_s
+{
+ struct shadowmeshvertexhash_s *next;
+}
+shadowmeshvertexhash_t;
+
typedef struct shadowmesh_s
{
struct shadowmesh_s *next;
float *verts;
int *elements;
int *neighbors;
+ // these are NULL after Mod_ShadowMesh_Finish is performed, only used
+ // while building meshes
+ shadowmeshvertexhash_t **vertexhashtable, *vertexhashentries;
}
shadowmesh_t;
qboolean isworldmodel;
// true if this model is a HalfLife .bsp file
qboolean ishlbsp;
+ // true if this model was not successfully loaded and should be purged
+ qboolean error;
// mod_brush, mod_alias, mod_sprite
modtype_t type;
int numtextures;
texture_t *textures;
- msurface_t **texturesurfacechains;
-
qbyte *visdata;
qbyte *lightdata;
char *entities;
int numlights;
mlight_t *lights;
- // used only for casting dynamic shadow volumes
- shadowmesh_t *shadowmesh;
- vec3_t shadowmesh_mins, shadowmesh_maxs, shadowmesh_center;
- float shadowmesh_radius;
-
// pvs visibility marking
mleaf_t *pvsviewleaf;
int pvsviewleafnovis;
mleaf_t *pvsleafchain;
int *pvssurflist;
int pvssurflistlength;
+ // these get rebuilt as the player moves around if this is the world,
+ // otherwise they are left alone (no pvs for bmodels)
+ msurface_t ***pvstexturechains;
+ msurface_t **pvstexturechainsbuffer;
+ int *pvstexturechainslength;
+
+ // lightmap update chains for light styles
+ int light_styles;
+ qbyte *light_style;
+ int *light_stylevalue;
+ msurface_t ***light_styleupdatechains;
+ msurface_t **light_styleupdatechainsbuffer;
+ int light_scalebit;
+ float light_ambient;
// skin animation info
animscene_t *skinscenes; // [numskins]
void Mod_Init (void);
void Mod_CheckLoaded (model_t *mod);
void Mod_ClearAll (void);
+void Mod_ClearErrorModels (void);
model_t *Mod_FindName (const char *name);
model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
void Mod_TouchModel (const char *name);