}
#else
#include "cl_collision.h"
+#include "image.h"
#endif
#define MAX_PARTICLES 32768 // default max # of particles at one time
typedef enum
{
- pt_dead, pt_static, pt_rain, pt_bubble, pt_blood, pt_grow, pt_decal, pt_decalfade
+ pt_dead, pt_static, pt_rain, pt_bubble, pt_blood, pt_grow, pt_decal, pt_decalfade, pt_ember
}
ptype_t;
{
cl_numparticles = 0;
cl_freeparticle = 0;
+ memset(particles, 0, sizeof(particle_t) * cl_maxparticles);
}
/*
#ifdef WORKINGLQUAKE
particles = (particle_t *) Hunk_AllocName(cl_maxparticles * sizeof(particle_t), "particles");
#else
- cl_part_mempool = Mem_AllocPool("CL_Part");
+ cl_part_mempool = Mem_AllocPool("CL_Part", 0, NULL);
particles = (particle_t *) Mem_Alloc(cl_part_mempool, cl_maxparticles * sizeof(particle_t));
#endif
- cl_numparticles = 0;
- cl_freeparticle = 0;
+ CL_Particles_Clear();
}
// list of all 26 parameters:
*/
void CL_ParticleExplosion (vec3_t org)
{
- int i, k;
+ int i;
//vec3_t v;
//vec3_t v2;
if (cl_stainmaps.integer)
}
*/
+#if 1
+ if (cl_particles.integer && cl_particles_sparks.integer)
+ for (i = 0;i < 128 * cl_particles_quality.value;i++)
+ particle(pt_static, PARTICLE_SPARK, 0x903010, 0xFFD030, tex_particle, false, PBLEND_ADD, 1.0f, 0.02f, (1.0f / cl_particles_quality.value) * lhrandom(0, 255), (1.0f / cl_particles_quality.value) * 512, 9999, 1, 0, org[0], org[1], org[2], lhrandom(-256, 256), lhrandom(-256, 256), lhrandom(-256, 256) + 80, 0, 0, 0, 0, 0.2, 0);
+ }
+
+ //if (cl_explosions.integer)
+ // R_NewExplosion(org);
+#elif 1
+ if (cl_particles.integer && cl_particles_sparks.integer)
+ for (i = 0;i < 64 * cl_particles_quality.value;i++)
+ particle(pt_ember, PARTICLE_SPARK, 0x903010, 0xFFD030, tex_particle, false, PBLEND_ADD, 1.0f, 0.01f, (1.0f / cl_particles_quality.value) * lhrandom(0, 255), (1.0f / cl_particles_quality.value) * 256, 9999, 0.7, 0, org[0], org[1], org[2], lhrandom(-256, 256), lhrandom(-256, 256), lhrandom(-256, 256) + 80, cl.time, 0, 0, 0, 0, 0);
+ }
+
+ //if (cl_explosions.integer)
+ // R_NewExplosion(org);
+#else
if (cl_particles.integer && cl_particles_sparks.integer)
- {
- // sparks
for (i = 0;i < 256 * cl_particles_quality.value;i++)
- {
- k = particlepalette[0x68 + (rand() & 7)];
- particle(pt_static, PARTICLE_SPARK, k, k, tex_particle, false, PBLEND_ADD, 1.5f, 0.05f, (1.0f / cl_particles_quality.value) * lhrandom(0, 255), (1.0f / cl_particles_quality.value) * 512, 9999, 1, 0, org[0], org[1], org[2], lhrandom(-192, 192), lhrandom(-192, 192), lhrandom(-192, 192) + 160, 0, 0, 0, 0, 0.2, 0);
- }
- }
+ particle(pt_static, PARTICLE_SPARK, 0x903010, 0xFFD030, tex_particle, false, PBLEND_ADD, 1.5f, 0.05f, (1.0f / cl_particles_quality.value) * lhrandom(0, 255), (1.0f / cl_particles_quality.value) * 512, 9999, 1, 0, org[0], org[1], org[2], lhrandom(-192, 192), lhrandom(-192, 192), lhrandom(-192, 192) + 160, 0, 0, 0, 0, 0.2, 0);
}
if (cl_explosions.integer)
R_NewExplosion(org);
+#endif
}
/*
vec3_t vel;
vec3_t offset;
int i, k;
+ float pscale;
if (!cl_particles.integer) return;
for (i = 0;i < 512 * cl_particles_quality.value;i++)
VectorScale (offset, 192, vel);
VectorScale (offset, 8, offset);
k = particlepalette[colorStart + (i % colorLength)];
- particle(pt_static, PARTICLE_BILLBOARD, k, k, tex_particle, false, PBLEND_ALPHA, 1.5, 1.5, (1.0f / cl_particles_quality.value) * 255, (1.0f / cl_particles_quality.value) * 384, 0.3, 0, 0, org[0] + offset[0], org[1] + offset[1], org[2] + offset[2], vel[0], vel[1], vel[2], 0, 0, 0, 0, 1, 0);
+ pscale = lhrandom(0.5, 1.5);
+ particle(pt_static, PARTICLE_BILLBOARD, k, k, tex_particle, false, PBLEND_ADD, pscale, pscale, (1.0f / cl_particles_quality.value) * 255, (1.0f/cl_particles_quality.value)*512, 9999, 0, 0, org[0] + offset[0], org[1] + offset[1], org[2] + offset[2], vel[0], vel[1], vel[2], 0, 0, 0, 0, lhrandom(1.5, 3), 0);
}
}
{
if (gamemode == GAME_GOODVSBAD2)
particle(pt_static, PARTICLE_BILLBOARD, particlepalette[0 + (rand()&255)], particlepalette[0 + (rand()&255)], tex_particle, false, PBLEND_ALPHA, 6, 6, qd*255, qd*384, 9999, 0, 0, pos[0], pos[1], pos[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 0, 0, 0, 0, 0, 0);
+ else if (gamemode == GAME_PRYDON)
+ particle(pt_static, PARTICLE_BILLBOARD, 0x103040, 0x204050, tex_particle, false, PBLEND_ADD, 6, 6, qd*128, qd*384, 9999, 0, 0, pos[0], pos[1], pos[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 0, 0, 0, 0, 0, 0);
else
particle(pt_static, PARTICLE_BILLBOARD, 0x502030, 0x502030, tex_particle, false, PBLEND_ADD, 6, 6, qd*128, qd*384, 9999, 0, 0, pos[0], pos[1], pos[2], lhrandom(-8, 8), lhrandom(-8, 8), lhrandom(-8, 8), 0, 0, 0, 0, 0, 0);
}
entity_render_t *hitent;
#endif
- cl_freeparticle = 0;
-
// LordHavoc: early out condition
if (!cl_numparticles)
+ {
+ cl_freeparticle = 0;
return;
+ }
#ifdef WORKINGLQUAKE
frametime = cl.frametime;
p->type = pt_dead;
#endif
break;
+ case pt_ember:
+ while (cl.time > p->time2)
+ {
+ p->time2 += 0.025;
+ particle(pt_static, PARTICLE_SPARK, 0x903010, 0xFFD030, tex_particle, false, PBLEND_ADD, p->scalex * 0.75, p->scaley * 0.75, p->alpha, p->alphafade, 9999, 0.5, 0, p->org[0], p->org[1], p->org[2], p->vel[0] * lhrandom(0.4, 0.6), p->vel[1] * lhrandom(0.4, 0.6), p->vel[2] * lhrandom(0.4, 0.6), 0, 0, 0, 0, 0, 0);
+ }
+ break;
default:
Con_Printf("unknown particle type %i\n", p->type);
p->type = pt_dead;
}
}
cl_numparticles = maxparticle + 1;
+ cl_freeparticle = 0;
}
#define MAX_PARTICLETEXTURES 64
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
#else
- particlefonttexture = R_LoadTexture2D(particletexturepool, "particlefont", 256, 256, particletexturedata, TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE, NULL);
+ particlefonttexture = loadtextureimage(particletexturepool, "particles/particlefont.tga", 0, 0, false, TEXF_ALPHA | TEXF_PRECACHE);
+ if (!particlefonttexture)
+ particlefonttexture = R_LoadTexture2D(particletexturepool, "particlefont", 256, 256, particletexturedata, TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE, NULL);
for (i = 0;i < MAX_PARTICLETEXTURES;i++)
particletexture[i].texture = particlefonttexture;
- // beam
+ // nexbeam
fractalnoise(&noise1[0][0], 64, 4);
m = 0;
for (y = 0;y < 64;y++)
}
}
- particletexture[tex_beam].texture = R_LoadTexture2D(particletexturepool, "beam", 16, 64, &data2[0][0][0], TEXTYPE_RGBA, TEXF_PRECACHE, NULL);
+ particletexture[tex_beam].texture = loadtextureimage(particletexturepool, "particles/nexbeam.tga", 0, 0, false, TEXF_ALPHA | TEXF_PRECACHE);
+ if (!particletexture[tex_beam].texture)
+ particletexture[tex_beam].texture = R_LoadTexture2D(particletexturepool, "nexbeam", 16, 64, &data2[0][0][0], TEXTYPE_RGBA, TEXF_PRECACHE, NULL);
particletexture[tex_beam].s1 = 0;
particletexture[tex_beam].t1 = 0;
particletexture[tex_beam].s2 = 1;