diff --git a/src/p_effect.cpp b/src/p_effect.cpp index 5e6189d6d..d6c4c3a5f 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -151,8 +151,7 @@ void P_InitParticles () NumParticles = r_maxparticles; // This should be good, but eh... - if ( NumParticles < 100 ) - NumParticles = 100; + NumParticles = clamp(NumParticles, 100, 65535); P_DeinitParticles(); Particles = new particle_t[NumParticles]; @@ -688,8 +687,7 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end p->ttl = duration; p->fade = FADEFROMTTL(duration); p->size = 3; - if(fullbright) - p->bright = true; + p->bright = fullbright; tempvec = FMatrix3x3(dir, deg) * extend; p->velx = FLOAT2FIXED(tempvec.X * drift)>>4; @@ -760,6 +758,8 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end p->accz -= FRACUNIT/4096; pos += trail_step; + p->bright = fullbright; + if (color2 == -1) { int rand = M_Random(); diff --git a/src/p_effect.h b/src/p_effect.h index bd0aae60f..66621573a 100644 --- a/src/p_effect.h +++ b/src/p_effect.h @@ -59,13 +59,13 @@ struct particle_t fixed_t accx,accy,accz; BYTE ttl; BYTE trans; - BYTE size; + BYTE size:7; + BYTE bright:1; BYTE fade; int color; WORD tnext; WORD snext; subsector_t * subsector; - bool bright; }; extern particle_t *Particles;