r5823 - trunk/data/qcsrc/client
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Feb 10 03:16:30 EST 2009
Author: div0
Date: 2009-02-10 03:16:12 -0500 (Tue, 10 Feb 2009)
New Revision: 5823
Modified:
trunk/data/qcsrc/client/projectile.qc
Log:
slight improvement for csqc rendered projectiles: draw only for 0.02s in a fixed spot when they spawn
Modified: trunk/data/qcsrc/client/projectile.qc
===================================================================
--- trunk/data/qcsrc/client/projectile.qc 2009-02-10 07:30:29 UTC (rev 5822)
+++ trunk/data/qcsrc/client/projectile.qc 2009-02-10 08:16:12 UTC (rev 5823)
@@ -69,7 +69,12 @@
{
vector rot;
vector trailorigin;
+ float f;
+ float drawn;
+ float t;
+ f = self.move_flags;
+
if(self.count & 0x80)
{
//self.move_flags &~= FL_ONGROUND;
@@ -82,8 +87,19 @@
InterpolateOrigin_Do();
}
- if(!(self.move_flags & FL_ONGROUND))
+ if(self.count & 0x80)
{
+ drawn = (time >= self.spawntime - 0.02);
+ t = max(time, self.spawntime);
+ }
+ else
+ {
+ drawn = !(self.iflags & IFLAG_VALID);
+ t = time;
+ }
+
+ if(!(f & FL_ONGROUND))
+ {
rot = '0 0 0';
switch(self.cnt)
{
@@ -101,7 +117,7 @@
default:
break;
}
- self.angles = AnglesTransform_Multiply(self.angles, rot * (time - self.spawntime));
+ self.angles = AnglesTransform_Multiply(self.angles, rot * (t - self.spawntime));
fixedmakevectors(self.angles);
@@ -115,9 +131,15 @@
default:
break;
}
- Projectile_DrawTrail(trailorigin);
+ if(drawn)
+ Projectile_DrawTrail(trailorigin);
+ else
+ self.trail_oldorigin = trailorigin;
}
+ if(!drawn)
+ return;
+
switch(self.cnt)
{
case PROJECTILE_BULLET_GLOWING:
@@ -129,8 +151,7 @@
self.renderflags = 0;
- if((self.count & 0x80) || (self.iflags & IFLAG_VALID))
- R_AddEntity(self);
+ R_AddEntity(self);
}
void loopsound(entity e, float ch, string samp, float vol, float attn)
More information about the nexuiz-commits
mailing list