From: Rudolf Polzer Date: Sat, 10 Mar 2012 10:56:41 +0000 (+0100) Subject: do PVS checking for warpzones as we don't support recursive ones. HUGE fps boost... X-Git-Tag: xonotic-v0.7.0~367 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=caaa6d2081b569d065b45f5b0bf336b5aa6a39bb;p=xonotic%2Fxonotic-data.pk3dir.git do PVS checking for warpzones as we don't support recursive ones. HUGE fps boost on augenkrebs. --- diff --git a/qcsrc/dpdefs/csprogsdefs.qc b/qcsrc/dpdefs/csprogsdefs.qc index 2d376d4fe..7b0644e3e 100644 --- a/qcsrc/dpdefs/csprogsdefs.qc +++ b/qcsrc/dpdefs/csprogsdefs.qc @@ -1426,3 +1426,4 @@ vector gettaginfo_offset; vector gettaginfo_forward; vector gettaginfo_right; vector gettaginfo_up; +float checkpvs(vector viewpos, entity viewee) = #240; diff --git a/qcsrc/warpzonelib/client.qc b/qcsrc/warpzonelib/client.qc index a44b37974..84bfe7b96 100644 --- a/qcsrc/warpzonelib/client.qc +++ b/qcsrc/warpzonelib/client.qc @@ -1,11 +1,11 @@ void WarpZone_Fade_PreDraw() { - if(self.warpzone_fadestart) - { - vector org; - org = getpropertyvec(VF_ORIGIN); + vector org; + org = getpropertyvec(VF_ORIGIN); + if(!checkpvs(org, self)) // this makes sense as long as we don't support recursive warpzones + self.alpha = 0; + else if(self.warpzone_fadestart) self.alpha = bound(0, (self.warpzone_fadeend - vlen(org - self.origin - 0.5 * (self.mins + self.maxs))) / (self.warpzone_fadeend - self.warpzone_fadestart), 1); - } else self.alpha = 1; //print(sprintf("%v <-> %v\n", view_origin, self.origin + 0.5 * (self.mins + self.maxs))); @@ -79,10 +79,7 @@ void WarpZone_Read(float isnew) // how to draw // engine currently wants this - if(self.warpzone_fadestart) - self.predraw = WarpZone_Fade_PreDraw; - else - self.drawmask = MASK_NORMAL; + self.predraw = WarpZone_Fade_PreDraw; } void WarpZone_Camera_Read(float isnew) @@ -139,10 +136,7 @@ void WarpZone_Camera_Read(float isnew) // how to draw // engine currently wants this - if(self.warpzone_fadestart) - self.predraw = WarpZone_Fade_PreDraw; - else - self.drawmask = MASK_NORMAL; + self.predraw = WarpZone_Fade_PreDraw; } void CL_RotateMoves(vector ang) = #638;