mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-25 13:32:01 +00:00
Revamp the software particle rendering loop. Seems to work well.
This commit is contained in:
parent
66e9bfd98c
commit
d5ea4bc9bf
1 changed files with 66 additions and 82 deletions
|
@ -462,7 +462,7 @@ R_DrawParticles
|
|||
*/
|
||||
void R_DrawParticles (void)
|
||||
{
|
||||
particle_t *p, *kill;
|
||||
particle_t *p, **particle;
|
||||
float grav;
|
||||
int i;
|
||||
float time2, time3;
|
||||
|
@ -482,31 +482,15 @@ void R_DrawParticles (void)
|
|||
grav = frametime * 800 * 0.05;
|
||||
dvel = 4*frametime;
|
||||
|
||||
while (1) {
|
||||
kill = active_particles;
|
||||
if (kill != NULL && kill->die < cl.time) {
|
||||
active_particles = kill->next;
|
||||
kill->next = free_particles;
|
||||
free_particles = kill;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
for (p=active_particles ; p ; p=p->next)
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
kill = p->next;
|
||||
if (kill && kill->die < cl.time)
|
||||
{
|
||||
p->next = kill->next;
|
||||
kill->next = free_particles;
|
||||
free_particles = kill;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
for (particle = &active_particles; *particle; ) {
|
||||
if ((*particle)->die < cl.time) {
|
||||
p = (*particle)->next;
|
||||
(*particle)->next = free_particles;
|
||||
free_particles = (*particle);
|
||||
(*particle) = p;
|
||||
} else {
|
||||
p = *particle;
|
||||
particle = &(*particle)->next;
|
||||
|
||||
D_DrawParticle (p);
|
||||
|
||||
|
@ -514,8 +498,7 @@ void R_DrawParticles (void)
|
|||
p->org[1] += p->vel[1]*frametime;
|
||||
p->org[2] += p->vel[2]*frametime;
|
||||
|
||||
switch (p->type)
|
||||
{
|
||||
switch (p->type) {
|
||||
case pt_static:
|
||||
break;
|
||||
case pt_fire:
|
||||
|
@ -567,6 +550,7 @@ void R_DrawParticles (void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
D_EndParticles ();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue