engine: client: use generic particles code for blob particles (from tempentity code) only if Quake compatibility was enabled

This commit is contained in:
Alibek Omarov 2022-09-08 04:15:09 +03:00
parent e6bb9d980d
commit 7a2ac4a9c0

View File

@ -1111,9 +1111,13 @@ R_ParticleExplosion2
void GAME_EXPORT R_ParticleExplosion2( const vec3_t org, int colorStart, int colorLength ) void GAME_EXPORT R_ParticleExplosion2( const vec3_t org, int colorStart, int colorLength )
{ {
int i, j; int i, j;
int colorMod = 0; int colorMod = 0, packedColor;
particle_t *p; particle_t *p;
if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
packedColor = 255; // use old code for blob particles
else packedColor = 0;
for( i = 0; i < 512; i++ ) for( i = 0; i < 512; i++ )
{ {
p = R_AllocParticle( NULL ); p = R_AllocParticle( NULL );
@ -1121,7 +1125,7 @@ void GAME_EXPORT R_ParticleExplosion2( const vec3_t org, int colorStart, int col
p->die = cl.time + 0.3f; p->die = cl.time + 0.3f;
p->color = colorStart + ( colorMod % colorLength ); p->color = colorStart + ( colorMod % colorLength );
p->packedColor = 255; // use old code for blob particles p->packedColor = packedColor;
colorMod++; colorMod++;
p->type = pt_blob; p->type = pt_blob;
@ -1143,15 +1147,19 @@ R_BlobExplosion
void GAME_EXPORT R_BlobExplosion( const vec3_t org ) void GAME_EXPORT R_BlobExplosion( const vec3_t org )
{ {
particle_t *p; particle_t *p;
int i, j; int i, j, packedColor;
if( FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE ))
packedColor = 255; // use old code for blob particles
else packedColor = 0;
for( i = 0; i < 1024; i++ ) for( i = 0; i < 1024; i++ )
{ {
p = R_AllocParticle( NULL ); p = R_AllocParticle( NULL );
if( !p ) return; if( !p ) return;
p->die = cl.time + COM_RandomFloat( 2.0f, 2.4f ); p->die = cl.time + COM_RandomFloat( 1.0f, 1.4f );
p->packedColor = 255; // use old code for blob particles p->packedColor = packedColor;
if( i & 1 ) if( i & 1 )
{ {