]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Optimize spawnpoint drawing further (there is no rendered entity to disable drawing on)
authorMario <mario.mario@y7mail.com>
Fri, 29 May 2020 12:07:18 +0000 (22:07 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 29 May 2020 12:07:18 +0000 (22:07 +1000)
qcsrc/client/main.qc

index 9f95530d105622516caae76cc1d6aadad7456445..909d1a2bcaa66fcc7c970c8e6e8b90e962732e5a 100644 (file)
@@ -673,14 +673,6 @@ NET_HANDLE(ENT_CLIENT_ACCURACY, bool isnew)
 }
 
 void Spawn_Draw(entity this)
-{
-       if(!this.alpha)
-               return;
-
-       __pointparticles(this.cnt, this.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1));
-}
-
-void Spawn_PreDraw(entity this)
 {
        bool dodraw = true;
        if(autocvar_cl_spawn_point_dist_max)
@@ -688,9 +680,9 @@ void Spawn_PreDraw(entity this)
                vector org = getpropertyvec(VF_ORIGIN);
                dodraw = vdist(org - this.origin, <, autocvar_cl_spawn_point_dist_max);
        }
-       //printf("%v <-> %v\n", view_origin, this.origin + 0.5 * (this.mins + this.maxs));
-       this.alpha = dodraw;
-       this.drawmask = (dodraw) ? MASK_NORMAL : 0;
+
+       if(dodraw)
+               __pointparticles(this.cnt, this.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1));
 }
 
 NET_HANDLE(ENT_CLIENT_SPAWNPOINT, bool is_new)
@@ -734,7 +726,6 @@ NET_HANDLE(ENT_CLIENT_SPAWNPOINT, bool is_new)
 
                        this.draw = Spawn_Draw;
                        if (is_new) IL_PUSH(g_drawables, this);
-                       setpredraw(this, Spawn_PreDraw);
                }
        //}