git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@359 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2004-10-19 21:56:31 +00:00
parent ae3545ef6d
commit 6976b04908
2 changed files with 57 additions and 35 deletions

View File

@ -877,7 +877,7 @@ void CL_ParseCustomTEnt(void)
{ {
MSG_ReadPos (pos); MSG_ReadPos (pos);
MSG_ReadPos (pos2); MSG_ReadPos (pos2);
R_RocketTrail(pos, pos2, t->particleeffecttype, 0); R_RocketTrail(pos, pos2, t->particleeffecttype, NULL);
} }
else else
{ {
@ -1744,9 +1744,7 @@ void CL_UpdateBeams (void)
*/ */
// if (part_type[rt_lightning1].loaded) // if (part_type[rt_lightning1].loaded)
{ {
trailstate_t ts; R_RocketTrail(b->start, b->end, rt_lightning1, NULL);
memset(&ts, 0, sizeof(ts));
R_RocketTrail(b->start, b->end, rt_lightning1, &ts);
continue; continue;
} }

View File

@ -2018,7 +2018,7 @@ void R_TeleportSplash (vec3_t org)
void CLQ2_BlasterTrail (vec3_t start, vec3_t end) void CLQ2_BlasterTrail (vec3_t start, vec3_t end)
{ {
R_RocketTrail(start, end, rt_blastertrail, 0); R_RocketTrail(start, end, rt_blastertrail, NULL);
} }
void R_BlasterParticles (vec3_t start, vec3_t dir) void R_BlasterParticles (vec3_t start, vec3_t dir)
{ {
@ -2068,11 +2068,16 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, trailstate_t *ts)
if (ptype->assoc>=0) if (ptype->assoc>=0)
{ {
trailstate_t nts;
VectorCopy(start, vec); VectorCopy(start, vec);
if (ts)
{
trailstate_t nts;
memcpy(&nts, ts, sizeof(nts)); memcpy(&nts, ts, sizeof(nts));
R_RocketTrail(vec, end, ptype->assoc, &nts); R_RocketTrail(vec, end, ptype->assoc, &nts);
} }
else
R_RocketTrail(vec, end, ptype->assoc, NULL);
}
step = 1/ptype->count; step = 1/ptype->count;
if (step < 0.01) if (step < 0.01)
@ -2093,13 +2098,21 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, trailstate_t *ts)
// VectorScale(up, ptype->offsetspread, up); // VectorScale(up, ptype->offsetspread, up);
} }
if (ts)
{
stop = ts->lastdist + len; //when to stop stop = ts->lastdist + len; //when to stop
len = ts->lastdist;
}
else
{
stop = len;
len = 0;
}
// len = ts->lastdist/step; // len = ts->lastdist/step;
// len = (len - (int)len)*step; // len = (len - (int)len)*step;
// VectorMA (start, -len, vec, start); // VectorMA (start, -len, vec, start);
len = ts->lastdist;
b = bfirst = NULL; b = bfirst = NULL;
@ -2249,6 +2262,8 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, trailstate_t *ts)
p->die = particletime + ptype->die - p->die; p->die = particletime + ptype->die - p->die;
} }
if (ts)
{
ts->lastdist = len; ts->lastdist = len;
// update beamseg list // update beamseg list
@ -2280,7 +2295,6 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, trailstate_t *ts)
ts->lastbeam = b; ts->lastbeam = b;
} }
if ((!free_particles || !free_beams) && ts->lastbeam) if ((!free_particles || !free_beams) && ts->lastbeam)
{ {
ts->lastbeam->flags &= ~BS_LASTSEG; ts->lastbeam->flags &= ~BS_LASTSEG;
@ -2288,6 +2302,16 @@ void R_RocketTrail (vec3_t start, vec3_t end, int type, trailstate_t *ts)
ts->lastbeam = NULL; ts->lastbeam = NULL;
} }
} }
}
else if (ptype->isbeam)
{
if (b)
{
b->flags |= BS_NODRAW;
b->next = ptype->beams;
ptype->beams = bfirst;
}
}
return; //distance the trail actually moved. return; //distance the trail actually moved.
} }
@ -2306,7 +2330,7 @@ void R_TorchEffect (vec3_t pos, int type)
void CLQ2_BubbleTrail (vec3_t start, vec3_t end) void CLQ2_BubbleTrail (vec3_t start, vec3_t end)
{ {
R_RocketTrail(start, end, rt_bubbletrail, 0); R_RocketTrail(start, end, rt_bubbletrail, NULL);
} }
#ifdef Q2BSPS #ifdef Q2BSPS
@ -2941,7 +2965,7 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
if (type->emit >= 0) if (type->emit >= 0)
{ {
if (type->emittime < 0) if (type->emittime < 0)
R_RocketTrail(oldorg, p->org, type->emit, 0); R_RocketTrail(oldorg, p->org, type->emit, NULL);
else if (p->nextemit < particletime) else if (p->nextemit < particletime)
{ {
p->nextemit = particletime + type->emittime + frandom()*type->emitrand; p->nextemit = particletime + type->emittime + frandom()*type->emitrand;