]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix two warpzone related PVS bugs
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Sep 2010 06:54:55 +0000 (06:54 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Sep 2010 06:54:55 +0000 (06:54 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10448 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index b29beb5fd8bbd1d13923153bb13db57bb8464a1e..67f45bb68bd6c64e2d70cb223be35d25bed0bbc4 100644 (file)
@@ -8773,7 +8773,11 @@ static void R_Water_ProcessPlanes(void)
                                r_waterstate.renderingrefraction = false; // we don't want to hide the player model from these ones
                                CL_VM_TransformView(p->camera_entity - MAX_EDICTS, &r_refdef.view.matrix, &r_refdef.view.clipplane, visorigin);
                                R_RenderView_UpdateViewVectors();
-                               r_refdef.scene.worldmodel->brush.FatPVS(r_refdef.scene.worldmodel, visorigin, 2, r_refdef.viewcache.world_pvsbits, (r_refdef.viewcache.world_numclusters+7)>>3, false);
+                               if(r_refdef.scene.worldmodel && r_refdef.scene.worldmodel->brush.FatPVS)
+                               {
+                                       r_refdef.view.usecustompvs = true;
+                                       r_refdef.scene.worldmodel->brush.FatPVS(r_refdef.scene.worldmodel, visorigin, 2, r_refdef.viewcache.world_pvsbits, (r_refdef.viewcache.world_numclusters+7)>>3, false);
+                               }
                        }
 
                        PlaneClassify(&r_refdef.view.clipplane);
@@ -8811,8 +8815,11 @@ static void R_Water_ProcessPlanes(void)
                        // also reverse the view matrix
                        Matrix4x4_ConcatScale3(&r_refdef.view.matrix, 1, 1, -1); // this serves to invert texcoords in the result, as the copied texture is mapped the wrong way round
                        R_RenderView_UpdateViewVectors();
-                       if(p->camera_entity)
+                       if(p->camera_entity && r_refdef.scene.worldmodel && r_refdef.scene.worldmodel->brush.FatPVS)
+                       {
+                               r_refdef.view.usecustompvs = true;
                                r_refdef.scene.worldmodel->brush.FatPVS(r_refdef.scene.worldmodel, visorigin, 2, r_refdef.viewcache.world_pvsbits, (r_refdef.viewcache.world_numclusters+7)>>3, false);
+                       }
                        
                        // camera needs no clipplane
                        r_refdef.view.useclipplane = false;