qboolean ishlbsp;
// string of entity definitions (.map format)
char *entities;
+
+ // if non-zero this is a submodel
+ // (this is the number of the submodel, an index into submodels)
+ int submodel;
+
// number of submodels in this map (just used by server to know how many
// submodels to load)
int numsubmodels;
int num_leafbrushes;
int *data_leafbrushes;
- int num_leaffaces;
- int *data_leaffaces;
+ int num_leafsurfaces;
+ int *data_leafsurfaces;
int num_portals;
mportal_t *data_portals;
int num_portalpoints;
mvertex_t *data_portalpoints;
+ int num_textures;
+ texture_t *data_textures;
+
+ int num_surfaces;
+ msurface_t *data_surfaces;
+
+ int num_brushes;
+ q3mbrush_t *data_brushes;
+
+ int num_brushsides;
+ q3mbrushside_t *data_brushsides;
+
// pvs
int num_pvsclusters;
int num_pvsclusterbytes;
qbyte *(*GetPVS)(struct model_s *model, const vec3_t p);
int (*FatPVS)(struct model_s *model, const vec3_t org, vec_t radius, qbyte *pvsbuffer, int pvsbufferlength);
int (*BoxTouchingPVS)(struct model_s *model, const qbyte *pvs, const vec3_t mins, const vec3_t maxs);
+ int (*BoxTouchingVisibleLeafs)(struct model_s *model, const qbyte *visibleleafs, const vec3_t mins, const vec3_t maxs);
void (*LightPoint)(struct model_s *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal);
void (*FindNonSolidLocation)(struct model_s *model, const vec3_t in, vec3_t out, vec_t radius);
// these are actually only found on brushq1, but NULL is handled gracefully
int numtexinfo;
mtexinfo_t *texinfo;
- int numsurfaces;
- msurface_t *surfaces;
- msurface_t *surfacepvsnext;
-
int numsurfedges;
int *surfedges;
hull_t hulls[MAX_MAP_HULLS];
- int numtextures;
- texture_t *textures;
-
int num_compressedpvs;
qbyte *data_compressedpvs;
typedef struct model_brushq3_s
{
- // if non-zero this is a submodel
- // (this is the number of the submodel, an index into data_models)
- int submodel;
-
- int num_textures;
- q3mtexture_t *data_textures;
-
int num_models;
- q3mmodel_t *data_models;
- // each submodel gets its own model struct so this is different for each.
- q3mmodel_t *data_thismodel;
-
- int num_brushes;
- q3mbrush_t *data_brushes;
-
- int num_brushsides;
- q3mbrushside_t *data_brushsides;
+ q3dmodel_t *data_models;
// freed after loading!
int num_vertices;
int *data_element3i;
int num_effects;
- q3meffect_t *data_effects;
-
- int num_faces;
- q3msurface_t *data_faces;
+ q3deffect_t *data_effects;
// lightmap textures
int num_lightmaps;
// range of surface numbers in this (sub)model
int firstmodelsurface;
int nummodelsurfaces;
+ // range of collision brush numbers in this (sub)model
+ int firstmodelbrush;
+ int nummodelbrushes;
// list of surface numbers in this (sub)model
int *surfacelist;
// surface meshes are merged to a smaller set of meshes to allow reduced
// gathers info on which clusters and surfaces are lit by light, as well as calculating a bounding box
void(*GetLightInfo)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outclusterlist, qbyte *outclusterpvs, int *outnumclusterspointer, int *outsurfacelist, qbyte *outsurfacepvs, int *outnumsurfacespointer);
// draw a shadow volume for the model based on light source
- void(*DrawShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, int numsurfaces, const int *surfacelist);
+ void(*DrawShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
// draw the lighting on a model (through stencil)
void(*DrawLight)(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativeeyeorigin, float lightradius, float *lightcolor, const matrix4x4_t *matrix_modeltolight, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz, rtexture_t *lightcubemap, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int numsurfaces, const int *surfacelist);
// trace a box against this model
//============================================================================
// this can be used for anything without a valid texture
-extern rtexture_t *r_notexture;
+extern rtexture_t *r_texture_notexture;
#define NUM_DETAILTEXTURES 1
extern rtexture_t *mod_shared_detailtextures[NUM_DETAILTEXTURES];
// every texture must be in a pool...