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 780609d5a9e507bc2ea8899ba4b0f2e9152ba0e1..f916e843af6120484cfc04fb6f2fa0d3f54d1ed1 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 e8e3073b80b02d6d1b9292d96820b9d28c71e3d5..348e4a1a6ebefd8b2820168fe2b65a2616a20d81 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 f395fb6a7ba99cc8f07df85034c4a0126bfb366a..78826f8f34925e63b7e38954d0ea623f2773ee8b 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 7652577321d18ad37c3fdb07da2c2b8a1d06f02e..1b546534919412bfb7f92bb48ac6d71ed00014d6 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 7e44a726c1e680ecc57ad2a424415ccc5efc6933..fb07b21b8fd18473dfdb9168d5b56b4342b5873d 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)