typedef enum
{
- pt_dead, pt_static, pt_rain, pt_bubble, pt_blood, pt_grow, pt_decal, pt_decalfade, pt_ember
+ pt_dead, pt_static, pt_rain, pt_bubble, pt_blood, pt_grow, pt_decal, pt_ember
}
ptype_t;
CL_SparkShower
===============
*/
-void CL_SparkShower (vec3_t org, vec3_t dir, int count)
+void CL_SparkShower (vec3_t org, vec3_t dir, int count, vec_t gravityscale)
{
- vec3_t org2, org3;
int k;
- if (cl_stainmaps.integer)
- R_Stain(org, 32, 96, 96, 96, 24, 128, 128, 128, 24);
- CL_SpawnDecalParticleForPoint(org, 6, 3, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF);
-
if (!cl_particles.integer) return;
- if (cl_particles_bulletimpacts.integer)
+ if (cl_particles_sparks.integer)
{
- // smoke puff
- if (cl_particles_smoke.integer)
+ // sparks
+ count *= cl_particles_quality.value;
+ while(count--)
{
- k = count * 0.25 * cl_particles_quality.value;
- while(k--)
- {
- org2[0] = org[0] + 0.125f * lhrandom(-count, count);
- org2[1] = org[1] + 0.125f * lhrandom(-count, count);
- org2[2] = org[2] + 0.125f * lhrandom(-count, count);
- CL_TraceLine(org, org2, org3, NULL, true, NULL, SUPERCONTENTS_SOLID);
- particle(pt_grow, PARTICLE_BILLBOARD, 0x101010, 0x202020, tex_smoke[rand()&7], true, PBLEND_ADD, 3, 3, (1.0f / cl_particles_quality.value) * 255, (1.0f / cl_particles_quality.value) * 1024, 9999, -0.2, 0, org3[0], org3[1], org3[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(0, 16), 15, 0, 0, 0, 0.2, 0);
- }
+ k = particlepalette[0x68 + (rand() & 7)];
+ particle(pt_static, PARTICLE_SPARK, k, k, tex_particle, false, PBLEND_ADD, 0.4f, 0.015f, (1.0f / cl_particles_quality.value) * lhrandom(64, 255), (1.0f / cl_particles_quality.value) * 512, 9999, gravityscale, 0, org[0], org[1], org[2], lhrandom(-64, 64) + dir[0], lhrandom(-64, 64) + dir[1], lhrandom(0, 128) + dir[2], 0, 0, 0, 0, 0, 0);
}
+ }
+}
- if (cl_particles_sparks.integer)
+void CL_Smoke (vec3_t org, vec3_t dir, int count)
+{
+ vec3_t org2, org3;
+ int k;
+
+ if (!cl_particles.integer) return;
+
+ // smoke puff
+ if (cl_particles_smoke.integer)
+ {
+ k = count * 0.25 * cl_particles_quality.value;
+ while(k--)
{
- // sparks
- count *= cl_particles_quality.value;
- while(count--)
- {
- k = particlepalette[0x68 + (rand() & 7)];
- particle(pt_static, PARTICLE_SPARK, k, k, tex_particle, false, PBLEND_ADD, 0.4f, 0.015f, (1.0f / cl_particles_quality.value) * lhrandom(64, 255), (1.0f / cl_particles_quality.value) * 512, 9999, 1, 0, org[0], org[1], org[2], lhrandom(-64, 64) + dir[0], lhrandom(-64, 64) + dir[1], lhrandom(0, 128) + dir[2], 0, 0, 0, 0, 0.2, 0);
- }
+ org2[0] = org[0] + 0.125f * lhrandom(-count, count);
+ org2[1] = org[1] + 0.125f * lhrandom(-count, count);
+ org2[2] = org[2] + 0.125f * lhrandom(-count, count);
+ CL_TraceLine(org, org2, org3, NULL, true, NULL, SUPERCONTENTS_SOLID);
+ particle(pt_grow, PARTICLE_BILLBOARD, 0x101010, 0x202020, tex_smoke[rand()&7], true, PBLEND_ADD, 3, 3, (1.0f / cl_particles_quality.value) * 255, (1.0f / cl_particles_quality.value) * 1024, 9999, 0, 0, org3[0], org3[1], org3[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 15, 0, 0, 0, 0, 0);
}
}
}
+void CL_BulletMark (vec3_t org)
+{
+ if (cl_stainmaps.integer)
+ R_Stain(org, 32, 96, 96, 96, 24, 128, 128, 128, 24);
+ CL_SpawnDecalParticleForPoint(org, 6, 3, 255, tex_bulletdecal[rand()&7], 0xFFFFFF, 0xFFFFFF);
+}
+
void CL_PlasmaBurn (vec3_t org)
{
if (cl_stainmaps.integer)
Matrix4x4_Transform3x3(&hitent->inversematrix, normal, p->relativedirection);
VectorAdd(p->relativeorigin, p->relativedirection, p->relativeorigin);
#endif
- p->time2 = cl.time + cl_decals_time.value;
- p->die = p->time2 + cl_decals_fadetime.value;
+ p->time2 = cl.time;
+ p->die = p->time2 + cl_decals_time.value + cl_decals_fadetime.value;
p->alphafade = 0;
VectorCopy(normal, p->vel2);
VectorClear(p->vel);
p->scaley += frametime * p->time2;
break;
case pt_decal:
-#ifndef WORKINGLQUAKE
- if (p->owner->model == p->ownermodel)
- {
- Matrix4x4_Transform(&p->owner->matrix, p->relativeorigin, p->org);
- Matrix4x4_Transform3x3(&p->owner->matrix, p->relativedirection, p->vel2);
- if (cl.time > p->time2)
- {
- p->alphafade = p->alpha / (p->die - cl.time);
- p->type = pt_decalfade;
- }
- }
- else
- p->type = pt_dead;
-#endif
- break;
- case pt_decalfade:
+ p->alphafade = cl.time > (p->time2 + cl_decals_time.value) ? (p->alpha / cl_decals_fadetime.value) : 0;
#ifndef WORKINGLQUAKE
if (p->owner->model == p->ownermodel)
{
static cvar_t r_drawparticles = {0, "r_drawparticles", "1"};
-#define PARTICLETEXTURESIZE 32
+#define PARTICLETEXTURESIZE 64
#define PARTICLEFONTSIZE (PARTICLETEXTURESIZE*8)
static qbyte shadebubble(float dx, float dy, vec3_t light)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
#else
+
+#if 0
+ Image_WriteTGARGBA ("particles/particlefont.tga", PARTICLEFONTSIZE, PARTICLEFONTSIZE, particletexturedata);
+#endif
+
particlefonttexture = loadtextureimage(particletexturepool, "particles/particlefont.tga", 0, 0, false, TEXF_ALPHA | TEXF_PRECACHE);
if (!particlefonttexture)
particlefonttexture = R_LoadTexture2D(particletexturepool, "particlefont", PARTICLEFONTSIZE, PARTICLEFONTSIZE, particletexturedata, TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE, NULL);
{
c_particles++;
if (DotProduct(p->org, r_viewforward) >= minparticledist || p->orientation == PARTICLE_BEAM)
- R_MeshQueue_AddTransparent(p->org, R_DrawParticleCallback, p, 0);
+ {
+ if (p->type == pt_decal)
+ R_DrawParticleCallback(p, 0);
+ else
+ R_MeshQueue_AddTransparent(p->org, R_DrawParticleCallback, p, 0);
+ }
}
}
#endif