]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed noclipping rendering nothing (there was no vis update)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 5 Mar 2004 02:27:13 +0000 (02:27 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 5 Mar 2004 02:27:13 +0000 (02:27 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3972 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index 157e4a43bd97934b59725472413125139b0fcd58..f843dbb1ae9c7d7d7abbfb315e78c00e4fc573f1 100644 (file)
@@ -2738,6 +2738,21 @@ static void Mod_Q1BSP_BuildPVSTextureChains(model_t *model)
        }
 }
 
+//Returns PVS data for a given point
+//(note: can return NULL)
+static qbyte *Mod_Q1BSP_GetPVS(model_t *model, const vec3_t p)
+{
+       mnode_t *node;
+       Mod_CheckLoaded(model);
+       node = model->brushq1.nodes;
+       while (node->plane)
+               node = node->children[(node->plane->type < 3 ? p[node->plane->type] : DotProduct(p,node->plane->normal)) < node->plane->dist];
+       if (((mleaf_t *)node)->clusterindex >= 0)
+               return model->brush.data_pvsclusters + ((mleaf_t *)node)->clusterindex * model->brush.num_pvsclusterbytes;
+       else
+               return NULL;
+}
+
 static void Mod_Q1BSP_FatPVS_RecursiveBSPNode(model_t *model, const vec3_t org, vec_t radius, qbyte *pvsbuffer, int pvsbytes, mnode_t *node)
 {
        while (node->plane)
@@ -2770,7 +2785,7 @@ static int Mod_Q1BSP_FatPVS(model_t *model, const vec3_t org, vec_t radius, qbyt
 {
        int bytes = ((model->brushq1.num_leafs - 1) + 7) >> 3;
        bytes = min(bytes, pvsbufferlength);
-       if (r_novis.integer)
+       if (r_novis.integer || !Mod_Q1BSP_GetPVS(model, org))
        {
                memset(pvsbuffer, 0xFF, bytes);
                return bytes;
@@ -2780,21 +2795,6 @@ static int Mod_Q1BSP_FatPVS(model_t *model, const vec3_t org, vec_t radius, qbyt
        return bytes;
 }
 
-//Returns PVS data for a given point
-//(note: can return NULL)
-static qbyte *Mod_Q1BSP_GetPVS(model_t *model, const vec3_t p)
-{
-       mnode_t *node;
-       Mod_CheckLoaded(model);
-       node = model->brushq1.nodes;
-       while (node->plane)
-               node = node->children[(node->plane->type < 3 ? p[node->plane->type] : DotProduct(p,node->plane->normal)) < node->plane->dist];
-       if (((mleaf_t *)node)->clusterindex >= 0)
-               return model->brush.data_pvsclusters + ((mleaf_t *)node)->clusterindex * model->brush.num_pvsclusterbytes;
-       else
-               return NULL;
-}
-
 static void Mod_Q1BSP_RoundUpToHullSize(model_t *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs)
 {
        vec3_t size;
@@ -5390,7 +5390,7 @@ static int Mod_Q3BSP_FatPVS(model_t *model, const vec3_t org, vec_t radius, qbyt
 {
        int bytes = model->brush.num_pvsclusterbytes;
        bytes = min(bytes, pvsbufferlength);
-       if (r_novis.integer || !loadmodel->brush.num_pvsclusters)
+       if (r_novis.integer || !loadmodel->brush.num_pvsclusters || !Mod_Q3BSP_GetPVS(model, org))
        {
                memset(pvsbuffer, 0xFF, bytes);
                return bytes;