From 0a78b36e77a12265c367bfa0bb716ff457942cdd Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 29 May 2020 22:07:18 +1000 Subject: [PATCH] Optimize spawnpoint drawing further (there is no rendered entity to disable drawing on) --- qcsrc/client/main.qc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 9f95530d1..909d1a2bc 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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); } //} -- 2.39.2