return;
// if possible find the leaf the view origin is in
- viewleaf = model->brushq1.PointInLeaf ? model->brushq1.PointInLeaf(model, r_vieworigin) : NULL;
+ viewleaf = model->brush.PointInLeaf ? model->brush.PointInLeaf(model, r_vieworigin) : NULL;
// if possible fetch the visible cluster bits
if (model->brush.FatPVS)
model->brush.FatPVS(model, r_vieworigin, 2, r_pvsbits, sizeof(r_pvsbits));
mod->brush.FindNonSolidLocation = Mod_Q1BSP_FindNonSolidLocation;
mod->brush.AmbientSoundLevelsForPoint = Mod_Q1BSP_AmbientSoundLevelsForPoint;
mod->brush.RoundUpToHullSize = Mod_Q1BSP_RoundUpToHullSize;
- mod->brushq1.PointInLeaf = Mod_Q1BSP_PointInLeaf;
+ mod->brush.PointInLeaf = Mod_Q1BSP_PointInLeaf;
if (loadmodel->isworldmodel)
Cvar_SetValue("halflifebsp", mod->brush.ishlbsp);
mod->brush.BoxTouchingVisibleLeafs = Mod_Q1BSP_BoxTouchingVisibleLeafs;
mod->brush.LightPoint = Mod_Q3BSP_LightPoint;
mod->brush.FindNonSolidLocation = Mod_Q1BSP_FindNonSolidLocation;
+ mod->brush.PointInLeaf = Mod_Q1BSP_PointInLeaf;
mod->Draw = R_Q1BSP_Draw;
mod->GetLightInfo = R_Q1BSP_GetLightInfo;
mod->DrawShadowVolume = R_Q1BSP_DrawShadowVolume;
Mod_Q3BSP_LoadPVS(&header->lumps[Q3LUMP_PVS]);
loadmodel->brush.numsubmodels = loadmodel->brushq3.num_models;
+ // the MakePortals code works fine on the q3bsp data as well
+ Mod_Q1BSP_MakePortals();
+
// make a single combined shadow mesh to allow optimized shadow volume creation
numshadowmeshtriangles = 0;
for (j = 0, surface = loadmodel->brush.data_surfaces;j < loadmodel->brush.num_surfaces;j++, surface++)
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);
+ mleaf_t *(*PointInLeaf)(struct model_s *model, const float *p);
// these are actually only found on brushq1, but NULL is handled gracefully
void (*AmbientSoundLevelsForPoint)(struct model_s *model, const vec3_t p, qbyte *out, int outsize);
void (*RoundUpToHullSize)(struct model_s *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs);
int *light_stylevalue;
msurface_t ***light_styleupdatechains;
msurface_t **light_styleupdatechainsbuffer;
-
- mleaf_t *(*PointInLeaf)(struct model_s *model, const float *p);
}
model_brushq1_t;
vec3_t center, v1, v2;
// if there is no model, it can not block visibility
- if (model == NULL || !model->brushq1.PointInLeaf)
+ if (model == NULL || !model->brush.PointInLeaf)
return true;
portal_markid++;
Mod_CheckLoaded(model);
Portal_PolygonRecursiveMarkLeafs(model->brush.data_nodes, polypoints, numpoints);
- eyeleaf = model->brushq1.PointInLeaf(model, eye);
+ eyeleaf = model->brush.PointInLeaf(model, eye);
// find the center by averaging
VectorClear(center);