]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_particles.c
Tried to be a little smarter with the heartbeats, using a simple priority mecanism...
[xonotic/darkplaces.git] / cl_particles.c
index 30a799c0dd53802a9e24b0d0588a9008b01f542e..97accb552deee570bc67d46b711d3d4f4414c4c1 100644 (file)
@@ -157,7 +157,7 @@ void VectorVectors(const vec3_t forward, vec3_t right, vec3_t up)
 
 typedef enum
 {
-       pt_static, pt_rain, pt_bubble, pt_blood
+       pt_static, pt_rain, pt_bubble, pt_blood, pt_grow
 }
 ptype_t;
 
@@ -652,7 +652,7 @@ void CL_SparkShower (vec3_t org, vec3_t dir, int count)
                        k = count / 4;
                        while(k--)
                        {
-                               particle(pt_static, PARTICLE_BILLBOARD, 0x101010, 0x202020, tex_smoke[rand()&7], true, true, 4, 4, 255, 1024, 9999, -0.2, 0, org[0] + 0.125f * lhrandom(-count, count), org[1] + 0.125f * lhrandom (-count, count), org[2] + 0.125f * lhrandom(-count, count), lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(0, 16), 0, 0, 0, 0, 0, 0);
+                               particle(pt_grow, PARTICLE_BILLBOARD, 0x101010, 0x202020, tex_smoke[rand()&7], true, true, 3, 3, 255, 1024, 9999, -0.2, 0, org[0] + 0.125f * lhrandom(-count, count), org[1] + 0.125f * lhrandom (-count, count), org[2] + 0.125f * lhrandom(-count, count), lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(0, 16), 15, 0, 0, 0, 0, 0);
                        }
                }
 
@@ -960,7 +960,7 @@ void CL_RocketTrail (vec3_t start, vec3_t end, int type, entity_t *ent)
                                dec = 3;
                                if (smoke)
                                {
-                                       particle(pt_static, PARTICLE_BILLBOARD, 0x303030, 0x606060, tex_smoke[rand()&7], false, true, dec, dec, 32, 64, 9999, 0, 0, pos[0], pos[1], pos[2], lhrandom(-5, 5), lhrandom(-5, 5), lhrandom(-5, 5), 0, 0, 0, 0, 0, 0);
+                                       particle(pt_grow,   PARTICLE_BILLBOARD, 0x303030, 0x606060, tex_smoke[rand()&7], false, true, dec, dec, 32, 64, 9999, 0, 0, pos[0], pos[1], pos[2], lhrandom(-5, 5), lhrandom(-5, 5), lhrandom(-5, 5), 6, 0, 0, 0, 0, 0);
                                        particle(pt_static, PARTICLE_BILLBOARD, 0x801010, 0xFFA020, tex_smoke[rand()&7], false, true, dec, dec, 128, 768, 9999, 0, 0, pos[0], pos[1], pos[2], lhrandom(-20, 20), lhrandom(-20, 20), lhrandom(-20, 20), 0, 0, 0, 0, 0, 0);
                                }
                                if (bubbles)
@@ -1172,6 +1172,10 @@ void CL_MoveParticles (void)
                                if (a != CONTENTS_EMPTY && a != CONTENTS_SKY)
                                        p->die = -1;
                                break;
+                       case pt_grow:
+                               p->scalex += frametime * p->time2;
+                               p->scaley += frametime * p->time2;
+                               break;
                        default:
                                printf("unknown particle type %i\n", p->type);
                                p->die = -1;
@@ -1500,10 +1504,6 @@ void R_DrawParticleCallback(const void *calldata1, int calldata2)
        cg *= r_colorscale;
        cb *= r_colorscale;
 
-       varray_color[ 0] = varray_color[ 4] = varray_color[ 8] = varray_color[12] = cr;
-       varray_color[ 1] = varray_color[ 5] = varray_color[ 9] = varray_color[13] = cg;
-       varray_color[ 2] = varray_color[ 6] = varray_color[10] = varray_color[14] = cb;
-       varray_color[ 3] = varray_color[ 7] = varray_color[11] = varray_color[15] = ca;
        varray_texcoord[0][0] = tex->s2;varray_texcoord[0][1] = tex->t1;
        varray_texcoord[0][2] = tex->s1;varray_texcoord[0][3] = tex->t1;
        varray_texcoord[0][4] = tex->s1;varray_texcoord[0][5] = tex->t2;
@@ -1569,6 +1569,7 @@ void R_DrawParticleCallback(const void *calldata1, int calldata2)
        glTexCoord2f(tex->s2, tex->t2);glVertex3f(varray_vertex[12], varray_vertex[13], varray_vertex[14]);
        glEnd();
 #else
+       GL_Color(cr, cg, cb, ca);
        R_Mesh_Draw(4, 2, polygonelements);
 #endif
 }