X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fparticles.qc;h=8751cc0c5535c107d2e4de8b43d2f033c232e408;hb=bd85f2ce718e898726461e23dcb623f94c6be213;hp=b33b81a018ca982638304afd5edcc3e5adf753d3;hpb=5dc4bd363b8216f79266979e39a3cbb60a9ffe94;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc index b33b81a01..8751cc0c5 100644 --- a/qcsrc/client/particles.qc +++ b/qcsrc/client/particles.qc @@ -57,8 +57,8 @@ void Draw_PointParticles() } if(self.noise != "") { - self.origin = p; - sound(self, CHAN_TRIGGER, self.noise, VOL_BASE * self.volume, self.atten); + setorigin(self, p); + sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten); } self.just_toggled = 0; } @@ -68,7 +68,7 @@ void Draw_PointParticles() --i; } } - self.origin = o; + setorigin(self, o); } void Ent_PointParticles_Remove() @@ -191,12 +191,12 @@ void Ent_PointParticles() .float glow_color; // palette index void Draw_Rain() { - te_particlerain(self.origin + self.mins, self.origin + self.maxs, self.velocity, self.count * drawframetime, self.glow_color); + te_particlerain(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color); } void Draw_Snow() { - te_particlesnow(self.origin + self.mins, self.origin + self.maxs, self.velocity, self.count * drawframetime, self.glow_color); + te_particlesnow(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color); } void Ent_RainOrSnow() @@ -225,64 +225,6 @@ void Ent_RainOrSnow() self.draw = Draw_Snow; } -entity zcurve; -void zcurveparticles(float effectnum, vector start, vector end, float end_dz, float speed, float depth) -{ - // end_dz: - // IF IT WERE A STRAIGHT LINE, it'd end end_dz above end - - vector mid; - mid = (start + end) * 0.5; - - end_dz *= 0.25; - mid_z += end_dz; - - --depth; - if(depth < 0 || normalize(mid - start) * normalize(end - start) > 0.999999) - // TODO make this a variable threshold - // currently: 0.081 degrees - // 0.99999 would be 0.256 degrees and is visible - { - zcurve.velocity = speed * normalize(end - start); - trailparticles(zcurve, effectnum, start, end); - } - else - { - zcurveparticles(effectnum, start, mid, end_dz, speed, depth); - zcurveparticles(effectnum, mid, end, end_dz, speed, depth); - } -} - -void Net_ReadZCurveParticles() -{ - vector start, end; - float end_dz; - float effectnum, speed; - - if(!zcurve) - { - zcurve = spawn(); - zcurve.classname = "zcurve"; - } - - effectnum = ReadShort(); - - start_x = ReadCoord(); - start_y = ReadCoord(); - start_z = ReadCoord(); - - do - { - end_x = ReadCoord(); - end_y = ReadCoord(); - end_z = ReadCoord(); - end_dz = ReadCoord(); - speed = ReadShort(); - zcurveparticles(effectnum, start, end, end_dz, 16 * (speed & 0x7FFF), 5); // at most 32 segments - } - while(!(speed & 0x8000)); -} - void Net_ReadNexgunBeamParticle() { vector shotorg, endpos; @@ -290,14 +232,15 @@ void Net_ReadNexgunBeamParticle() shotorg_x = ReadCoord(); shotorg_y = ReadCoord(); shotorg_z = ReadCoord(); endpos_x = ReadCoord(); endpos_y = ReadCoord(); endpos_z = ReadCoord(); charge = ReadByte() / 255.0; - + pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1); - + //draw either the old v2.3 beam or the new beam charge = sqrt(charge); // divide evenly among trail spacing and alpha - particles_alphamin = particles_alphamax = charge; + particles_alphamin = particles_alphamax = particles_fade = charge; + if (autocvar_cl_particles_oldnexbeam && (getstati(STAT_ALLOW_OLDNEXBEAM) || isdemo())) - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, charge, 1); + WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); else - WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, charge, 1); + WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); }