From 81fd1137aa988f67c3dd5f2b746140a4cd6e1748 Mon Sep 17 00:00:00 2001
From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Fri, 9 Feb 2007 03:26:24 +0000
Subject: [PATCH] made r_shadow_frontsidecasting cvar disable the portal
 culling features when it is casting from back sides (which portal culling
 can't work with)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6812 d7cf8633-e32d-0410-b094-e92efae38249
---
 gl_rsurf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gl_rsurf.c b/gl_rsurf.c
index f334200f..b929e924 100644
--- a/gl_rsurf.c
+++ b/gl_rsurf.c
@@ -774,12 +774,12 @@ void R_Q1BSP_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, floa
 		info.pvs = NULL;
 	R_UpdateAllTextureInfo(ent);
 
-	if (r_shadow_compilingrtlight && r_shadow_realtime_world_compileportalculling.integer)
+	if (r_shadow_frontsidecasting.integer && r_shadow_compilingrtlight && r_shadow_realtime_world_compileportalculling.integer)
 	{
 		// use portal recursion for exact light volume culling, and exact surface checking
 		Portal_Visibility(info.model, info.relativelightorigin, info.outleaflist, info.outleafpvs, &info.outnumleafs, info.outsurfacelist, info.outsurfacepvs, &info.outnumsurfaces, NULL, 0, true, info.lightmins, info.lightmaxs, info.outmins, info.outmaxs);
 	}
-	else if (r_shadow_realtime_dlight_portalculling.integer)
+	else if (r_shadow_frontsidecasting.integer && r_shadow_realtime_dlight_portalculling.integer)
 	{
 		// use portal recursion for exact light volume culling, but not the expensive exact surface checking
 		Portal_Visibility(info.model, info.relativelightorigin, info.outleaflist, info.outleafpvs, &info.outnumleafs, info.outsurfacelist, info.outsurfacepvs, &info.outnumsurfaces, NULL, 0, r_shadow_realtime_dlight_portalculling.integer >= 2, info.lightmins, info.lightmaxs, info.outmins, info.outmaxs);
-- 
2.39.5