From d282a5c75d9bb884ba450f46bed777fd869b5425 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 9 Sep 2010 06:54:55 +0000 Subject: [PATCH] fix two warpzone related PVS bugs git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10448 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=44eae3fb425b13b170cbb479017715bb03e9d30c --- gl_rmain.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index f5c18f60..7cae34d3 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -7811,7 +7811,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); @@ -7849,8 +7853,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; -- 2.39.2