speed up more csqc ent drawing
authorRudolf Polzer <divverent@alientrap.org>
Fri, 15 Oct 2010 16:43:20 +0000 (18:43 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 15 Oct 2010 16:43:20 +0000 (18:43 +0200)
qcsrc/client/Main.qc
qcsrc/client/casings.qc
qcsrc/client/gibs.qc
qcsrc/client/modeleffects.qc
qcsrc/client/projectile.qc

index 780609d..f916e84 100644 (file)
@@ -440,7 +440,9 @@ void ShotOrg_Draw()
        self.angles = view_angles;
        self.angles_x = -self.angles_x;
        if not(self.cnt)
        self.angles = view_angles;
        self.angles_x = -self.angles_x;
        if not(self.cnt)
-               R_AddEntity(self);
+               self.drawmask = MASK_NORMAL;
+       else
+               self.drawmask = 0;
 }
 void ShotOrg_Draw2D()
 {
 }
 void ShotOrg_Draw2D()
 {
@@ -487,11 +489,12 @@ void DrawDebugModel()
        if(time - floor(time) > 0.5)
        {
                PolyDrawModel(self);
        if(time - floor(time) > 0.5)
        {
                PolyDrawModel(self);
+               self.drawmask = 0;
        }
        else
        {
                self.renderflags = 0;
        }
        else
        {
                self.renderflags = 0;
-               R_AddEntity(self);
+               self.drawmask = MASK_NORMAL;
        }
 }
 
        }
 }
 
index e8e3073..348e4a1 100644 (file)
@@ -20,9 +20,10 @@ void Casing_Draw()
        self.alpha = bound(0, self.cnt - time, 1);
 
        if(self.alpha < ALPHA_MIN_VISIBLE)
        self.alpha = bound(0, self.cnt - time, 1);
 
        if(self.alpha < ALPHA_MIN_VISIBLE)
+       {
                Casing_Delete();
                Casing_Delete();
-       else
-               R_AddEntity(self);
+               self.drawmask = 0;
+       }
 }
 
 void Casing_Touch()
 }
 
 void Casing_Touch()
@@ -85,6 +86,7 @@ void Ent_Casing(float isNew)
        casing.angles_x = ReadByte() * 360 / 256;
        casing.angles_y = ReadByte() * 360 / 256;
        casing.angles_z = ReadByte() * 360 / 256;
        casing.angles_x = ReadByte() * 360 / 256;
        casing.angles_y = ReadByte() * 360 / 256;
        casing.angles_z = ReadByte() * 360 / 256;
+       casing.drawmask = MASK_NORMAL;
 
        if(cvar("cl_casings") && isNew) {
                casing.draw = Casing_Draw;
 
        if(cvar("cl_casings") && isNew) {
                casing.draw = Casing_Draw;
index f395fb6..78826f8 100644 (file)
@@ -97,9 +97,10 @@ void Gib_Draw()
        self.alpha = bound(0, self.nextthink - time, 1);
 
        if(self.alpha < ALPHA_MIN_VISIBLE)
        self.alpha = bound(0, self.nextthink - time, 1);
 
        if(self.alpha < ALPHA_MIN_VISIBLE)
+       {
+               self.drawmask = 0;
                Gib_Delete();
                Gib_Delete();
-       else
-               R_AddEntity(self);
+       }
 }
 
 void TossGib (string mdlname, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent)
 }
 
 void TossGib (string mdlname, vector org, vector vconst, vector vrand, float specnum, float destroyontouch, float issilent)
@@ -130,6 +131,7 @@ void TossGib (string mdlname, vector org, vector vconst, vector vrand, float spe
        gib.damageforcescale = cvar_or("cl_gibs_damageforcescale", 3.5);
 
        gib.nextthink = time + cvar_or("cl_gibs_lifetime", 14) * (1 + prandom() * 0.15);
        gib.damageforcescale = cvar_or("cl_gibs_damageforcescale", 3.5);
 
        gib.nextthink = time + cvar_or("cl_gibs_lifetime", 14) * (1 + prandom() * 0.15);
+       gib.drawmask = MASK_NORMAL;
 
        RubbleLimit("gib", cvar_or("cl_gibs_maxcount",100), Gib_Delete);
 }
 
        RubbleLimit("gib", cvar_or("cl_gibs_maxcount",100), Gib_Delete);
 }
index 7652577..1b54653 100644 (file)
@@ -14,9 +14,12 @@ void ModelEffect_Draw()
                remove(self);
                return;
        }
                remove(self);
                return;
        }
+       self.drawmask = MASK_NORMAL;
        if(self.scale <= 0)
        if(self.scale <= 0)
+       {
+               self.drawmask = 0;
                return;
                return;
-       R_AddEntity(self);
+       }
 }
 
 void Ent_ModelEffect(float isNew)
 }
 
 void Ent_ModelEffect(float isNew)
index 7e44a72..fb07b21 100644 (file)
@@ -154,7 +154,7 @@ void Projectile_Draw()
                        break;
        }
 
                        break;
        }
 
-       self.drawmask = DRAWMASK_NORMAL;
+       self.drawmask = MASK_NORMAL;
 }
 
 void loopsound(entity e, float ch, string samp, float vol, float attn)
 }
 
 void loopsound(entity e, float ch, string samp, float vol, float attn)