From: divverent Date: Tue, 11 May 2010 09:11:48 +0000 (+0000) Subject: particles: apply rotation so that in the initial display frame of the particle, the... X-Git-Tag: xonotic-v0.1.0preview~230^2~290 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1a36ccfb94ba6000ab545b4f1c934fc6a6cc9344;p=xonotic%2Fdarkplaces.git particles: apply rotation so that in the initial display frame of the particle, the start rotation min/max are shown git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10188 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_particles.c b/cl_particles.c index c33df7ba..1dc96a8b 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -653,6 +653,7 @@ particle_t *CL_NewParticle(const vec3_t sortorigin, unsigned short ptypeindex, i part->airfriction = pairfriction; part->liquidfriction = pliquidfriction; part->die = cl.time + lifetime; + part->delayedspawn = cl.time; // part->delayedcollisions = 0; part->qualityreduction = pqualityreduction; part->angle = angle; @@ -2521,7 +2522,7 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh case PARTICLE_BILLBOARD: if (p->angle + p->spin) { - spinrad = (p->angle + p->spin * spintime) * (float)(M_PI / 180.0f); + spinrad = (p->angle + p->spin * (spintime - p->delayedspawn)) * (float)(M_PI / 180.0f); spinsin = sin(spinrad) * size; spincos = cos(spinrad) * size; spinm1 = -p->stretch * spincos; @@ -2558,7 +2559,7 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh VectorVectors(p->vel, baseright, baseup); if (p->angle + p->spin) { - spinrad = (p->angle + p->spin * spintime) * (float)(M_PI / 180.0f); + spinrad = (p->angle + p->spin * (spintime - p->delayedspawn)) * (float)(M_PI / 180.0f); spinsin = sin(spinrad) * size; spincos = cos(spinrad) * size; spinm1 = p->stretch * spincos; @@ -2714,7 +2715,6 @@ void R_DrawParticles (void) { if (p->delayedspawn > cl.time) continue; - p->delayedspawn = 0; p->size += p->sizeincrease * frametime; p->alpha -= p->alphafade * frametime; @@ -2853,7 +2853,7 @@ void R_DrawParticles (void) } } } - else if (p->delayedspawn) + else if (p->delayedspawn > cl.time) continue; if (!drawparticles) continue;