Spotted + fixed some bugs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2459 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2007-01-08 03:10:41 +00:00
parent 47f9440a30
commit 5339cd92e7

View file

@ -898,7 +898,7 @@ void P_ParticleEffect_f(void)
int cidx, i; int cidx, i;
i = 1; i = 1;
while (i <= Cmd_Argc()) while (i < Cmd_Argc())
{ {
ptype->ramp = BZ_Realloc(ptype->ramp, sizeof(ramp_t)*(ptype->rampindexes+1)); ptype->ramp = BZ_Realloc(ptype->ramp, sizeof(ramp_t)*(ptype->rampindexes+1));
@ -1534,7 +1534,7 @@ void P_ExportBuiltinSet_f(void)
if (!*efname) if (!*efname)
{ {
Con_Printf("Please name the built in effect (faithful, spikeset or highfps)\n"); Con_Printf("Please name the built in effect (faithful, spikeset, tsshaft, minimal or highfps)\n");
return; return;
} }
else if (!stricmp(efname, "faithful")) else if (!stricmp(efname, "faithful"))
@ -1543,6 +1543,10 @@ void P_ExportBuiltinSet_f(void)
file = particle_set_spikeset; file = particle_set_spikeset;
else if (!stricmp(efname, "highfps")) else if (!stricmp(efname, "highfps"))
file = particle_set_highfps; file = particle_set_highfps;
else if (!stricmp(efname, "minimal"))
file = particle_set_minimal;
else if (!stricmp(efname, "tsshaft"))
file = particle_set_tsshaft;
else else
{ {
if (!stricmp(efname, "none")) if (!stricmp(efname, "none"))
@ -3961,6 +3965,7 @@ void DrawParticleTypes (void (*texturedparticles)(particle_t *,part_type_t*), vo
beamseg_t *b, *bkill; beamseg_t *b, *bkill;
int traces=r_particle_tracelimit.value; int traces=r_particle_tracelimit.value;
int rampind;
lastgltype = NULL; lastgltype = NULL;
@ -4061,7 +4066,10 @@ void DrawParticleTypes (void (*texturedparticles)(particle_t *,part_type_t*), vo
switch (type->rampmode) switch (type->rampmode)
{ {
case RAMP_ABSOLUTE: case RAMP_ABSOLUTE:
ramp = type->ramp + (int)(type->rampindexes * (type->die - (d->die - particletime)) / type->die); rampind = (int)(type->rampindexes * (type->die - (d->die - particletime)) / type->die);
if (rampind >= type->rampindexes)
rampind = type->rampindexes - 1;
ramp = type->ramp + rampind;
VectorCopy(ramp->rgb, d->rgb); VectorCopy(ramp->rgb, d->rgb);
d->alpha = ramp->alpha; d->alpha = ramp->alpha;
break; break;
@ -4293,13 +4301,19 @@ void DrawParticleTypes (void (*texturedparticles)(particle_t *,part_type_t*), vo
switch (type->rampmode) switch (type->rampmode)
{ {
case RAMP_ABSOLUTE: case RAMP_ABSOLUTE:
ramp = type->ramp + (int)(type->rampindexes * (type->die - (p->die - particletime)) / type->die); rampind = (int)(type->rampindexes * (type->die - (p->die - particletime)) / type->die);
if (rampind >= type->rampindexes)
rampind = type->rampindexes - 1;
ramp = type->ramp + rampind;
VectorCopy(ramp->rgb, p->rgb); VectorCopy(ramp->rgb, p->rgb);
p->alpha = ramp->alpha; p->alpha = ramp->alpha;
p->scale = ramp->scale; p->scale = ramp->scale;
break; break;
case RAMP_DELTA: //particle ramps case RAMP_DELTA: //particle ramps
ramp = type->ramp + (int)(type->rampindexes * (type->die - (p->die - particletime)) / type->die); rampind = (int)(type->rampindexes * (type->die - (p->die - particletime)) / type->die);
if (rampind >= type->rampindexes)
rampind = type->rampindexes - 1;
ramp = type->ramp + rampind;
VectorMA(p->rgb, pframetime, ramp->rgb, p->rgb); VectorMA(p->rgb, pframetime, ramp->rgb, p->rgb);
p->alpha -= pframetime*ramp->alpha; p->alpha -= pframetime*ramp->alpha;
p->scale += pframetime*ramp->scale; p->scale += pframetime*ramp->scale;