]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
do PVS checking for warpzones as we don't support recursive ones. HUGE fps boost...
authorRudolf Polzer <divverent@xonotic.org>
Sat, 10 Mar 2012 10:56:41 +0000 (11:56 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 10 Mar 2012 10:56:41 +0000 (11:56 +0100)
qcsrc/dpdefs/csprogsdefs.qc
qcsrc/warpzonelib/client.qc

index 2d376d4fe41cf0f16832856850e3239cda1b72f5..7b0644e3e83ebee82c888d3ad6ce4140a90e7c74 100644 (file)
@@ -1426,3 +1426,4 @@ vector gettaginfo_offset;
 vector gettaginfo_forward;
 vector gettaginfo_right;
 vector gettaginfo_up;
+float checkpvs(vector viewpos, entity viewee) = #240;
index a44b3797451b73453fcbe482546827c2d071d0e6..84bfe7b96d9c7ab7e8da6041d4ba3ec74bb6bcd1 100644 (file)
@@ -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;