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,10 +2068,15 @@ 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);
memcpy(&nts, ts, sizeof(nts)); if (ts)
R_RocketTrail(vec, end, ptype->assoc, &nts); {
trailstate_t nts;
memcpy(&nts, ts, sizeof(nts));
R_RocketTrail(vec, end, ptype->assoc, &nts);
}
else
R_RocketTrail(vec, end, ptype->assoc, NULL);
} }
step = 1/ptype->count; step = 1/ptype->count;
@ -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);
} }
stop = ts->lastdist + len; //when to stop if (ts)
{
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,43 +2262,54 @@ 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;
} }
ts->lastdist = len; if (ts)
// update beamseg list
if (ptype->isbeam)
{ {
if (b) ts->lastdist = len;
// update beamseg list
if (ptype->isbeam)
{ {
if (ptype->beams) if (b)
{ {
if (ts->lastbeam) if (ptype->beams)
{ {
b->next = ts->lastbeam->next; if (ts->lastbeam)
ts->lastbeam->next = bfirst; {
ts->lastbeam->flags &= ~BS_LASTSEG; b->next = ts->lastbeam->next;
ts->lastbeam->next = bfirst;
ts->lastbeam->flags &= ~BS_LASTSEG;
}
else
{
b->next = ptype->beams;
ptype->beams = bfirst;
}
} }
else else
{ {
b->next = ptype->beams;
ptype->beams = bfirst; ptype->beams = bfirst;
b->next = NULL;
} }
b->flags |= BS_LASTSEG;
ts->lastbeam = b;
} }
else
if ((!free_particles || !free_beams) && ts->lastbeam)
{ {
ptype->beams = bfirst; ts->lastbeam->flags &= ~BS_LASTSEG;
b->next = NULL; ts->lastbeam->flags |= BS_NODRAW;
ts->lastbeam = NULL;
} }
b->flags |= BS_LASTSEG;
ts->lastbeam = b;
} }
}
else if (ptype->isbeam)
if ((!free_particles || !free_beams) && ts->lastbeam) {
if (b)
{ {
ts->lastbeam->flags &= ~BS_LASTSEG; b->flags |= BS_NODRAW;
ts->lastbeam->flags |= BS_NODRAW; b->next = ptype->beams;
ts->lastbeam = NULL; ptype->beams = bfirst;
} }
} }
@ -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;