{
vec3_t mins, maxs;
int temp;
+ /*
if (ent->render.angles[0] || ent->render.angles[2])
{
- VectorAdd(neworg, ent->render.model->rotatedmins, mins);
- VectorAdd(neworg, ent->render.model->rotatedmaxs, maxs);
+ VectorMA(neworg, 0.25f, ent->render.model->rotatedmins, mins);
+ VectorMA(neworg, 0.25f, ent->render.model->rotatedmaxs, maxs);
}
else if (ent->render.angles[1])
{
- VectorAdd(neworg, ent->render.model->yawmins, mins);
- VectorAdd(neworg, ent->render.model->yawmaxs, maxs);
+ VectorMA(neworg, 0.25f, ent->render.model->yawmins, mins);
+ VectorMA(neworg, 0.25f, ent->render.model->yawmaxs, maxs);
}
else
{
- VectorAdd(neworg, ent->render.model->normalmins, mins);
- VectorAdd(neworg, ent->render.model->normalmaxs, maxs);
+ VectorMA(neworg, 0.25f, ent->render.model->normalmins, mins);
+ VectorMA(neworg, 0.25f, ent->render.model->normalmaxs, maxs);
}
+ */
+ mins[0] = neworg[0] - 16.0f;
+ mins[1] = neworg[1] - 16.0f;
+ mins[2] = neworg[2] - 16.0f;
+ maxs[0] = neworg[0] + 16.0f;
+ maxs[1] = neworg[1] + 16.0f;
+ maxs[2] = neworg[2] + 16.0f;
// how many flames to make
temp = (int) (cl.time * 300) - (int) (cl.oldtime * 300);
CL_FlameCube(mins, maxs, temp);
dlightcolor[1] += d * 0.7f;
dlightcolor[2] += d * 0.3f;
}
+ if (effects & EF_STARDUST)
+ {
+ if (ent->render.model)
+ {
+ vec3_t mins, maxs;
+ int temp;
+ /*
+ if (ent->render.angles[0] || ent->render.angles[2])
+ {
+ VectorMA(neworg, 0.25f, ent->render.model->rotatedmins, mins);
+ VectorMA(neworg, 0.25f, ent->render.model->rotatedmaxs, maxs);
+ }
+ else if (ent->render.angles[1])
+ {
+ VectorMA(neworg, 0.25f, ent->render.model->yawmins, mins);
+ VectorMA(neworg, 0.25f, ent->render.model->yawmaxs, maxs);
+ }
+ else
+ {
+ VectorMA(neworg, 0.25f, ent->render.model->normalmins, mins);
+ VectorMA(neworg, 0.25f, ent->render.model->normalmaxs, maxs);
+ }
+ */
+ mins[0] = neworg[0] - 16.0f;
+ mins[1] = neworg[1] - 16.0f;
+ mins[2] = neworg[2] - 16.0f;
+ maxs[0] = neworg[0] + 16.0f;
+ maxs[1] = neworg[1] + 16.0f;
+ maxs[2] = neworg[2] + 16.0f;
+ // how many particles to make
+ temp = (int) (cl.time * 200) - (int) (cl.oldtime * 200);
+ CL_Stardust(mins, maxs, temp);
+ }
+ d = 100;
+ dlightcolor[0] += d * 1.0f;
+ dlightcolor[1] += d * 0.7f;
+ dlightcolor[2] += d * 0.3f;
+ }
}
// LordHavoc: if the model has no flags, don't check each
else if (ent->render.model->flags & EF_ROCKET)
{
CL_RocketTrail (oldorg, ent->render.origin, 0, ent);
- // LordHavoc: changed from 200, 160, 80 to 250, 200, 100
- dlightcolor[0] += 250.0f;
- dlightcolor[1] += 200.0f;
- dlightcolor[2] += 100.0f;
+ dlightcolor[0] += 200.0f;
+ dlightcolor[1] += 160.0f;
+ dlightcolor[2] += 80.0f;
}
else if (ent->render.model->flags & EF_GRENADE)
{
}
}
// LordHavoc: customizable glow
- glowsize = ent->state_current.glowsize * 4.0f; // FIXME: interpolate?
+ glowsize = ent->state_current.glowsize; // FIXME: interpolate?
glowcolor = ent->state_current.glowcolor;
if (glowsize)
{
qbyte *tempcolor = (qbyte *)&d_8to24table[glowcolor];
- dlightcolor[0] += glowsize * tempcolor[0] * (1.0f / 255.0f);
- dlightcolor[1] += glowsize * tempcolor[1] * (1.0f / 255.0f);
- dlightcolor[2] += glowsize * tempcolor[2] * (1.0f / 255.0f);
+ // * 4 for the expansion from 0-255 to 0-1023 range,
+ // / 255 to scale down byte colors
+ glowsize *= (4.0f / 255.0f);
+ VectorMA(dlightcolor, glowsize, tempcolor, dlightcolor);
}
// LordHavoc: customizable trail
if (ent->render.flags & RENDER_GLOWTRAIL)
if (dlightcolor[0] || dlightcolor[1] || dlightcolor[2])
{
vec3_t vec;
- dlightradius = VectorLength(dlightcolor);
- d = 1.0f / dlightradius;
VectorCopy(neworg, vec);
// hack to make glowing player light shine on their gun
if (i == cl.viewentity && !chase_active.integer)
vec[2] += 30;
- CL_AllocDlight (/*&ent->render*/ NULL, vec, dlightradius, dlightcolor[0] * d, dlightcolor[1] * d, dlightcolor[2] * d, 0, 0);
+ CL_AllocDlight (/*&ent->render*/ NULL, vec, 1, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0);
}
if (chase_active.integer)
typedef enum
{
- pt_static, pt_grav, pt_blob, pt_blob2, pt_bulletsmoke, pt_smoke, pt_snow, pt_rain, pt_spark, pt_bubble, pt_fade, pt_steam, pt_splash, pt_splashpuff, pt_flame, pt_blood, pt_oneframe, pt_lavasplash, pt_raindropsplash, pt_underwaterspark, pt_explosionsplash
+ pt_static, pt_grav, pt_blob, pt_blob2, pt_bulletsmoke, pt_smoke, pt_snow, pt_rain, pt_spark, pt_bubble, pt_fade, pt_steam, pt_splash, pt_splashpuff, pt_flame, pt_blood, pt_oneframe, pt_lavasplash, pt_raindropsplash, pt_underwaterspark, pt_explosionsplash, pt_stardust
}
ptype_t;
typedef struct particle_s
{
ptype_t type;
- unsigned int flags;
- //int orientation; // typically PARTICLE_BILLBOARD
+ unsigned int flags; // dynamically lit, orientation, additive blending, texnum
vec3_t org;
vec3_t vel;
- //int additive;
- //int tex;
float die;
float scalex;
float scaley;
vec3_t vel2; // used for snow fluttering (base velocity, wind for instance)
float friction; // how much air friction affects this object (objects with a low mass/size ratio tend to get more air friction)
float pressure; // if non-zero, apply pressure to other particles
- //int dynlight; // if set the particle will be dynamically lit (if cl_dynamicparticles is on), used for smoke and blood
qbyte color[4];
}
particle_t;
}
}
+void CL_Stardust (vec3_t mins, vec3_t maxs, int count)
+{
+ int k;
+ float t;
+ vec3_t o, v, center;
+ //Con_Printf("CL_Stardust ('%f %f %f', '%f %f %f', %d);\n", mins[0], mins[1], mins[2], maxs[0], maxs[1], maxs[2], count);
+ if (!cl_particles.integer) return;
+
+ if (maxs[0] <= mins[0]) {t = mins[0];mins[0] = maxs[0];maxs[0] = t;}
+ if (maxs[1] <= mins[1]) {t = mins[1];mins[1] = maxs[1];maxs[1] = t;}
+ if (maxs[2] <= mins[2]) {t = mins[2];mins[2] = maxs[2];maxs[2] = t;}
+
+ center[0] = (mins[0] + maxs[0]) * 0.5f;
+ center[1] = (mins[1] + maxs[1]) * 0.5f;
+ center[2] = (mins[2] + maxs[2]) * 0.5f;
+
+ while (count--)
+ {
+ k = particlepalette[224 + (rand()&15)];
+ o[0] = lhrandom(mins[0], maxs[0]);
+ o[1] = lhrandom(mins[1], maxs[1]);
+ o[2] = lhrandom(mins[2], maxs[2]);
+ VectorSubtract(o, center, v);
+ VectorNormalizeFast(v);
+ VectorScale(v, 100, v);
+ v[2] += sv_gravity.value * 0.15f;
+ particle(pt_stardust, PARTICLE_BILLBOARD, 0x903010, 0xFFD030, tex_particle, false, true, 1.5, 1.5, lhrandom(64, 128), 9999, 0, o[0], o[1], o[2], v[0], v[1], v[2], 0, 0, 0, 0, 0, 0);
+ }
+}
+
void CL_FlameCube (vec3_t mins, vec3_t maxs, int count)
{
int k;
while (count--)
{
k = particlepalette[224 + (rand()&15)];
- particle(pt_flame, PARTICLE_BILLBOARD, k, k, tex_particle, false, true, 8, 8, 255, 9999, 1.1, lhrandom(mins[0], maxs[0]), lhrandom(mins[1], maxs[1]), lhrandom(mins[2], maxs[2]), lhrandom(-32, 32), lhrandom(-32, 32), lhrandom(-32, 64), 0, 0, 0, 0, 1, 0);
+ 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);
}
}
while (count--)
{
k = particlepalette[224 + (rand()&15)];
- particle(pt_flame, PARTICLE_BILLBOARD, k, k, tex_particle, false, true, 8, 8, 255, 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);
+ 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 (p->bounce < 0)
{
// assume it's blood (lame, but...)
- R_Stain(v, 64, 32, 16, 16, p->alpha * p->scalex * (1.0f / 100.0f), 128, 48, 48, p->alpha * p->scalex * (1.0f / 100.0f));
+ R_Stain(v, 64, 32, 16, 16, p->alpha * p->scalex * (1.0f / 100.0f), 192, 48, 48, p->alpha * p->scalex * (1.0f / 100.0f));
p->die = -1;
freeparticles[j++] = p;
continue;
break;
*/
case pt_flame:
- p->alpha -= frametime * 512;
+ p->alpha -= frametime * 384;
p->vel[2] += gravity;
if (p->alpha < 16)
p->die = -1;
p->die = -1;
p->time2 = 1;
break;
+ case pt_stardust:
+ p->alpha -= frametime * 128;
+ p->vel[2] -= gravity;
+ if (p->alpha < 16)
+ p->die = -1;
+ break;
default:
printf("unknown particle type %i\n", p->type);
p->die = -1;