]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_particles.c
use volatile on icolor and fcolor pointers in GL_ConvertColorsFloatToByte to avoid...
[xonotic/darkplaces.git] / cl_particles.c
index 4bc57357f5c9af27c4f06501f206d88f6c889d7a..660ab4a46e8d7583597d9efd42cf2de07c779714 100644 (file)
@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
 #include "quakedef.h"
+#include "cl_collision.h"
 
 #define MAX_PARTICLES                  16384   // default max # of particles at one time
 #define ABSOLUTE_MIN_PARTICLES 512             // no fewer than this no matter what's on the command line
@@ -385,7 +386,7 @@ void CL_ParticleExplosion (vec3_t org, int smoke)
                                {
                                        VectorRandom(v);
                                        VectorMA(org, 16, v, v);
-                                       TraceLine(org, v, end, NULL, 0, true);
+                                       CL_TraceLine(org, v, end, NULL, 0, true);
                                        ang[0] = (j + 0.5f) * (360.0f / 32.0f);
                                        ang[1] = (i + 0.5f) * (360.0f / 32.0f);
                                        AngleVectors(ang, v, NULL, NULL);
@@ -410,7 +411,7 @@ void CL_ParticleExplosion (vec3_t org, int smoke)
                                {
                                        VectorRandom(v);
                                        VectorMA(org, 16, v, v);
-                                       TraceLine(org, v, end, NULL, 0, true);
+                                       CL_TraceLine(org, v, end, NULL, 0, true);
                                        ang[0] = (j + 0.5f) * (360.0f / 32.0f);
                                        ang[1] = (i + 0.5f) * (360.0f / 32.0f);
                                        AngleVectors(ang, v, NULL, NULL);
@@ -712,6 +713,8 @@ void CL_FlameCube (vec3_t mins, vec3_t maxs, int count)
        {
                k = particlepalette[224 + (rand()&15)];
                particle(pt_flame, PARTICLE_BILLBOARD, k, k, tex_particle, false, true, 4, 4, lhrandom(64, 128), 9999, 0, lhrandom(mins[0], maxs[0]), lhrandom(mins[1], maxs[1]), lhrandom(mins[2], maxs[2]), lhrandom(-32, 32), lhrandom(-32, 32), lhrandom(0, 64), 0, 0, 0, 0, 1, 0);
+               if (count & 1)
+                       particle(pt_fade, PARTICLE_BILLBOARD, 0x303030, 0x606060, tex_smoke[rand()&7], false, true, 6, 6, lhrandom(48, 96), 9999, 0, lhrandom(mins[0], maxs[0]), lhrandom(mins[1], maxs[1]), lhrandom(mins[2], maxs[2]), lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(0, 32), 64.0f, 0, 0, 0, 0, 0);
        }
 }
 
@@ -724,6 +727,8 @@ void CL_Flames (vec3_t org, vec3_t vel, int count)
        {
                k = particlepalette[224 + (rand()&15)];
                particle(pt_flame, PARTICLE_BILLBOARD, k, k, tex_particle, false, true, 4, 4, lhrandom(64, 128), 9999, 1.1, org[0], org[1], org[2], vel[0] + lhrandom(-128, 128), vel[1] + lhrandom(-128, 128), vel[2] + lhrandom(-128, 128), 0, 0, 0, 0, 1, 0);
+               //if (count & 1)
+               //      particle(pt_fade, PARTICLE_BILLBOARD, 0x202020, 0x404040, tex_smoke[rand()&7], false, true, 6, 6, lhrandom(32, 64), 9999, 0, org[0], org[1], org[2], vel[0] + lhrandom(-64, 64), vel[1] + lhrandom(-64, 64), vel[2] + lhrandom(-64, 64), 64.0f, 0, 0, 0, 0, 0);
        }
 }
 
@@ -974,7 +979,7 @@ void CL_MoveParticles (void)
                VectorCopy(p->org, org);
                if (p->bounce)
                {
-                       if (TraceLine(p->oldorg, p->org, v, normal, 0, true) < 1)
+                       if (CL_TraceLine(p->oldorg, p->org, v, normal, 0, true) < 1)
                        {
                                VectorCopy(v, p->org);
                                if (p->bounce < 0)
@@ -1211,7 +1216,7 @@ void CL_MoveParticles (void)
                        {
                                a = b;
                                f = TraceLine(o, p->org, v, normal, a, true);
-                               b = traceline_endcontents;
+                               b = cl_traceline_endcontents;
                                if (f < 1 && b != CONTENTS_EMPTY && b != CONTENTS_SKY)
                                {
                                        #if 1